Skip to content

Commit

Permalink
0.1.0 rc
Browse files Browse the repository at this point in the history
  • Loading branch information
aiwenmo committed Jun 4, 2021
1 parent 31384a4 commit dc9f83c
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 235 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.dlink.controller;

import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* AntDesignController
*
* @author wenmo
* @since 2021/6/4 9:00
**/
@Controller
public class AntDesignController implements ErrorController {
@Override
public String getErrorPath(){
return "/error";
}
@RequestMapping(value = "/error")
public String getIndex(){
return "index"; //返回index页面
}

/*@RequestMapping("/api/**")
public ApiResult api(HttpServletRequest request, HttpServletResponse response){
return apiProxy.proxy(request, response);
}
@RequestMapping(value="/**", method=HTTPMethod.GET)
public String index(){
return "index";
}*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public RunResult executeSql(StudioExecuteDTO studioExecuteDTO) {
Assert.check(cluster);
host = FlinkCluster.testFlinkJobManagerIP(cluster.getHosts(), cluster.getJobManagerHost());
Assert.checkHost(host);
if(!host.equals(cluster.getJobManagerHost())){
cluster.setJobManagerHost(host);
clusterService.updateById(cluster);
}
}
JobManager jobManager = new JobManager(host,studioExecuteDTO.getSession(),studioExecuteDTO.getMaxRowNum());
return jobManager.execute(studioExecuteDTO.getStatement(), new ExecutorSetting(
Expand All @@ -57,6 +61,10 @@ public RunResult executeDDL(StudioDDLDTO studioDDLDTO) {
Assert.check(cluster);
host = FlinkCluster.testFlinkJobManagerIP(cluster.getHosts(), cluster.getJobManagerHost());
Assert.checkHost(host);
if(!host.equals(cluster.getJobManagerHost())){
cluster.setJobManagerHost(host);
clusterService.updateById(cluster);
}
}
JobManager jobManager = new JobManager(host,studioDDLDTO.getSession(),1000);
return jobManager.execute(studioDDLDTO.getStatement(), new ExecutorSetting(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public SubmitResult submitByTaskId(Integer id) {
Assert.check(statement);
String host = FlinkCluster.testFlinkJobManagerIP(cluster.getHosts(), cluster.getJobManagerHost());
Assert.checkHost(host);
if(!host.equals(cluster.getJobManagerHost())){
cluster.setJobManagerHost(host);
clusterService.updateById(cluster);
}
JobManager jobManager = new JobManager(host);
return jobManager.submit(statement.getStatement(), task.getRemoteExecutorSetting());
}
Expand Down
6 changes: 3 additions & 3 deletions dlink-admin/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
spring:
datasource:
url: jdbc:mysql://192.168.24.1:3306/dlink?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
username: dlink
password: dlink
url: jdbc:mysql://10.1.51.25:3306/dlink?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
username: dfly
password: Dareway@2020
driver-class-name: com.mysql.cj.jdbc.Driver
application:
name: dlink
Expand Down
6 changes: 3 additions & 3 deletions dlink-web/config/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ export default [
icon: 'consoleSql',
component: './FlinkSqlStudio',
},
{
/*{
path: '/task',
name: 'task',
icon: 'partition',
component: './Task',
},
},*/
{
path: '/cluster',
name: 'cluster',
Expand All @@ -42,7 +42,7 @@ export default [
{
path: '/document',
name: 'document',
icon: 'cluster',
icon: 'container',
component: './Document',
},
/*{
Expand Down
9 changes: 5 additions & 4 deletions dlink-web/src/components/Studio/StudioConnector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ const StudioConnector = (props:any) => {
let newTableData = tableData;
for (let i=0; i<newTableData.length; i++) {
if (newTableData[i].tablename == item.tablename) {
// newTableData.splice(i, 1);
delete newTableData[i];
setTableData(newTableData);
newTableData.splice(i, 1);
// delete newTableData[i];
// setTableData(newTableData);
getTables();
break;
}
}
Expand Down Expand Up @@ -190,7 +191,7 @@ const StudioConnector = (props:any) => {
>
获取Connectors
</Button>
{tableData.length>0?(<Table dataSource={tableData} columns={getColumns()} />):(<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />)}
{tableData&&tableData.length>0?(<Table dataSource={tableData} columns={getColumns()} />):(<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />)}
</>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import {DownOutlined, HeartOutlined, PlusOutlined, UserOutlined} from '@ant-design/icons';
import {Button, message, Input, Drawer, Modal} from 'antd';
import { Input, Drawer, Modal} from 'antd';
import React, {useState, useRef} from 'react';
import {PageContainer, FooterToolbar} from '@ant-design/pro-layout';
import type {ProColumns, ActionType} from '@ant-design/pro-table';
import ProTable from '@ant-design/pro-table';
import ProDescriptions from '@ant-design/pro-descriptions';

import type {DocumentTableListItem} from '@/pages/Document/data.d';

import { queryData,} from "@/components/Common/crud";
import {connect} from "umi";
import {StateType} from "@/pages/FlinkSqlStudio/model";

const url = '/api/document';

const StudioDocument = () => {
const StudioFX = () => {
const actionRef = useRef<ActionType>();
const [row, setRow] = useState<DocumentTableListItem>();
const columns: ProColumns<DocumentTableListItem>[] = [
Expand Down Expand Up @@ -186,7 +182,7 @@ const StudioDocument = () => {
dataIndex: 'likeNum',
hideInForm: true,
hideInSearch: true,
hideInTable: false,
hideInTable: true,
},
{
title: '是否启用',
Expand Down Expand Up @@ -253,7 +249,7 @@ const StudioDocument = () => {
return (
<>
<ProTable<DocumentTableListItem>
headerTitle="文档管理"
headerTitle="文档浏览"
actionRef={actionRef}
rowKey="id"
search={{
Expand Down Expand Up @@ -287,6 +283,4 @@ const StudioDocument = () => {
</>);
};

export default connect(({ Studio }: { Studio: StateType }) => ({
current: Studio.current,
}))(StudioDocument);
export default StudioFX;
4 changes: 2 additions & 2 deletions dlink-web/src/components/Studio/StudioConsole/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import styles from "./index.less";
import StudioMsg from "./StudioMsg";
import StudioTable from "./StudioTable";
import StudioHistory from "./StudioHistory";
import StudioDocument from "./StudioDocument";
import StudioFX from "./StudioFX";

const { TabPane } = Tabs;

Expand Down Expand Up @@ -81,7 +81,7 @@ const StudioConsole = (props:any) => {
}
key="6"
>
<StudioDocument />
<StudioFX />
</TabPane>
<TabPane
tab={
Expand Down
199 changes: 0 additions & 199 deletions dlink-web/src/components/Studio/StudioFX/index.tsx

This file was deleted.

Loading

0 comments on commit dc9f83c

Please sign in to comment.