Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dlink
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaowei
dlink
Commits
dc9f83c2
Commit
dc9f83c2
authored
Jun 04, 2021
by
godkaikai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.1.0 rc
parent
31384a46
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
72 additions
and
235 deletions
+72
-235
AntDesignController.java
...c/main/java/com/dlink/controller/AntDesignController.java
+36
-0
StudioServiceImpl.java
...c/main/java/com/dlink/service/impl/StudioServiceImpl.java
+8
-0
TaskServiceImpl.java
...src/main/java/com/dlink/service/impl/TaskServiceImpl.java
+4
-0
application.yml
dlink-admin/src/main/resources/application.yml
+3
-3
routes.ts
dlink-web/config/routes.ts
+3
-3
index.tsx
dlink-web/src/components/Studio/StudioConnector/index.tsx
+5
-4
index.tsx
...eb/src/components/Studio/StudioConsole/StudioFX/index.tsx
+5
-11
index.tsx
dlink-web/src/components/Studio/StudioConsole/index.tsx
+2
-2
index.tsx
dlink-web/src/components/Studio/StudioFX/index.tsx
+0
-199
index.tsx
dlink-web/src/components/Studio/index.tsx
+2
-1
index.tsx
dlink-web/src/pages/Document/index.tsx
+3
-11
Welcome.tsx
dlink-web/src/pages/Welcome.tsx
+1
-1
No files found.
dlink-admin/src/main/java/com/dlink/controller/AntDesignController.java
0 → 100644
View file @
dc9f83c2
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";
}*/
}
\ No newline at end of file
dlink-admin/src/main/java/com/dlink/service/impl/StudioServiceImpl.java
View file @
dc9f83c2
...
...
@@ -38,6 +38,10 @@ public class StudioServiceImpl implements StudioService {
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
(
...
...
@@ -57,6 +61,10 @@ public class StudioServiceImpl implements StudioService {
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
(
...
...
dlink-admin/src/main/java/com/dlink/service/impl/TaskServiceImpl.java
View file @
dc9f83c2
...
...
@@ -43,6 +43,10 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
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
());
}
...
...
dlink-admin/src/main/resources/application.yml
View file @
dc9f83c2
spring
:
datasource
:
url
:
jdbc:mysql://1
92.168.24.1
:3306/dlink?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
username
:
d
link
password
:
dlink
url
:
jdbc:mysql://1
0.1.51.25
:3306/dlink?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
username
:
d
fly
password
:
Dareway@2020
driver-class-name
:
com.mysql.cj.jdbc.Driver
application
:
name
:
dlink
...
...
dlink-web/config/routes.ts
View file @
dc9f83c2
...
...
@@ -27,12 +27,12 @@ export default [
icon
:
'consoleSql'
,
component
:
'./FlinkSqlStudio'
,
},
{
/*
{
path: '/task',
name: 'task',
icon: 'partition',
component: './Task',
},
},
*/
{
path
:
'/cluster'
,
name
:
'cluster'
,
...
...
@@ -42,7 +42,7 @@ export default [
{
path
:
'/document'
,
name
:
'document'
,
icon
:
'c
lust
er'
,
icon
:
'c
ontain
er'
,
component
:
'./Document'
,
},
/*{
...
...
dlink-web/src/components/Studio/StudioConnector/index.tsx
View file @
dc9f83c2
...
...
@@ -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
;
}
}
...
...
@@ -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
}
/>)
}
</>
);
};
...
...
dlink-web/src/components/Studio/StudioConsole/Studio
Document
/index.tsx
→
dlink-web/src/components/Studio/StudioConsole/Studio
FX
/index.tsx
View file @
dc9f83c2
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'
;
...
...
@@ -9,12 +7,10 @@ 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
Studio
Document
=
()
=>
{
const
Studio
FX
=
()
=>
{
const
actionRef
=
useRef
<
ActionType
>
();
const
[
row
,
setRow
]
=
useState
<
DocumentTableListItem
>
();
const
columns
:
ProColumns
<
DocumentTableListItem
>
[]
=
[
...
...
@@ -186,7 +182,7 @@ const StudioDocument = () => {
dataIndex
:
'likeNum'
,
hideInForm
:
true
,
hideInSearch
:
true
,
hideInTable
:
fals
e
,
hideInTable
:
tru
e
,
},
{
title
:
'是否启用'
,
...
...
@@ -253,7 +249,7 @@ const StudioDocument = () => {
return
(
<>
<
ProTable
<
DocumentTableListItem
>
headerTitle="文档
管理
"
headerTitle="文档
浏览
"
actionRef=
{
actionRef
}
rowKey="id"
search=
{
{
...
...
@@ -287,6 +283,4 @@ const StudioDocument = () => {
</>
);
};
export default connect((
{
Studio
}
:
{
Studio
:
StateType
}
) =
>
(
{
current
:
Studio
.
current
,
}
))(StudioDocument);
export default StudioFX;
dlink-web/src/components/Studio/StudioConsole/index.tsx
View file @
dc9f83c2
...
...
@@ -7,7 +7,7 @@ import styles from "./index.less";
import
StudioMsg
from
"./StudioMsg"
;
import
StudioTable
from
"./StudioTable"
;
import
StudioHistory
from
"./StudioHistory"
;
import
Studio
Document
from
"./StudioDocument
"
;
import
Studio
FX
from
"./StudioFX
"
;
const
{
TabPane
}
=
Tabs
;
...
...
@@ -81,7 +81,7 @@ const StudioConsole = (props:any) => {
}
key=
"6"
>
<
Studio
Document
/>
<
Studio
FX
/>
</
TabPane
>
<
TabPane
tab=
{
...
...
dlink-web/src/components/Studio/StudioFX/index.tsx
deleted
100644 → 0
View file @
31384a46
import
{
message
,
Input
,
Button
,
Space
,
Table
,
Dropdown
,
Menu
,
Empty
,
Divider
}
from
"antd"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
connect
}
from
"umi"
;
import
{
useState
}
from
"react"
;
// import Highlighter from 'react-highlight-words';
import
{
SearchOutlined
,
DownOutlined
,
TableOutlined
}
from
'@ant-design/icons'
;
import
React
from
"react"
;
import
{
executeDDL
}
from
"@/pages/FlinkSqlStudio/service"
;
const
StudioConnector
=
(
props
:
any
)
=>
{
const
{
current
}
=
props
;
const
[
tableData
,
setTableData
]
=
useState
<
[]
>
([]);
const
[
loadings
,
setLoadings
]
=
useState
<
boolean
[]
>
([]);
const
[
searchText
,
setSearchText
]
=
useState
<
string
>
(
''
);
const
[
searchedColumn
,
setSearchedColumn
]
=
useState
<
string
>
(
''
);
const
getColumnSearchProps
=
(
dIndex
)
=>
({
filterDropdown
:
({
setSelectedKeys
,
selectedKeys
,
confirm
,
clearFilters
})
=>
(
<
div
style=
{
{
padding
:
8
}
}
>
<
Input
placeholder=
{
`Search ${dIndex}`
}
value=
{
selectedKeys
[
0
]
}
onChange=
{
e
=>
setSelectedKeys
(
e
.
target
.
value
?
[
e
.
target
.
value
]
:
[])
}
onPressEnter=
{
()
=>
handleSearch
(
selectedKeys
,
confirm
,
dIndex
)
}
style=
{
{
marginBottom
:
8
,
display
:
'block'
}
}
/>
<
Space
>
<
Button
type=
"primary"
onClick=
{
()
=>
handleSearch
(
selectedKeys
,
confirm
,
dIndex
)
}
icon=
{
<
SearchOutlined
/>
}
size=
"small"
style=
{
{
width
:
90
}
}
>
搜索
</
Button
>
<
Button
onClick=
{
()
=>
handleReset
(
clearFilters
)
}
size=
"small"
style=
{
{
width
:
90
}
}
>
重置
</
Button
>
<
Button
type=
"link"
size=
"small"
onClick=
{
()
=>
{
setSearchText
(
selectedKeys
[
0
]);
setSearchedColumn
(
dIndex
);
}
}
>
过滤
</
Button
>
</
Space
>
</
div
>
),
filterIcon
:
filtered
=>
<
SearchOutlined
style=
{
{
color
:
filtered
?
'#1890ff'
:
undefined
}
}
/>,
onFilter
:
(
value
,
record
)
=>
record
[
dIndex
]
?
record
[
dIndex
].
toString
().
toLowerCase
().
includes
(
value
.
toLowerCase
())
:
''
,
/*render: text =>
searchedColumn === dIndex ? (
<Highlighter
highlightStyle={{ backgroundColor: '#ffc069', padding: 0 }}
searchWords={[searchText]}
autoEscape
textToHighlight={text ? text.toString() : ''}
/>
) : (
text
),*/
});
const
handleSearch
=
(
selectedKeys
,
confirm
,
dIndex
)
=>
{
confirm
();
setSearchText
(
selectedKeys
[
0
]);
setSearchedColumn
(
dIndex
);
};
const
handleReset
=
(
clearFilters
)
=>
{
clearFilters
();
setSearchText
(
''
);
};
const
MoreBtn
:
React
.
FC
<
{
item
:
any
}
>
=
({
item
})
=>
(
<
Dropdown
overlay=
{
<
Menu
onClick=
{
({
key
})
=>
keyEvent
(
key
,
item
)
}
>
<
Menu
.
Item
key=
"desc"
>
描述
</
Menu
.
Item
>
<
Menu
.
Item
key=
"delete"
>
删除
</
Menu
.
Item
>
</
Menu
>
}
>
<
a
>
更多
<
DownOutlined
/>
</
a
>
</
Dropdown
>
);
const
keyEvent
=
(
key
,
item
)
=>
{
if
(
key
==
'delete'
){
let
newLoadings
=
[...
loadings
];
newLoadings
[
1
]
=
true
;
setLoadings
(
newLoadings
);
const
res
=
executeDDL
({
statement
:
"drop table "
+
item
.
tablename
,
clusterId
:
current
.
task
.
clusterId
,
session
:
current
.
task
.
session
,
});
res
.
then
((
result
)
=>
{
if
(
result
.
datas
.
success
){
let
newTableData
=
tableData
;
for
(
let
i
=
0
;
i
<
newTableData
.
length
;
i
++
)
{
if
(
newTableData
[
i
].
tablename
==
item
.
tablename
)
{
newTableData
.
splice
(
i
,
1
);
setTableData
(
newTableData
);
break
;
}
}
}
let
newLoadings
=
[...
loadings
];
newLoadings
[
1
]
=
false
;
setLoadings
(
newLoadings
);
});
}
else
{
message
.
warn
(
"敬请期待"
);
}
};
const
getTables
=
()
=>
{
let
newLoadings
=
[...
loadings
];
newLoadings
[
0
]
=
true
;
setLoadings
(
newLoadings
);
const
res
=
executeDDL
({
statement
:
"show tables"
,
clusterId
:
current
.
task
.
clusterId
,
session
:
current
.
task
.
session
,
});
res
.
then
((
result
)
=>
{
if
(
result
.
datas
.
result
.
rowData
.
length
>
0
){
setTableData
(
result
.
datas
.
result
.
rowData
);
}
else
{
setTableData
([]);
}
let
newLoadings
=
[...
loadings
];
newLoadings
[
0
]
=
false
;
setLoadings
(
newLoadings
);
});
};
const
getColumns
=
()
=>
{
let
columns
:
any
=
[{
title
:
"表名"
,
dataIndex
:
"tablename"
,
key
:
"tablename"
,
sorter
:
true
,
...
getColumnSearchProps
(
"tablename"
),
},{
title
:
'操作'
,
dataIndex
:
'option'
,
valueType
:
'option'
,
render
:
(
_
,
record
)
=>
[
<
a
onClick=
{
()
=>
{
message
.
warn
(
'敬请期待'
);
}
}
>
描述
</
a
>,<
Divider
type=
"vertical"
/>,<
a
onClick=
{
()
=>
{
keyEvent
(
'delete'
,
record
);
}
}
>
删除
</
a
>
],
},];
return
columns
;
};
return
(
<>
<
Button
type=
"primary"
icon=
{
<
TableOutlined
/>
}
loading=
{
loadings
[
0
]
}
onClick=
{
()
=>
getTables
()
}
>
获取Connectors
</
Button
>
{
tableData
.
length
>
0
?(<
Table
dataSource=
{
tableData
}
columns=
{
getColumns
()
}
/>):(<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>)
}
</>
);
};
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
current
:
Studio
.
current
,
}))(
StudioConnector
);
dlink-web/src/components/Studio/index.tsx
View file @
dc9f83c2
...
...
@@ -5,7 +5,7 @@ import {BarsOutlined,SettingOutlined,AuditOutlined,ScheduleOutlined,AppstoreOutl
FireOutlined
}
from
"@ant-design/icons"
;
import
StudioMenu
from
"./StudioMenu"
;
import
{
Row
,
Col
,
Card
,
Empty
,
Tabs
,
Form
}
from
"antd"
;
import
{
Row
,
Col
,
Card
,
Empty
,
Tabs
,
Form
,
BackTop
}
from
"antd"
;
import
StudioTree
from
"./StudioTree"
;
import
StudioTabs
from
"./StudioTabs"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
...
...
@@ -75,6 +75,7 @@ const Studio: React.FC<StudioProps> = ({sql}) => {
</
Col
>
</
Row
>
</
Card
>
<
BackTop
/>
</
div
>
)
};
...
...
dlink-web/src/pages/Document/index.tsx
View file @
dc9f83c2
...
...
@@ -46,11 +46,6 @@ const DocumentTableList: React.FC<{}> = () => {
}
};
const
checkHeartBeats
=
async
()
=>
{
await
handleOption
(
url
+
'/heartbeats'
,
'心跳检测'
,
null
);
actionRef
.
current
?.
reloadAndRest
?.();
};
const
MoreBtn
:
React
.
FC
<
{
item
:
DocumentTableListItem
;
}
>
=
({
item
})
=>
(
...
...
@@ -219,21 +214,21 @@ const DocumentTableList: React.FC<{}> = () => {
dataIndex
:
'description'
,
valueType
:
'textarea'
,
hideInForm
:
false
,
hideInSearch
:
tru
e
,
hideInSearch
:
fals
e
,
hideInTable
:
true
,
},
{
title
:
'版本'
,
sorter
:
true
,
dataIndex
:
'version'
,
hideInForm
:
tru
e
,
hideInForm
:
fals
e
,
hideInSearch
:
true
,
hideInTable
:
true
,
},
{
title
:
'是否启用'
,
dataIndex
:
'enabled'
,
hideInForm
:
tru
e
,
hideInForm
:
fals
e
,
hideInSearch
:
true
,
hideInTable
:
false
,
filters
:
[
...
...
@@ -318,9 +313,6 @@ const DocumentTableList: React.FC<{}> = () => {
<
Button
type=
"primary"
onClick=
{
()
=>
handleModalVisible
(
true
)
}
>
<
PlusOutlined
/>
新建
</
Button
>,
<
Button
type=
"primary"
onClick=
{
()
=>
checkHeartBeats
()
}
>
<
HeartOutlined
/>
心跳
</
Button
>,
]
}
request=
{
(
params
,
sorter
,
filter
)
=>
queryData
(
url
,{...
params
,
sorter
,
filter
})
}
columns=
{
columns
}
...
...
dlink-web/src/pages/Welcome.tsx
View file @
dc9f83c2
...
...
@@ -86,7 +86,7 @@ export default (): React.ReactNode => {
<
Link
href=
""
>
FlinkSql Studio 自动完成函数
</
Link
>
</
li
>
<
li
>
<
Link
href=
""
>
细节优化
</
Link
>
<
Link
href=
""
>
用户与授权
</
Link
>
</
li
>
</
ul
>
</
Paragraph
></>
}
reverse=
{
true
}
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment