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
237e05c2
Commit
237e05c2
authored
Jan 15, 2022
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改草稿为引导页
parent
ea875c21
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
221 additions
and
141 deletions
+221
-141
routes.ts
dlink-web/config/routes.ts
+1
-0
app.tsx
dlink-web/src/app.tsx
+1
-1
index.tsx
...b/src/components/Studio/StudioConsole/StudioMsg/index.tsx
+1
-1
index.tsx
...src/components/Studio/StudioConsole/StudioTable/index.tsx
+7
-7
index.tsx
dlink-web/src/components/Studio/StudioConsole/index.tsx
+6
-5
index.tsx
dlink-web/src/components/Studio/StudioHome/index.tsx
+68
-0
index.tsx
dlink-web/src/components/Studio/StudioMenu/index.tsx
+33
-6
index.tsx
...c/components/Studio/StudioRightTool/StudioGuide/index.tsx
+55
-0
index.tsx
dlink-web/src/components/Studio/StudioRightTool/index.tsx
+6
-5
index.tsx
dlink-web/src/components/Studio/StudioTabs/index.tsx
+5
-6
index.tsx
dlink-web/src/components/Studio/index.tsx
+8
-8
model.ts
dlink-web/src/pages/FlinkSqlStudio/model.ts
+27
-102
Welcome.tsx
dlink-web/src/pages/Welcome.tsx
+3
-0
No files found.
dlink-web/config/routes.ts
View file @
237e05c2
...
@@ -25,6 +25,7 @@ export default [
...
@@ -25,6 +25,7 @@ export default [
path
:
'/flinksqlstudio'
,
path
:
'/flinksqlstudio'
,
name
:
'flinksqlstudio'
,
name
:
'flinksqlstudio'
,
icon
:
'consoleSql'
,
icon
:
'consoleSql'
,
footerRender
:
false
,
component
:
'./FlinkSqlStudio'
,
component
:
'./FlinkSqlStudio'
,
},
},
{
{
...
...
dlink-web/src/app.tsx
View file @
237e05c2
...
@@ -121,7 +121,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
...
@@ -121,7 +121,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => {
/*waterMarkProps: {
/*waterMarkProps: {
content: initialState?.currentUser?.name,
content: initialState?.currentUser?.name,
},*/
},*/
//
footerRender: () => <Footer />,
footerRender
:
()
=>
<
Footer
/>,
onPageChange
:
()
=>
{
onPageChange
:
()
=>
{
const
{
location
}
=
history
;
const
{
location
}
=
history
;
// 如果没有登录,重定向到 login
// 如果没有登录,重定向到 login
...
...
dlink-web/src/components/Studio/StudioConsole/StudioMsg/index.tsx
View file @
237e05c2
...
@@ -56,7 +56,7 @@ const StudioMsg = (props:any) => {
...
@@ -56,7 +56,7 @@ const StudioMsg = (props:any) => {
return
(
return
(
<
Typography
>
<
Typography
>
{
current
.
console
.
result
.
startTime
?(
isSql
(
current
.
task
.
dialect
)
?
renderCommonSqlContent
():
{
current
&&
current
.
console
.
result
.
startTime
?(
isSql
(
current
.
task
.
dialect
)
?
renderCommonSqlContent
():
renderFlinkSqlContent
()
):<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
renderFlinkSqlContent
()
):<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
}
}
</
Typography
>
</
Typography
>
...
...
dlink-web/src/components/Studio/StudioConsole/StudioTable/index.tsx
View file @
237e05c2
...
@@ -6,13 +6,13 @@ import {showJobData} from "@/components/Studio/StudioEvent/DQL";
...
@@ -6,13 +6,13 @@ import {showJobData} from "@/components/Studio/StudioEvent/DQL";
import
{
isSql
}
from
"@/components/Studio/conf"
;
import
{
isSql
}
from
"@/components/Studio/conf"
;
import
DTable
from
"@/components/Common/DTable"
;
import
DTable
from
"@/components/Common/DTable"
;
const
StudioTable
=
(
props
:
any
)
=>
{
const
StudioTable
=
(
props
:
any
)
=>
{
const
{
current
,
result
,
dispatch
}
=
props
;
const
{
current
,
dispatch
}
=
props
;
const
getColumns
=
(
columns
:[])
=>
{
const
getColumns
=
(
columns
:
[])
=>
{
let
datas
:
any
=
[];
let
datas
:
any
=
[];
columns
.
map
((
item
)
=>
{
columns
.
map
((
item
)
=>
{
datas
.
push
({
datas
.
push
({
field
:
item
,
field
:
item
,
});
});
...
@@ -22,6 +22,7 @@ const StudioTable = (props:any) => {
...
@@ -22,6 +22,7 @@ const StudioTable = (props:any) => {
const
showDetail
=
()
=>
{
const
showDetail
=
()
=>
{
showJobData
(
current
.
console
.
result
.
jobId
,
dispatch
)
showJobData
(
current
.
console
.
result
.
jobId
,
dispatch
)
console
.
log
(
current
.
console
.
result
.
result
);
};
};
const
renderFlinkSQLContent
=
()
=>
{
const
renderFlinkSQLContent
=
()
=>
{
...
@@ -50,12 +51,11 @@ const StudioTable = (props:any) => {
...
@@ -50,12 +51,11 @@ const StudioTable = (props:any) => {
return
(
return
(
<
div
style=
{
{
width
:
'100%'
}
}
>
<
div
style=
{
{
width
:
'100%'
}
}
>
{
isSql
(
current
.
task
.
dialect
)?
renderSQLContent
():
renderFlinkSQLContent
()
}
{
current
?(
isSql
(
current
.
task
.
dialect
)?
renderSQLContent
():
renderFlinkSQLContent
()):
undefined
}
</
div
>
</
div
>
);
);
};
};
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
current
:
Studio
.
current
,
current
:
Studio
.
current
,
result
:
Studio
.
result
,
}))(
StudioTable
);
}))(
StudioTable
);
dlink-web/src/components/Studio/StudioConsole/index.tsx
View file @
237e05c2
...
@@ -19,7 +19,7 @@ const {TabPane} = Tabs;
...
@@ -19,7 +19,7 @@ const {TabPane} = Tabs;
const
StudioConsole
=
(
props
:
any
)
=>
{
const
StudioConsole
=
(
props
:
any
)
=>
{
const
{
height
}
=
props
;
const
{
height
,
current
}
=
props
;
let
consoleHeight
=
(
height
-
37.6
);
let
consoleHeight
=
(
height
-
37.6
);
return
(
return
(
<
Tabs
defaultActiveKey=
"StudioMsg"
size=
"small"
tabPosition=
"top"
style=
{
{
<
Tabs
defaultActiveKey=
"StudioMsg"
size=
"small"
tabPosition=
"top"
style=
{
{
...
@@ -35,7 +35,7 @@ const StudioConsole = (props: any) => {
...
@@ -35,7 +35,7 @@ const StudioConsole = (props: any) => {
key=
"StudioMsg"
key=
"StudioMsg"
>
>
<
Scrollbars
style=
{
{
height
:
consoleHeight
}
}
>
<
Scrollbars
style=
{
{
height
:
consoleHeight
}
}
>
<
StudioMsg
/>
{
current
?<
StudioMsg
/>:<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
}
</
Scrollbars
>
</
Scrollbars
>
</
TabPane
>
</
TabPane
>
<
TabPane
<
TabPane
...
@@ -48,7 +48,7 @@ const StudioConsole = (props: any) => {
...
@@ -48,7 +48,7 @@ const StudioConsole = (props: any) => {
key=
"StudioTable"
key=
"StudioTable"
>
>
<
Scrollbars
style=
{
{
height
:
consoleHeight
}
}
>
<
Scrollbars
style=
{
{
height
:
consoleHeight
}
}
>
<
StudioTable
/>
{
current
?<
StudioTable
/>:<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
}
</
Scrollbars
>
</
Scrollbars
>
</
TabPane
>
</
TabPane
>
<
TabPane
<
TabPane
...
@@ -61,7 +61,7 @@ const StudioConsole = (props: any) => {
...
@@ -61,7 +61,7 @@ const StudioConsole = (props: any) => {
key=
"StudioChart"
key=
"StudioChart"
>
>
<
Scrollbars
style=
{
{
height
:
consoleHeight
}
}
>
<
Scrollbars
style=
{
{
height
:
consoleHeight
}
}
>
<
Chart
height=
{
consoleHeight
}
/>
{
current
?
<
Chart
height=
{
consoleHeight
}
/>:<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
}
</
Scrollbars
>
</
Scrollbars
>
</
TabPane
>
</
TabPane
>
<
TabPane
<
TabPane
...
@@ -87,7 +87,7 @@ const StudioConsole = (props: any) => {
...
@@ -87,7 +87,7 @@ const StudioConsole = (props: any) => {
key=
"StudioConsanguinity"
key=
"StudioConsanguinity"
>
>
<
Scrollbars
style=
{
{
height
:
consoleHeight
}
}
>
<
Scrollbars
style=
{
{
height
:
consoleHeight
}
}
>
<
StudioCA
/>
{
current
?<
StudioCA
/>:<
Empty
image=
{
Empty
.
PRESENTED_IMAGE_SIMPLE
}
/>
}
</
Scrollbars
>
</
Scrollbars
>
</
TabPane
>
</
TabPane
>
<
TabPane
<
TabPane
...
@@ -148,4 +148,5 @@ const StudioConsole = (props: any) => {
...
@@ -148,4 +148,5 @@ const StudioConsole = (props: any) => {
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
sql
:
Studio
.
sql
,
sql
:
Studio
.
sql
,
current
:
Studio
.
current
,
}))(
StudioConsole
);
}))(
StudioConsole
);
dlink-web/src/components/Studio/StudioHome/index.tsx
0 → 100644
View file @
237e05c2
import
{
Typography
,
Divider
}
from
'antd'
;
import
React
from
'react'
;
import
{
connect
}
from
'umi'
;
import
{
StateType
}
from
'@/pages/FlinkSqlStudio/model'
;
import
{
Scrollbars
}
from
'react-custom-scrollbars'
;
const
{
Title
,
Paragraph
,
Text
}
=
Typography
;
const
StudioHome
=
(
props
:
any
)
=>
{
const
{
toolHeight
}
=
props
;
return
(
<
Scrollbars
style=
{
{
height
:
toolHeight
}
}
>
<
Typography
style=
{
{
padding
:
'15px'
}
}
>
<
Title
level=
{
4
}
>
欢迎使用 Dinky v0.5.0
</
Title
>
<
Paragraph
>
<
blockquote
>
实时即未来,Dinky 为 Apache Flink 而生,让 Flink SQL 纵享丝滑,并致力于实时计算平台建设。
</
blockquote
>
</
Paragraph
>
<
Title
level=
{
5
}
>
快捷键
</
Title
>
<
Paragraph
>
<
Text
keyboard
>
Ctrl + s
</
Text
>
保存
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Alt + 1
</
Text
>
保存
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Alt + 2
</
Text
>
校验
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Alt + 3
</
Text
>
美化
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Esc
</
Text
>
关闭弹框
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
F1
</
Text
>
更多快捷键
</
Paragraph
>
<
Paragraph
>
<
Text
keyboard
>
Ctrl + F
</
Text
>
搜索
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Ctrl + H
</
Text
>
替换
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Ctrl + Z
</
Text
>
撤销
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Ctrl + Y
</
Text
>
重做
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Ctrl + /
</
Text
>
注释
</
Paragraph
>
<
Paragraph
>
<
Text
keyboard
>
选中 + Tab
</
Text
>
缩进
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
选中 + Shift + Tab
</
Text
>
取消缩进
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Shift + Alt + Right
</
Text
>
选中后续
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Shift + Alt + F
</
Text
>
格式化
</
Paragraph
>
<
Paragraph
>
<
Text
keyboard
>
Ctrl + Shift + Up/Down
</
Text
>
编辑多行
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Shift + Alt + Up/Down
</
Text
>
复制一行
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Ctrl + Shift + K
</
Text
>
删除一行
</
Paragraph
>
<
Paragraph
>
<
Text
keyboard
>
Ctrl + F3
</
Text
>
匹配下一个
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Ctrl + Shift + F3
</
Text
>
匹配上一个
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
F7
</
Text
>
前往下一个高亮
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Shift +F7
</
Text
>
前往上一个高亮
</
Paragraph
>
<
Paragraph
>
<
Text
keyboard
>
Ctrl + Shift + End
</
Text
>
前面追加换行
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Ctrl + End
</
Text
>
追加换行
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Alt + Up/Down
</
Text
>
上下换位
<
Divider
type=
"vertical"
/>
<
Text
keyboard
>
Ctrl + Shift + [/]
</
Text
>
折叠/展开
</
Paragraph
>
</
Typography
>
</
Scrollbars
>
);
};
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
current
:
Studio
.
current
,
sql
:
Studio
.
sql
,
tabs
:
Studio
.
tabs
,
toolHeight
:
Studio
.
toolHeight
,
}))(
StudioHome
);
dlink-web/src/components/Studio/StudioMenu/index.tsx
View file @
237e05c2
...
@@ -15,14 +15,15 @@ import { postDataArray} from "@/components/Common/crud";
...
@@ -15,14 +15,15 @@ import { postDataArray} from "@/components/Common/crud";
import
{
executeSql
,
getJobPlan
}
from
"@/pages/FlinkSqlStudio/service"
;
import
{
executeSql
,
getJobPlan
}
from
"@/pages/FlinkSqlStudio/service"
;
import
StudioHelp
from
"./StudioHelp"
;
import
StudioHelp
from
"./StudioHelp"
;
import
StudioGraph
from
"./StudioGraph"
;
import
StudioGraph
from
"./StudioGraph"
;
import
{
showCluster
,
showTables
,
saveTask
}
from
"@/components/Studio/StudioEvent/DDL"
;
import
{
showCluster
,
showTables
}
from
"@/components/Studio/StudioEvent/DDL"
;
import
{
useEffect
,
useState
}
from
"react"
;
import
{
use
Callback
,
use
Effect
,
useState
}
from
"react"
;
import
StudioExplain
from
"../StudioConsole/StudioExplain"
;
import
StudioExplain
from
"../StudioConsole/StudioExplain"
;
import
{
DIALECT
,
isOnline
,
isSql
}
from
"@/components/Studio/conf"
;
import
{
DIALECT
,
isOnline
,
isSql
}
from
"@/components/Studio/conf"
;
import
{
import
{
ModalForm
,
ModalForm
,
}
from
'@ant-design/pro-form'
;
}
from
'@ant-design/pro-form'
;
import
SqlExport
from
"@/pages/FlinkSqlStudio/SqlExport"
;
import
SqlExport
from
"@/pages/FlinkSqlStudio/SqlExport"
;
import
{
Dispatch
}
from
"@@/plugin-dva/connect"
;
const
menu
=
(
const
menu
=
(
<
Menu
>
<
Menu
>
...
@@ -39,6 +40,22 @@ const StudioMenu = (props: any) => {
...
@@ -39,6 +40,22 @@ const StudioMenu = (props: any) => {
const
[
graphModalVisible
,
handleGraphModalVisible
]
=
useState
<
boolean
>
(
false
);
const
[
graphModalVisible
,
handleGraphModalVisible
]
=
useState
<
boolean
>
(
false
);
const
[
graphData
,
setGraphData
]
=
useState
();
const
[
graphData
,
setGraphData
]
=
useState
();
const
onKeyDown
=
useCallback
((
e
)
=>
{
if
(
e
.
keyCode
===
83
&&
e
.
ctrlKey
===
true
){
e
.
preventDefault
();
if
(
current
)
{
props
.
saveTask
(
current
);
}
}
},
[
current
]);
useEffect
(()
=>
{
document
.
addEventListener
(
"keydown"
,
onKeyDown
)
return
()
=>
{
document
.
removeEventListener
(
"keydown"
,
onKeyDown
)
};
},
[
current
]);
const
execute
=
()
=>
{
const
execute
=
()
=>
{
if
(
!
isSql
(
current
.
task
.
dialect
)
&&!
isOnline
(
current
.
task
.
type
)){
if
(
!
isSql
(
current
.
task
.
dialect
)
&&!
isOnline
(
current
.
task
.
type
)){
message
.
warn
(
`该任务执行模式为【
${
current
.
task
.
type
}
】,不支持 SQL 查询,请手动保存后使用右侧按钮——作业提交`
);
message
.
warn
(
`该任务执行模式为【
${
current
.
task
.
type
}
】,不支持 SQL 查询,请手动保存后使用右侧按钮——作业提交`
);
...
@@ -224,7 +241,7 @@ const StudioMenu = (props: any) => {
...
@@ -224,7 +241,7 @@ const StudioMenu = (props: any) => {
}
}
const
saveSqlAndSettingToTask
=
()
=>
{
const
saveSqlAndSettingToTask
=
()
=>
{
saveTask
(
current
,
dispatch
);
props
.
saveTask
(
current
);
};
};
const
exportSql
=
()
=>
{
const
exportSql
=
()
=>
{
...
@@ -311,6 +328,7 @@ const StudioMenu = (props: any) => {
...
@@ -311,6 +328,7 @@ const StudioMenu = (props: any) => {
</
Breadcrumb
>
</
Breadcrumb
>
)
}
)
}
</
Col
>
</
Col
>
{
current
?
<
Col
span=
{
8
}
>
<
Col
span=
{
8
}
>
<
Button
<
Button
type=
"text"
type=
"text"
...
@@ -401,7 +419,7 @@ const StudioMenu = (props: any) => {
...
@@ -401,7 +419,7 @@ const StudioMenu = (props: any) => {
onClick=
{
showHelp
}
onClick=
{
showHelp
}
/>
/>
</
Tooltip
>
</
Tooltip
>
</
Col
>
</
Col
>
:
undefined
}
</
Row
>
</
Row
>
</
Col
>
</
Col
>
<
StudioExplain
<
StudioExplain
...
@@ -418,6 +436,7 @@ const StudioMenu = (props: any) => {
...
@@ -418,6 +436,7 @@ const StudioMenu = (props: any) => {
>
>
<
StudioGraph
data=
{
graphData
}
/>
<
StudioGraph
data=
{
graphData
}
/>
</
Modal
>
</
Modal
>
{
current
?
<
ModalForm
<
ModalForm
title=
{
`${current.task.alias} 的 ${current.task.dialect} 导出`
}
title=
{
`${current.task.alias} 的 ${current.task.dialect} 导出`
}
visible=
{
exportModalVisible
}
visible=
{
exportModalVisible
}
...
@@ -438,15 +457,23 @@ const StudioMenu = (props: any) => {
...
@@ -438,15 +457,23 @@ const StudioMenu = (props: any) => {
}
}
}
}
>
>
<
SqlExport
id=
{
current
.
task
.
id
}
/>
<
SqlExport
id=
{
current
.
task
.
id
}
/>
</
ModalForm
>
</
ModalForm
>
:
undefined
}
</
Row
>
</
Row
>
);
);
};
};
const
mapDispatchToProps
=
(
dispatch
:
Dispatch
)
=>
({
saveTask
:(
current
:
any
)
=>
dispatch
({
type
:
"Studio/saveTask"
,
payload
:
current
.
task
,
}),
});
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
current
:
Studio
.
current
,
current
:
Studio
.
current
,
currentPath
:
Studio
.
currentPath
,
currentPath
:
Studio
.
currentPath
,
tabs
:
Studio
.
tabs
,
tabs
:
Studio
.
tabs
,
refs
:
Studio
.
refs
,
refs
:
Studio
.
refs
,
currentSession
:
Studio
.
currentSession
,
currentSession
:
Studio
.
currentSession
,
}))(
StudioMenu
);
})
,
mapDispatchToProps
)(
StudioMenu
);
dlink-web/src/components/Studio/StudioRightTool/StudioGuide/index.tsx
0 → 100644
View file @
237e05c2
import
{
Typography
,
Divider
}
from
'antd'
;
import
React
from
'react'
;
import
{
connect
}
from
'umi'
;
import
{
StateType
}
from
'@/pages/FlinkSqlStudio/model'
;
import
{
Scrollbars
}
from
'react-custom-scrollbars'
;
import
{
history
}
from
'umi'
;
const
{
Title
,
Paragraph
,
Link
,
Text
}
=
Typography
;
const
StudioGuide
=
(
props
:
any
)
=>
{
const
{
toolHeight
}
=
props
;
return
(
<
Scrollbars
style=
{
{
height
:
toolHeight
}
}
>
<
Typography
style=
{
{
padding
:
'15px'
}
}
>
<
Title
level=
{
5
}
>
快捷引导
</
Title
>
<
Paragraph
>
<
ul
>
<
li
>
<
Link
onClick=
{
()
=>
{
history
.
push
(
'/registration/cluster'
)}
}
>
注册集群实例
</
Link
>
</
li
>
<
li
>
<
Link
onClick=
{
()
=>
{
history
.
push
(
'/registration/clusterConfiguration'
)}
}
>
注册集群配置
</
Link
>
</
li
>
<
li
>
<
Link
onClick=
{
()
=>
{
history
.
push
(
'/registration/jar'
)}
}
>
注册 Jar
</
Link
>
</
li
>
<
li
>
<
Link
onClick=
{
()
=>
{
history
.
push
(
'/registration/database'
)}
}
>
注册数据源
</
Link
>
</
li
>
<
li
>
<
Link
onClick=
{
()
=>
{
history
.
push
(
'/registration/document'
)}
}
>
注册文档
</
Link
>
</
li
>
<
li
>
<
Link
onClick=
{
()
=>
{
history
.
push
(
'/settings'
)}
}
>
修改系统配置
</
Link
>
</
li
>
<
li
>
<
Link
href=
"http://www.dlink.top/"
target=
"_blank"
>
官网文档
</
Link
>
</
li
>
<
li
>
<
Link
href=
"https://github.com/DataLinkDC/dlink"
target=
"_blank"
>
Github
</
Link
>
</
li
>
</
ul
>
</
Paragraph
>
</
Typography
>
</
Scrollbars
>
);
};
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
current
:
Studio
.
current
,
sql
:
Studio
.
sql
,
tabs
:
Studio
.
tabs
,
toolHeight
:
Studio
.
toolHeight
,
}))(
StudioGuide
);
dlink-web/src/components/Studio/StudioRightTool/index.tsx
View file @
237e05c2
...
@@ -2,20 +2,18 @@ import {Tabs, Empty, Form} from "antd";
...
@@ -2,20 +2,18 @@ import {Tabs, Empty, Form} from "antd";
import
{
SettingOutlined
,
ScheduleOutlined
,
AuditOutlined
}
from
"@ant-design/icons"
;
import
{
SettingOutlined
,
ScheduleOutlined
,
AuditOutlined
}
from
"@ant-design/icons"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
connect
}
from
"umi"
;
import
{
connect
}
from
"umi"
;
import
styles
from
"./index.less"
;
import
StudioConfig
from
"./StudioConfig"
;
import
StudioConfig
from
"./StudioConfig"
;
import
StudioSetting
from
"./StudioSetting"
;
import
StudioSetting
from
"./StudioSetting"
;
import
StudioSavePoint
from
"./StudioSavePoint"
;
import
StudioSavePoint
from
"./StudioSavePoint"
;
import
StudioEnvSetting
from
"./StudioEnvSetting"
;
import
StudioEnvSetting
from
"./StudioEnvSetting"
;
import
StudioSqlConfig
from
"./StudioSqlConfig"
;
import
StudioSqlConfig
from
"./StudioSqlConfig"
;
import
StudioUDFInfo
from
"./StudioUDFInfo"
;
import
StudioUDFInfo
from
"./StudioUDFInfo"
;
import
StudioGuide
from
"./StudioGuide"
;
import
{
DIALECT
,
isSql
}
from
"@/components/Studio/conf"
;
import
{
DIALECT
,
isSql
}
from
"@/components/Studio/conf"
;
const
{
TabPane
}
=
Tabs
;
const
{
TabPane
}
=
Tabs
;
const
StudioRightTool
=
(
props
:
any
)
=>
{
const
StudioRightTool
=
(
props
:
any
)
=>
{
const
{
current
,
form
,
toolHeight
}
=
props
;
const
{
current
,
form
,
toolHeight
}
=
props
;
...
@@ -72,9 +70,12 @@ const StudioRightTool = (props:any) => {
...
@@ -72,9 +70,12 @@ const StudioRightTool = (props:any) => {
};
};
return
(
return
(
<>
{
current
?
<
Tabs
defaultActiveKey=
"1"
size=
"small"
tabPosition=
"right"
style=
{
{
height
:
toolHeight
}
}
>
<
Tabs
defaultActiveKey=
"1"
size=
"small"
tabPosition=
"right"
style=
{
{
height
:
toolHeight
}
}
>
{
renderContent
()
}
{
renderContent
()
}
</
Tabs
>
</
Tabs
>:<
StudioGuide
toolHeight=
{
toolHeight
}
/>
}
</>
);
);
};
};
...
...
dlink-web/src/components/Studio/StudioTabs/index.tsx
View file @
237e05c2
...
@@ -4,7 +4,6 @@ import {connect} from 'umi';
...
@@ -4,7 +4,6 @@ import {connect} from 'umi';
import
{
StateType
}
from
'@/pages/FlinkSqlStudio/model'
;
import
{
StateType
}
from
'@/pages/FlinkSqlStudio/model'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
import
StudioEdit
from
'../StudioEdit'
;
import
StudioEdit
from
'../StudioEdit'
;
import
{
saveTask
}
from
'@/components/Studio/StudioEvent/DDL'
;
import
{
DIALECT
}
from
'../conf'
;
import
{
DIALECT
}
from
'../conf'
;
const
{
TabPane
}
=
Tabs
;
const
{
TabPane
}
=
Tabs
;
...
@@ -25,17 +24,17 @@ const EditorTabs = (props: any) => {
...
@@ -25,17 +24,17 @@ const EditorTabs = (props: any) => {
};
};
const
onEdit
=
(
targetKey
:
any
,
action
:
any
)
=>
{
const
onEdit
=
(
targetKey
:
any
,
action
:
any
)
=>
{
if
(
action
==
'add'
)
{
if
(
action
==
=
'add'
)
{
add
();
add
();
}
else
if
(
action
==
'remove'
)
{
}
else
if
(
action
==
=
'remove'
)
{
dispatch
&&
dispatch
&&
dispatch
({
dispatch
({
type
:
'Studio/saveToolHeight'
,
type
:
'Studio/saveToolHeight'
,
payload
:
toolHeight
-
0.0001
,
payload
:
toolHeight
-
0.0001
,
});
});
if
(
current
.
isModified
)
{
//
if (current.isModified) {
saveTask
(
current
,
dispatch
);
//
saveTask(current, dispatch);
}
//
}
remove
(
targetKey
);
remove
(
targetKey
);
}
}
};
};
...
...
dlink-web/src/components/Studio/index.tsx
View file @
237e05c2
...
@@ -5,6 +5,7 @@ import {} from "@ant-design/icons";
...
@@ -5,6 +5,7 @@ import {} from "@ant-design/icons";
import
StudioMenu
from
"./StudioMenu"
;
import
StudioMenu
from
"./StudioMenu"
;
import
{
Row
,
Col
,
Card
,
Form
}
from
"antd"
;
import
{
Row
,
Col
,
Card
,
Form
}
from
"antd"
;
import
StudioTabs
from
"./StudioTabs"
;
import
StudioTabs
from
"./StudioTabs"
;
import
StudioHome
from
"./StudioHome"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
StudioConsole
from
"./StudioConsole"
;
import
StudioConsole
from
"./StudioConsole"
;
import
StudioLeftTool
from
"./StudioLeftTool"
;
import
StudioLeftTool
from
"./StudioLeftTool"
;
...
@@ -16,15 +17,11 @@ import {
...
@@ -16,15 +17,11 @@ import {
import
{
loadSettings
}
from
"@/pages/Settings/function"
;
import
{
loadSettings
}
from
"@/pages/Settings/function"
;
import
DraggleLayout
from
"@/components/DraggleLayout"
;
import
DraggleLayout
from
"@/components/DraggleLayout"
;
import
DraggleVerticalLayout
from
"@/components/DraggleLayout/DraggleVerticalLayout"
;
import
DraggleVerticalLayout
from
"@/components/DraggleLayout/DraggleVerticalLayout"
;
import
{
Dispatch
}
from
"@@/plugin-dva/connect"
;
type
StudioProps
=
{
const
Studio
=
(
props
:
any
)
=>
{
rightClickMenu
:
StateType
[
'rightClickMenu'
];
dispatch
:
any
;
};
const
Studio
:
React
.
FC
<
StudioProps
>
=
(
props
)
=>
{
const
{
rightClickMenu
,
toolHeight
,
toolLeftWidth
,
toolRightWidth
,
dispatch
}
=
props
;
const
{
rightClickMenu
,
toolHeight
,
toolLeftWidth
,
toolRightWidth
,
tabs
,
current
,
dispatch
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
[
form
]
=
Form
.
useForm
();
const
VIEW
=
{
const
VIEW
=
{
leftToolWidth
:
300
,
leftToolWidth
:
300
,
...
@@ -136,7 +133,7 @@ const Studio: React.FC<StudioProps> = (props) => {
...
@@ -136,7 +133,7 @@ const Studio: React.FC<StudioProps> = (props) => {
}
}
/>
}
}
/>
</
Col
>
</
Col
>
<
Col
>
<
Col
>
<
StudioTabs
width=
{
size
.
width
-
toolRightWidth
-
toolLeftWidth
}
/>
{
tabs
.
panes
.
length
===
0
?<
StudioHome
width=
{
size
.
width
-
toolRightWidth
-
toolLeftWidth
}
/>:<
StudioTabs
width=
{
size
.
width
-
toolRightWidth
-
toolLeftWidth
}
/>
}
</
Col
>
</
Col
>
</
DraggleLayout
>
</
DraggleLayout
>
<
Col
id=
'StudioRightTool'
className=
{
styles
[
"vertical-tabs"
]
}
>
<
Col
id=
'StudioRightTool'
className=
{
styles
[
"vertical-tabs"
]
}
>
...
@@ -151,6 +148,7 @@ const Studio: React.FC<StudioProps> = (props) => {
...
@@ -151,6 +148,7 @@ const Studio: React.FC<StudioProps> = (props) => {
</
Row
>
</
Row
>
</
DraggleVerticalLayout
>
</
DraggleVerticalLayout
>
</
Card
>
</
Card
>
</
div
>
</
div
>
)
)
};
};
...
@@ -160,4 +158,6 @@ export default connect(({Studio}: { Studio: StateType }) => ({
...
@@ -160,4 +158,6 @@ export default connect(({Studio}: { Studio: StateType }) => ({
toolHeight
:
Studio
.
toolHeight
,
toolHeight
:
Studio
.
toolHeight
,
toolLeftWidth
:
Studio
.
toolLeftWidth
,
toolLeftWidth
:
Studio
.
toolLeftWidth
,
toolRightWidth
:
Studio
.
toolRightWidth
,
toolRightWidth
:
Studio
.
toolRightWidth
,
tabs
:
Studio
.
tabs
,
current
:
Studio
.
current
,
}))(
Studio
);
}))(
Studio
);
dlink-web/src/pages/FlinkSqlStudio/model.ts
View file @
237e05c2
...
@@ -204,95 +204,13 @@ const Model: ModelType = {
...
@@ -204,95 +204,13 @@ const Model: ModelType = {
currentSession
:
{
currentSession
:
{
connectors
:
[],
connectors
:
[],
},
},
current
:
{
current
:
undefined
,
title
:
'草稿'
,
key
:
0
,
value
:
''
,
closable
:
false
,
path
:
[
'草稿'
],
isModified
:
false
,
task
:
{
jobName
:
'草稿'
,
type
:
'local'
,
checkPoint
:
0
,
savePointStrategy
:
0
,
savePointPath
:
''
,
parallelism
:
1
,
fragment
:
true
,
statementSet
:
false
,
clusterId
:
0
,
clusterName
:
"本地环境"
,
clusterConfigurationId
:
undefined
,
clusterConfigurationName
:
undefined
,
databaseId
:
undefined
,
databaseName
:
undefined
,
jarId
:
undefined
,
envId
:
undefined
,
maxRowNum
:
100
,
config
:
[],
session
:
''
,
alias
:
'草稿'
,
dialect
:
'FlinkSql'
,
useResult
:
true
,
useChangeLog
:
false
,
useAutoCancel
:
false
,
useSession
:
false
,
useRemote
:
false
,
},
console
:
{
result
:
{},
chart
:
{},
},
monaco
:
{},
sqlMetaData
:
undefined
,
},
sql
:
''
,
sql
:
''
,
monaco
:
{},
monaco
:
{},
currentPath
:
[
'
草稿
'
],
currentPath
:
[
'
引导页
'
],
tabs
:
{
tabs
:
{
activeKey
:
0
,
activeKey
:
0
,
panes
:
[{
panes
:
[],
title
:
'草稿'
,
key
:
0
,
value
:
''
,
closable
:
false
,
isModified
:
false
,
path
:
[
'草稿'
],
task
:
{
jobName
:
'草稿'
,
type
:
'local'
,
checkPoint
:
0
,
savePointStrategy
:
0
,
savePointPath
:
''
,
parallelism
:
1
,
fragment
:
true
,
statementSet
:
false
,
clusterId
:
0
,
clusterName
:
"本地环境"
,
clusterConfigurationId
:
undefined
,
clusterConfigurationName
:
undefined
,
databaseId
:
undefined
,
databaseName
:
undefined
,
jarId
:
undefined
,
envId
:
undefined
,
session
:
''
,
config
:
[],
maxRowNum
:
100
,
alias
:
'草稿'
,
dialect
:
'FlinkSql'
,
useResult
:
true
,
useChangeLog
:
false
,
useAutoCancel
:
false
,
useSession
:
false
,
useRemote
:
false
,
},
console
:
{
result
:
{},
chart
:
{},
},
monaco
:
{},
sqlMetaData
:
undefined
,
}],
},
},
session
:
[],
session
:
[],
result
:{},
result
:{},
...
@@ -381,8 +299,8 @@ const Model: ModelType = {
...
@@ -381,8 +299,8 @@ const Model: ModelType = {
}
}
return
{
return
{
...
state
,
...
state
,
current
:
newCurrent
,
current
:
{...
newCurrent
}
,
tabs
:
newTabs
,
tabs
:
{...
newTabs
}
,
};
};
},
},
saveTabs
(
state
,
{
payload
})
{
saveTabs
(
state
,
{
payload
})
{
...
@@ -392,6 +310,15 @@ const Model: ModelType = {
...
@@ -392,6 +310,15 @@ const Model: ModelType = {
newCurrent
=
payload
.
panes
[
i
];
newCurrent
=
payload
.
panes
[
i
];
}
}
}
}
if
(
payload
.
panes
.
length
===
0
){
return
{
...
state
,
current
:
undefined
,
tabs
:
{
...
payload
,
},
};
}
return
{
return
{
...
state
,
...
state
,
current
:
{
current
:
{
...
@@ -472,16 +399,20 @@ const Model: ModelType = {
...
@@ -472,16 +399,20 @@ const Model: ModelType = {
},
},
saveTaskData
(
state
,
{
payload
})
{
saveTaskData
(
state
,
{
payload
})
{
const
newTabs
=
state
.
tabs
;
const
newTabs
=
state
.
tabs
;
const
newCurrent
=
state
.
current
;
for
(
let
i
=
0
;
i
<
newTabs
.
panes
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
newTabs
.
panes
.
length
;
i
++
)
{
if
(
newTabs
.
panes
[
i
].
key
==
newTabs
.
activeK
ey
)
{
if
(
newTabs
.
panes
[
i
].
key
==
=
payload
.
k
ey
)
{
newTabs
.
panes
[
i
].
task
=
payload
;
newTabs
.
panes
[
i
].
task
=
payload
;
newTabs
.
panes
[
i
].
isModified
=
false
;
if
(
newCurrent
.
key
===
payload
.
key
){
newCurrent
=
newTabs
.
panes
[
i
];
}
}
}
}
}
return
{
return
{
...
state
,
...
state
,
tabs
:
{
current
:
{...
newCurrent
},
...
newTabs
,
tabs
:
{...
newTabs
},
},
};
};
},
},
saveSession
(
state
,
{
payload
})
{
saveSession
(
state
,
{
payload
})
{
...
@@ -514,13 +445,7 @@ const Model: ModelType = {
...
@@ -514,13 +445,7 @@ const Model: ModelType = {
};
};
},
},
saveResult
(
state
,
{
payload
})
{
saveResult
(
state
,
{
payload
})
{
// return {
const
newTabs
=
state
?.
tabs
;
// ...state,
// result: {
// ...payload
// },
// };
let
newTabs
=
state
?.
tabs
;
let
newCurrent
=
state
?.
current
;
let
newCurrent
=
state
?.
current
;
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
)
{
...
@@ -531,8 +456,8 @@ const Model: ModelType = {
...
@@ -531,8 +456,8 @@ const Model: ModelType = {
}
}
return
{
return
{
...
state
,
...
state
,
current
:
newCurrent
,
current
:
{...
newCurrent
}
,
tabs
:
newTabs
,
tabs
:
{...
newTabs
}
,
};
};
},
},
saveCluster
(
state
,
{
payload
})
{
saveCluster
(
state
,
{
payload
})
{
...
@@ -572,8 +497,8 @@ const Model: ModelType = {
...
@@ -572,8 +497,8 @@ const Model: ModelType = {
}
}
return
{
return
{
...
state
,
...
state
,
current
:
newCurrent
,
current
:
{...
newCurrent
}
,
tabs
:
newTabs
,
tabs
:
{...
newTabs
}
,
};
};
},
},
},
},
...
...
dlink-web/src/pages/Welcome.tsx
View file @
237e05c2
...
@@ -556,6 +556,9 @@ export default (): React.ReactNode => {
...
@@ -556,6 +556,9 @@ export default (): React.ReactNode => {
<
li
>
<
li
>
<
Link
>
新增 BI选项卡的折线图、条形图、饼图
</
Link
>
<
Link
>
新增 BI选项卡的折线图、条形图、饼图
</
Link
>
</
li
>
</
li
>
<
li
>
<
Link
>
修改 草稿为引导页
</
Link
>
</
li
>
</
ul
>
</
ul
>
</
Paragraph
>
</
Paragraph
>
</
Timeline
.
Item
>
</
Timeline
.
Item
>
...
...
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