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
a65ab4b6
Commit
a65ab4b6
authored
Jun 22, 2021
by
godkaikai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.2.3
parent
581960ab
Changes
18
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
179 additions
and
118 deletions
+179
-118
pom.xml
dlink-admin/pom.xml
+1
-1
application.yml
dlink-admin/src/main/resources/application.yml
+3
-0
pom.xml
dlink-client/dlink-client-1.12/pom.xml
+1
-1
pom.xml
dlink-client/dlink-client-1.13/pom.xml
+1
-1
pom.xml
dlink-client/pom.xml
+1
-1
pom.xml
dlink-connectors/dlink-connector-jdbc/pom.xml
+1
-1
pom.xml
dlink-connectors/pom.xml
+1
-1
pom.xml
dlink-core/pom.xml
+1
-1
pom.xml
dlink-function/pom.xml
+1
-1
index.tsx
dlink-web/src/components/Studio/StudioConnector/index.tsx
+7
-24
index.tsx
...src/components/Studio/StudioConsole/StudioTable/index.tsx
+3
-3
DDL.ts
dlink-web/src/components/Studio/StudioEvent/DDL.ts
+25
-0
FlinkSQL.ts
dlink-web/src/components/Studio/StudioEvent/FlinkSQL.ts
+6
-0
index.tsx
dlink-web/src/components/Studio/StudioMenu/index.tsx
+4
-3
index.tsx
dlink-web/src/components/Studio/StudioSetting/index.tsx
+7
-0
model.ts
dlink-web/src/pages/FlinkSqlStudio/model.ts
+105
-78
Welcome.tsx
dlink-web/src/pages/Welcome.tsx
+10
-1
pom.xml
pom.xml
+1
-1
No files found.
dlink-admin/pom.xml
View file @
a65ab4b6
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
dlink
</artifactId>
<artifactId>
dlink
</artifactId>
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<version>
0.
3.0-SANPSHOT
</version>
<version>
0.
2.3
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
dlink-admin/src/main/resources/application.yml
View file @
a65ab4b6
...
@@ -8,6 +8,9 @@ spring:
...
@@ -8,6 +8,9 @@ spring:
name
:
dlink
name
:
dlink
flyway
:
flyway
:
enabled
:
true
enabled
:
true
clean-disabled
:
true
# baseline-on-migrate: true
table
:
dlink_schema_history
server
:
server
:
port
:
8888
port
:
8888
...
...
dlink-client/dlink-client-1.12/pom.xml
View file @
a65ab4b6
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
dlink-client
</artifactId>
<artifactId>
dlink-client
</artifactId>
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<version>
0.
3.0-SANPSHOT
</version>
<version>
0.
2.3
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
...
...
dlink-client/dlink-client-1.13/pom.xml
View file @
a65ab4b6
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
dlink-client
</artifactId>
<artifactId>
dlink-client
</artifactId>
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<version>
0.
3.0-SANPSHOT
</version>
<version>
0.
2.3
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
...
...
dlink-client/pom.xml
View file @
a65ab4b6
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
dlink
</artifactId>
<artifactId>
dlink
</artifactId>
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<version>
0.
3.0-SANPSHOT
</version>
<version>
0.
2.3
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
...
...
dlink-connectors/dlink-connector-jdbc/pom.xml
View file @
a65ab4b6
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
dlink-connectors
</artifactId>
<artifactId>
dlink-connectors
</artifactId>
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<version>
0.
3.0-SANPSHOT
</version>
<version>
0.
2.3
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
dlink-connectors/pom.xml
View file @
a65ab4b6
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
dlink
</artifactId>
<artifactId>
dlink
</artifactId>
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<version>
0.
3.0-SANPSHOT
</version>
<version>
0.
2.3
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
...
...
dlink-core/pom.xml
View file @
a65ab4b6
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
dlink
</artifactId>
<artifactId>
dlink
</artifactId>
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<version>
0.
3.0-SANPSHOT
</version>
<version>
0.
2.3
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
...
...
dlink-function/pom.xml
View file @
a65ab4b6
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<parent>
<parent>
<artifactId>
dlink
</artifactId>
<artifactId>
dlink
</artifactId>
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<version>
0.
3.0-SANPSHOT
</version>
<version>
0.
2.3
</version>
</parent>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
...
...
dlink-web/src/components/Studio/StudioConnector/index.tsx
View file @
a65ab4b6
...
@@ -8,11 +8,12 @@ import { SearchOutlined,DownOutlined,DeleteOutlined,CommentOutlined } from '@ant
...
@@ -8,11 +8,12 @@ import { SearchOutlined,DownOutlined,DeleteOutlined,CommentOutlined } from '@ant
import
React
from
"react"
;
import
React
from
"react"
;
import
{
executeDDL
}
from
"@/pages/FlinkSqlStudio/service"
;
import
{
executeDDL
}
from
"@/pages/FlinkSqlStudio/service"
;
import
{
handleRemove
}
from
"@/components/Common/crud"
;
import
{
handleRemove
}
from
"@/components/Common/crud"
;
import
{
showTables
}
from
"@/components/Studio/StudioEvent/DDL"
;
const
StudioConnector
=
(
props
:
any
)
=>
{
const
StudioConnector
=
(
props
:
any
)
=>
{
const
{
current
}
=
props
;
const
{
current
,
dispatch
,
currentSessionCluster
}
=
props
;
const
[
tableData
,
setTableData
]
=
useState
<
[]
>
([]);
const
[
tableData
,
setTableData
]
=
useState
<
[]
>
([]);
const
[
loadings
,
setLoadings
]
=
useState
<
boolean
[]
>
([]);
const
[
loadings
,
setLoadings
]
=
useState
<
boolean
[]
>
([]);
const
[
searchText
,
setSearchText
]
=
useState
<
string
>
(
''
);
const
[
searchText
,
setSearchText
]
=
useState
<
string
>
(
''
);
...
@@ -135,26 +136,7 @@ const StudioConnector = (props:any) => {
...
@@ -135,26 +136,7 @@ const StudioConnector = (props:any) => {
};
};
const
getTables
=
()
=>
{
const
getTables
=
()
=>
{
let
newLoadings
=
[...
loadings
];
showTables
(
current
.
task
.
clusterId
,
current
.
task
.
clusterName
,
current
.
task
.
session
,
dispatch
);
newLoadings
[
0
]
=
true
;
setLoadings
(
newLoadings
);
const
res
=
executeDDL
({
statement
:
"show tables"
,
clusterId
:
current
.
task
.
clusterId
,
session
:
current
.
task
.
session
,
});
res
.
then
((
result
)
=>
{
setClusterName
(
current
.
task
.
clusterName
);
setSession
(
current
.
task
.
session
);
if
(
result
.
datas
.
result
.
rowData
.
length
>
0
){
setTableData
(
result
.
datas
.
result
.
rowData
);
}
else
{
setTableData
([]);
}
let
newLoadings
=
[...
loadings
];
newLoadings
[
0
]
=
false
;
setLoadings
(
newLoadings
);
});
};
};
const
clearSession
=
()
=>
{
const
clearSession
=
()
=>
{
...
@@ -224,14 +206,15 @@ const StudioConnector = (props:any) => {
...
@@ -224,14 +206,15 @@ const StudioConnector = (props:any) => {
<
Breadcrumb
className=
{
styles
[
"session-path"
]
}
>
<
Breadcrumb
className=
{
styles
[
"session-path"
]
}
>
<
CommentOutlined
/>
<
CommentOutlined
/>
<
Divider
type=
"vertical"
/>
<
Divider
type=
"vertical"
/>
<
Breadcrumb
.
Item
>
{
clusterName
}
</
Breadcrumb
.
Item
>
<
Breadcrumb
.
Item
>
{
c
urrentSessionCluster
.
c
lusterName
}
</
Breadcrumb
.
Item
>
<
Breadcrumb
.
Item
>
{
session
}
</
Breadcrumb
.
Item
>
<
Breadcrumb
.
Item
>
{
currentSessionCluster
.
session
}
</
Breadcrumb
.
Item
>
</
Breadcrumb
>
</
Breadcrumb
>
{
tableData
&&
tableData
.
length
>
0
?(<
Table
dataSource=
{
tableData
}
columns=
{
getColumns
()
}
size=
"small"
/>):(<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>)
}
{
currentSessionCluster
.
connectors
&&
currentSessionCluster
.
connectors
.
length
>
0
?(<
Table
dataSource=
{
currentSessionCluster
.
connectors
}
columns=
{
getColumns
()
}
size=
"small"
/>):(<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>)
}
</>
</>
);
);
};
};
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
current
:
Studio
.
current
,
current
:
Studio
.
current
,
currentSessionCluster
:
Studio
.
currentSessionCluster
,
}))(
StudioConnector
);
}))(
StudioConnector
);
dlink-web/src/components/Studio/StudioConsole/StudioTable/index.tsx
View file @
a65ab4b6
import
{
Typography
,
Input
,
Button
,
Space
,
Table
,
Select
,
Tag
,
Form
,
Empty
}
from
"antd"
;
import
{
Typography
,
Input
,
Button
,
Space
,
Table
,
Select
,
Tag
,
Form
,
Empty
,
Tooltip
}
from
"antd"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
connect
}
from
"umi"
;
import
{
connect
}
from
"umi"
;
import
{
useState
}
from
"react"
;
import
{
useState
}
from
"react"
;
...
@@ -110,12 +110,12 @@ const StudioTable = (props:any) => {
...
@@ -110,12 +110,12 @@ const StudioTable = (props:any) => {
>
>
{
current
.
console
.
result
.
map
((
item
,
index
)
=>
{
{
current
.
console
.
result
.
map
((
item
,
index
)
=>
{
if
(
item
.
success
)
{
if
(
item
.
success
)
{
let
tag
=
(<><
Tag
color=
"processing"
>
{
item
.
finishDate
}
</
Tag
>
let
tag
=
(<>
<
Tooltip
placement=
"topLeft"
title=
{
item
.
statement
}
>
<
Tag
color=
"processing"
>
{
item
.
finishDate
}
</
Tag
>
<
Text
underline
>
[
{
item
.
sessionId
}
:
{
item
.
flinkHost
}
:
{
item
.
flinkPort
}
]
</
Text
>
<
Text
underline
>
[
{
item
.
sessionId
}
:
{
item
.
flinkHost
}
:
{
item
.
flinkPort
}
]
</
Text
>
{
item
.
jobName
&&
<
Text
code
>
{
item
.
jobName
}
</
Text
>
}
{
item
.
jobName
&&
<
Text
code
>
{
item
.
jobName
}
</
Text
>
}
{
item
.
jobId
&&
<
Text
code
>
{
item
.
jobId
}
</
Text
>
}
{
item
.
jobId
&&
<
Text
code
>
{
item
.
jobId
}
</
Text
>
}
<
Text
keyboard
>
{
item
.
time
}
ms
</
Text
>
<
Text
keyboard
>
{
item
.
time
}
ms
</
Text
>
{
item
.
statement
}
</>);
{
item
.
statement
}
</
Tooltip
>
</>);
return
(<
Option
value=
{
index
}
label=
{
tag
}
>
return
(<
Option
value=
{
index
}
label=
{
tag
}
>
{
tag
}
{
tag
}
</
Option
>)
</
Option
>)
...
...
dlink-web/src/components/Studio/StudioEvent/DDL.ts
0 → 100644
View file @
a65ab4b6
import
{
executeDDL
}
from
"@/pages/FlinkSqlStudio/service"
;
import
FlinkSQL
from
"./FlinkSQL"
;
export
function
showTables
(
clusterId
:
number
,
clusterName
:
string
,
session
:
string
,
dispatch
:
any
)
{
const
res
=
executeDDL
({
statement
:
FlinkSQL
.
SHOW_TABLES
,
clusterId
:
clusterId
,
session
:
session
,
});
res
.
then
((
result
)
=>
{
let
tableData
=
[];
if
(
result
.
datas
.
result
.
rowData
.
length
>
0
){
tableData
=
result
.
datas
.
result
.
rowData
;
}
dispatch
&&
dispatch
({
type
:
"Studio/refreshCurrentSessionCluster"
,
payload
:
{
session
:
session
,
clusterId
:
clusterId
,
clusterName
:
clusterName
,
connectors
:
tableData
,
},
});
});
}
dlink-web/src/components/Studio/StudioEvent/FlinkSQL.ts
0 → 100644
View file @
a65ab4b6
const
SQL
=
{
SHOW_TABLES
:
"show tables"
,
};
export
default
SQL
;
dlink-web/src/components/Studio/StudioMenu/index.tsx
View file @
a65ab4b6
...
@@ -12,6 +12,7 @@ import {connect} from "umi";
...
@@ -12,6 +12,7 @@ import {connect} from "umi";
import
{
postDataArray
}
from
"@/components/Common/crud"
;
import
{
postDataArray
}
from
"@/components/Common/crud"
;
import
{
executeSql
}
from
"@/pages/FlinkSqlStudio/service"
;
import
{
executeSql
}
from
"@/pages/FlinkSqlStudio/service"
;
import
StudioHelp
from
"../StudioHelp"
;
import
StudioHelp
from
"../StudioHelp"
;
import
{
showTables
}
from
"@/components/Studio/StudioEvent/DDL"
;
const
menu
=
(
const
menu
=
(
<
Menu
>
<
Menu
>
...
@@ -76,16 +77,16 @@ const StudioMenu = (props: any) => {
...
@@ -76,16 +77,16 @@ const StudioMenu = (props: any) => {
type
:
"Studio/saveTabs"
,
type
:
"Studio/saveTabs"
,
payload
:
newTabs
,
payload
:
newTabs
,
});
});
showTables
(
current
.
task
.
clusterId
,
current
.
task
.
clusterName
,
current
.
task
.
session
,
dispatch
);
})
})
};
};
const
submit
=
()
=>
{
const
submit
=
()
=>
{
if
(
!
current
.
task
.
id
){
if
(
!
current
.
task
.
id
){
message
.
error
(
`草稿【
${
current
.
title
}
】无法被提交,请创建或选择有效作业进行提交`
);
message
.
error
(
`草稿【
${
current
.
title
}
】无法被提交,请创建或选择有效作业进行提交`
);
return
false
;
return
;
}
}
const
taskKey
=
(
Math
.
random
()
*
1000
)
+
''
;
const
taskKey
=
(
Math
.
random
()
*
1000
)
+
''
;
Modal
.
confirm
({
Modal
.
confirm
({
title
:
'异步提交作业'
,
title
:
'异步提交作业'
,
content
:
`确定异步提交作业【
${
current
.
task
.
alias
}
】到其配置的集群吗?请确认您的作业是否已经被保存!`
,
content
:
`确定异步提交作业【
${
current
.
task
.
alias
}
】到其配置的集群吗?请确认您的作业是否已经被保存!`
,
...
@@ -117,7 +118,7 @@ const StudioMenu = (props: any) => {
...
@@ -117,7 +118,7 @@ const StudioMenu = (props: any) => {
const
fieldsValue
=
await
form
.
validateFields
();
const
fieldsValue
=
await
form
.
validateFields
();
if
(
current
.
task
){
if
(
current
.
task
){
let
task
=
{
let
task
=
{
id
:
current
.
key
,
...
current
.
task
,
statement
:
current
.
value
,
statement
:
current
.
value
,
...
fieldsValue
...
fieldsValue
};
};
...
...
dlink-web/src/components/Studio/StudioSetting/index.tsx
View file @
a65ab4b6
...
@@ -4,6 +4,7 @@ import {Form, InputNumber,Input,Switch,Select,Tag,Row,Col,Divider,Tooltip,Button
...
@@ -4,6 +4,7 @@ import {Form, InputNumber,Input,Switch,Select,Tag,Row,Col,Divider,Tooltip,Button
import
{
InfoCircleOutlined
,
PlusOutlined
,
MinusSquareOutlined
}
from
"@ant-design/icons"
;
import
{
InfoCircleOutlined
,
PlusOutlined
,
MinusSquareOutlined
}
from
"@ant-design/icons"
;
import
styles
from
"./index.less"
;
import
styles
from
"./index.less"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
showTables
}
from
"@/components/Studio/StudioEvent/DDL"
;
const
{
Option
}
=
Select
;
const
{
Option
}
=
Select
;
...
@@ -59,6 +60,10 @@ const StudioSetting = (props: any) => {
...
@@ -59,6 +60,10 @@ const StudioSetting = (props: any) => {
payload
:
newTabs
,
payload
:
newTabs
,
});
});
};
};
const
onChangeClusterSession
=
()
=>
{
showTables
(
current
.
task
.
clusterId
,
current
.
task
.
clusterName
,
current
.
task
.
session
,
dispatch
);
};
return
(
return
(
<>
<>
<
Row
>
<
Row
>
...
@@ -136,6 +141,7 @@ const StudioSetting = (props: any) => {
...
@@ -136,6 +141,7 @@ const StudioSetting = (props: any) => {
placeholder=
"选择Flink集群"
placeholder=
"选择Flink集群"
defaultValue=
{
0
}
defaultValue=
{
0
}
optionLabelProp=
"label"
optionLabelProp=
"label"
onChange=
{
onChangeClusterSession
}
>
>
<
Option
value=
{
0
}
label=
{
(<><
Tag
color=
"default"
>
Local
</
Tag
>
本地环境
</>)
}
>
<
Option
value=
{
0
}
label=
{
(<><
Tag
color=
"default"
>
Local
</
Tag
>
本地环境
</>)
}
>
<
Tag
color=
"default"
>
Local
</
Tag
>
<
Tag
color=
"default"
>
Local
</
Tag
>
...
@@ -155,6 +161,7 @@ const StudioSetting = (props: any) => {
...
@@ -155,6 +161,7 @@ const StudioSetting = (props: any) => {
placeholder=
"选择会话"
placeholder=
"选择会话"
// defaultValue='admin'
// defaultValue='admin'
allowClear
allowClear
onChange=
{
onChangeClusterSession
}
dropdownRender=
{
menu
=>
(
dropdownRender=
{
menu
=>
(
<
div
>
<
div
>
{
menu
}
{
menu
}
...
...
dlink-web/src/pages/FlinkSqlStudio/model.ts
View file @
a65ab4b6
...
@@ -5,6 +5,7 @@ import {
...
@@ -5,6 +5,7 @@ import {
queryData
queryData
}
from
"@/components/Common/crud"
;
}
from
"@/components/Common/crud"
;
import
{
Form
}
from
"antd"
;
import
{
Form
}
from
"antd"
;
import
{
executeDDL
}
from
"@/pages/FlinkSqlStudio/service"
;
export
type
ClusterType
=
{
export
type
ClusterType
=
{
id
:
number
,
id
:
number
,
...
@@ -37,9 +38,9 @@ export type TaskType = {
...
@@ -37,9 +38,9 @@ export type TaskType = {
createTime
?:
Date
,
createTime
?:
Date
,
updateTime
?:
Date
,
updateTime
?:
Date
,
statement
?:
string
,
statement
?:
string
,
session
:
string
;
session
:
string
;
maxRowNum
:
number
;
maxRowNum
:
number
;
jobName
:
string
;
jobName
:
string
;
};
};
export
type
ConsoleType
=
{
export
type
ConsoleType
=
{
...
@@ -48,12 +49,12 @@ export type ConsoleType = {
...
@@ -48,12 +49,12 @@ export type ConsoleType = {
export
type
TabsItemType
=
{
export
type
TabsItemType
=
{
title
:
string
;
title
:
string
;
key
:
number
,
key
:
number
,
value
:
string
;
value
:
string
;
closable
:
boolean
;
closable
:
boolean
;
path
:
string
[];
path
:
string
[];
task
?:
TaskType
;
task
?:
TaskType
;
console
:
ConsoleType
;
console
:
ConsoleType
;
monaco
?:
any
;
monaco
?:
any
;
}
}
...
@@ -68,15 +69,26 @@ export type RightClickMenu = {
...
@@ -68,15 +69,26 @@ export type RightClickMenu = {
id
:
number
,
id
:
number
,
name
:
string
name
:
string
};
};
export
type
ConnectorType
=
{
tablename
:
string
;
}
export
type
SessionClusterType
=
{
session
:
string
;
clusterId
:
number
;
clusterName
:
string
;
connectors
:
ConnectorType
[];
}
export
type
StateType
=
{
export
type
StateType
=
{
cluster
?:
ClusterType
[];
cluster
?:
ClusterType
[];
currentSessionCluster
:
SessionClusterType
[];
current
:
TabsItemType
;
current
:
TabsItemType
;
sql
?:
string
;
sql
?:
string
;
monaco
?:
any
;
monaco
?:
any
;
currentPath
?:
string
[];
currentPath
?:
string
[];
tabs
:
TabsType
;
tabs
:
TabsType
;
session
:
string
[];
session
:
string
[];
rightClickMenu
?:
boolean
;
rightClickMenu
?:
boolean
;
};
};
export
type
ModelType
=
{
export
type
ModelType
=
{
...
@@ -94,6 +106,7 @@ export type ModelType = {
...
@@ -94,6 +106,7 @@ export type ModelType = {
saveTaskData
:
Reducer
<
StateType
>
;
saveTaskData
:
Reducer
<
StateType
>
;
saveSession
:
Reducer
<
StateType
>
;
saveSession
:
Reducer
<
StateType
>
;
showRightClickMenu
:
Reducer
<
StateType
>
;
showRightClickMenu
:
Reducer
<
StateType
>
;
refreshCurrentSessionCluster
:
Reducer
<
StateType
>
;
};
};
};
};
...
@@ -111,66 +124,72 @@ const getClusters = async () => {
...
@@ -111,66 +124,72 @@ const getClusters = async () => {
const
Model
:
ModelType
=
{
const
Model
:
ModelType
=
{
namespace
:
'Studio'
,
namespace
:
'Studio'
,
state
:
{
state
:
{
cluster
:
getClusters
(),
cluster
:
getClusters
(),
currentSessionCluster
:
{
session
:
''
,
clusterId
:
0
,
clusterName
:
'本地环境'
,
connectors
:
[],
},
current
:
{
current
:
{
title
:
'草稿'
,
title
:
'草稿'
,
key
:
0
,
key
:
0
,
value
:
''
,
value
:
''
,
closable
:
false
,
closable
:
false
,
path
:
[
'草稿'
],
path
:
[
'草稿'
],
task
:{
task
:
{
jobName
:
'草稿'
,
jobName
:
'草稿'
,
checkPoint
:
0
,
checkPoint
:
0
,
savePointPath
:
''
,
savePointPath
:
''
,
parallelism
:
1
,
parallelism
:
1
,
fragment
:
true
,
fragment
:
true
,
clusterId
:
0
,
clusterId
:
0
,
clusterName
:
"本地环境"
,
clusterName
:
"本地环境"
,
maxRowNum
:
100
,
maxRowNum
:
100
,
session
:
''
,
session
:
''
,
alias
:
'草稿'
,
alias
:
'草稿'
,
},
},
console
:{
console
:
{
result
:[],
result
:
[],
},
},
monaco
:
{},
monaco
:
{},
},
},
sql
:
''
,
sql
:
''
,
monaco
:
{},
monaco
:
{},
currentPath
:
[],
currentPath
:
[],
tabs
:{
tabs
:
{
activeKey
:
0
,
activeKey
:
0
,
panes
:
[{
panes
:
[{
title
:
'草稿'
,
title
:
'草稿'
,
key
:
0
,
key
:
0
,
value
:
''
,
value
:
''
,
closable
:
false
,
closable
:
false
,
path
:
[
'草稿'
],
path
:
[
'草稿'
],
task
:{
task
:
{
jobName
:
'草稿'
,
jobName
:
'草稿'
,
checkPoint
:
0
,
checkPoint
:
0
,
savePointPath
:
''
,
savePointPath
:
''
,
parallelism
:
1
,
parallelism
:
1
,
fragment
:
true
,
fragment
:
true
,
clusterId
:
0
,
clusterId
:
0
,
clusterName
:
"本地环境"
,
clusterName
:
"本地环境"
,
session
:
''
,
session
:
''
,
maxRowNum
:
100
,
maxRowNum
:
100
,
alias
:
'草稿'
,
alias
:
'草稿'
,
},
},
console
:{
console
:
{
result
:[],
result
:
[],
},
},
monaco
:
{},
monaco
:
{},
}],
}],
},
},
session
:[],
session
:
[],
rightClickMenu
:
false
rightClickMenu
:
false
},
},
effects
:
{
effects
:
{
*
saveTask
({
payload
},
{
call
,
put
})
{
*
saveTask
({
payload
},
{
call
,
put
})
{
yield
call
(
handleAddOrUpdate
,
'api/task'
,
payload
);
yield
call
(
handleAddOrUpdate
,
'api/task'
,
payload
);
yield
put
({
yield
put
({
type
:
'saveTaskData'
,
type
:
'saveTaskData'
,
payload
,
payload
,
...
@@ -179,130 +198,138 @@ const Model: ModelType = {
...
@@ -179,130 +198,138 @@ const Model: ModelType = {
},
},
reducers
:
{
reducers
:
{
saveSql
(
state
,
{
payload
})
{
saveSql
(
state
,
{
payload
})
{
const
tabs
=
state
.
tabs
;
const
tabs
=
state
.
tabs
;
let
newCurrent
=
state
.
current
;
let
newCurrent
=
state
.
current
;
newCurrent
.
value
=
payload
;
newCurrent
.
value
=
payload
;
for
(
let
i
=
0
;
i
<
tabs
.
panes
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
tabs
.
panes
.
length
;
i
++
)
{
if
(
tabs
.
panes
[
i
].
key
==
tabs
.
activeKey
)
{
if
(
tabs
.
panes
[
i
].
key
==
tabs
.
activeKey
)
{
tabs
.
panes
[
i
].
value
=
payload
;
tabs
.
panes
[
i
].
value
=
payload
;
tabs
.
panes
[
i
].
task
&&
(
tabs
.
panes
[
i
].
task
.
statement
=
payload
);
tabs
.
panes
[
i
].
task
&&
(
tabs
.
panes
[
i
].
task
.
statement
=
payload
);
}
}
}
}
return
{
return
{
...
state
,
...
state
,
current
:{
current
:
{
...
newCurrent
...
newCurrent
},
},
tabs
:{
tabs
:
{
...
tabs
...
tabs
},
},
};
};
},
},
saveCurrentPath
(
state
,
{
payload
})
{
saveCurrentPath
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
currentPath
:
payload
,
currentPath
:
payload
,
};
};
},
},
saveMonaco
(
state
,
{
payload
})
{
saveMonaco
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
monaco
:{
monaco
:
{
...
payload
...
payload
},
},
};
};
},
},
saveTabs
(
state
,
{
payload
})
{
saveTabs
(
state
,
{
payload
})
{
let
newCurrent
=
state
.
current
;
let
newCurrent
=
state
.
current
;
for
(
let
i
=
0
;
i
<
payload
.
panes
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
payload
.
panes
.
length
;
i
++
)
{
if
(
payload
.
panes
[
i
].
key
==
payload
.
activeKey
)
{
if
(
payload
.
panes
[
i
].
key
==
payload
.
activeKey
)
{
newCurrent
=
payload
.
panes
[
i
];
newCurrent
=
payload
.
panes
[
i
];
}
}
}
}
return
{
return
{
...
state
,
...
state
,
current
:{
current
:
{
...
newCurrent
,
...
newCurrent
,
},
},
tabs
:{
tabs
:
{
...
payload
,
...
payload
,
},
},
};
};
},
},
deleteTabByKey
(
state
,
{
payload
})
{
deleteTabByKey
(
state
,
{
payload
})
{
let
newTabs
=
state
.
tabs
;
let
newTabs
=
state
.
tabs
;
for
(
let
i
=
0
;
i
<
newTabs
.
panes
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
newTabs
.
panes
.
length
;
i
++
)
{
if
(
newTabs
.
panes
[
i
].
key
==
payload
)
{
if
(
newTabs
.
panes
[
i
].
key
==
payload
)
{
newTabs
.
panes
.
splice
(
i
,
1
);
newTabs
.
panes
.
splice
(
i
,
1
);
break
;
break
;
}
}
}
}
let
newCurrent
=
newTabs
.
panes
[
newTabs
.
panes
.
length
-
1
];
let
newCurrent
=
newTabs
.
panes
[
newTabs
.
panes
.
length
-
1
];
if
(
newTabs
.
activeKey
==
payload
)
{
if
(
newTabs
.
activeKey
==
payload
)
{
newTabs
.
activeKey
=
newCurrent
.
key
;
newTabs
.
activeKey
=
newCurrent
.
key
;
}
}
return
{
return
{
...
state
,
...
state
,
current
:{
current
:
{
...
newCurrent
,
...
newCurrent
,
},
},
tabs
:{
tabs
:
{
...
newTabs
,
...
newTabs
,
},
},
};
};
},
},
changeActiveKey
(
state
,
{
payload
})
{
changeActiveKey
(
state
,
{
payload
})
{
let
tabs
=
state
.
tabs
;
let
tabs
=
state
.
tabs
;
tabs
.
activeKey
=
payload
;
tabs
.
activeKey
=
payload
;
let
newCurrent
=
state
.
current
;
let
newCurrent
=
state
.
current
;
for
(
let
i
=
0
;
i
<
tabs
.
panes
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
tabs
.
panes
.
length
;
i
++
)
{
if
(
tabs
.
panes
[
i
].
key
==
tabs
.
activeKey
)
{
if
(
tabs
.
panes
[
i
].
key
==
tabs
.
activeKey
)
{
newCurrent
=
tabs
.
panes
[
i
];
newCurrent
=
tabs
.
panes
[
i
];
}
}
}
}
return
{
return
{
...
state
,
...
state
,
current
:{
current
:
{
...
newCurrent
,
...
newCurrent
,
},
},
tabs
:{
tabs
:
{
...
tabs
,
...
tabs
,
},
},
currentPath
:
newCurrent
.
path
,
currentPath
:
newCurrent
.
path
,
};
};
},
},
saveTaskData
(
state
,
{
payload
})
{
saveTaskData
(
state
,
{
payload
})
{
let
newTabs
=
state
.
tabs
;
let
newTabs
=
state
.
tabs
;
for
(
let
i
=
0
;
i
<
newTabs
.
panes
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
newTabs
.
panes
.
length
;
i
++
)
{
if
(
newTabs
.
panes
[
i
].
key
==
newTabs
.
activeKey
)
{
if
(
newTabs
.
panes
[
i
].
key
==
newTabs
.
activeKey
)
{
newTabs
.
panes
[
i
].
task
=
payload
;
newTabs
.
panes
[
i
].
task
=
payload
;
}
}
}
}
return
{
return
{
...
state
,
...
state
,
tabs
:{
tabs
:
{
...
newTabs
,
...
newTabs
,
},
},
};
};
},
},
saveSession
(
state
,
{
payload
})
{
saveSession
(
state
,
{
payload
})
{
let
newSession
=
state
.
session
;
let
newSession
=
state
.
session
;
for
(
let
i
=
0
;
i
<
newSession
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
newSession
.
length
;
i
++
)
{
if
(
newSession
[
i
].
key
==
payload
)
{
if
(
newSession
[
i
].
key
==
payload
)
{
return
{};
return
{};
}
}
}
}
newSession
.
push
(
payload
);
newSession
.
push
(
payload
);
return
{
return
{
...
state
,
...
state
,
session
:
newSession
,
session
:
newSession
,
};
};
},
},
showRightClickMenu
(
state
,
{
payload
})
{
showRightClickMenu
(
state
,
{
payload
})
{
return
{
return
{
...
state
,
...
state
,
rightClickMenu
:
payload
,
rightClickMenu
:
payload
,
};
},
refreshCurrentSessionCluster
(
state
,
{
payload
})
{
return
{
...
state
,
currentSessionCluster
:
{
...
payload
},
};
};
},
},
},
},
...
...
dlink-web/src/pages/Welcome.tsx
View file @
a65ab4b6
...
@@ -229,7 +229,7 @@ export default (): React.ReactNode => {
...
@@ -229,7 +229,7 @@ export default (): React.ReactNode => {
</
ul
>
</
ul
>
</
Paragraph
>
</
Paragraph
>
</
Timeline
.
Item
>
</
Timeline
.
Item
>
<
Timeline
.
Item
><
Text
code
>
0.2.3
</
Text
>
<
Text
type=
"secondary"
>
2021-06-
17
</
Text
>
<
Timeline
.
Item
><
Text
code
>
0.2.3
</
Text
>
<
Text
type=
"secondary"
>
2021-06-
21
</
Text
>
<
p
>
</
p
>
<
p
>
</
p
>
<
Paragraph
>
<
Paragraph
>
<
ul
>
<
ul
>
...
@@ -248,6 +248,15 @@ export default (): React.ReactNode => {
...
@@ -248,6 +248,15 @@ export default (): React.ReactNode => {
<
li
>
<
li
>
<
Link
>
增加了连接器当前的集群与会话显示
</
Link
>
<
Link
>
增加了连接器当前的集群与会话显示
</
Link
>
</
li
>
</
li
>
<
li
>
<
Link
>
增加了选择集群或会话以及同步执行时的连接器自动刷新
</
Link
>
</
li
>
<
li
>
<
Link
>
解决了在修改作业配置后异步提交作业名未定义的问题
</
Link
>
</
li
>
<
li
>
<
Link
>
增加了历史记录下拉列表鼠标悬浮显示全部SQL的功能
</
Link
>
</
li
>
</
ul
>
</
ul
>
</
Paragraph
>
</
Paragraph
>
</
Timeline
.
Item
>
</
Timeline
.
Item
>
...
...
pom.xml
View file @
a65ab4b6
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<groupId>
com.dlink
</groupId>
<groupId>
com.dlink
</groupId>
<artifactId>
dlink
</artifactId>
<artifactId>
dlink
</artifactId>
<packaging>
pom
</packaging>
<packaging>
pom
</packaging>
<version>
0.
3.0-SANPSHOT
</version>
<version>
0.
2.3
</version>
<modules>
<modules>
<module>
dlink-core
</module>
<module>
dlink-core
</module>
<module>
dlink-admin
</module>
<module>
dlink-admin
</module>
...
...
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