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
7804ed29
Commit
7804ed29
authored
Jun 15, 2021
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.2.2 bug修复
parent
62957187
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
173 additions
and
33 deletions
+173
-33
CatalogueController.java
...c/main/java/com/dlink/controller/CatalogueController.java
+3
-2
CatalogueService.java
...min/src/main/java/com/dlink/service/CatalogueService.java
+1
-1
CatalogueServiceImpl.java
...ain/java/com/dlink/service/impl/CatalogueServiceImpl.java
+3
-2
TaskServiceImpl.java
...src/main/java/com/dlink/service/impl/TaskServiceImpl.java
+9
-0
config.ts
dlink-web/config/config.ts
+3
-0
crud.ts
dlink-web/src/components/Common/crud.ts
+29
-0
index.tsx
dlink-web/src/components/Studio/StudioEdit/index.tsx
+18
-6
index.tsx
dlink-web/src/components/Studio/StudioMenu/index.tsx
+3
-3
index.tsx
dlink-web/src/components/Studio/StudioSetting/index.tsx
+2
-4
index.tsx
dlink-web/src/components/Studio/StudioTabs/index.tsx
+2
-0
Function.ts
dlink-web/src/components/Studio/StudioTree/Function.ts
+15
-0
index.tsx
dlink-web/src/components/Studio/StudioTree/index.tsx
+34
-7
index.tsx
dlink-web/src/components/Studio/index.tsx
+1
-1
pages.ts
dlink-web/src/locales/zh-CN/pages.ts
+1
-1
model.ts
dlink-web/src/pages/FlinkSqlStudio/model.ts
+32
-4
Welcome.tsx
dlink-web/src/pages/Welcome.tsx
+17
-2
No files found.
dlink-admin/src/main/java/com/dlink/controller/CatalogueController.java
View file @
7804ed29
...
@@ -98,8 +98,9 @@ public class CatalogueController {
...
@@ -98,8 +98,9 @@ public class CatalogueController {
*/
*/
@PutMapping
(
"/createTask"
)
@PutMapping
(
"/createTask"
)
public
Result
createTask
(
@RequestBody
CatalogueTaskDTO
catalogueTaskDTO
)
throws
Exception
{
public
Result
createTask
(
@RequestBody
CatalogueTaskDTO
catalogueTaskDTO
)
throws
Exception
{
if
(
catalogueService
.
createCatalogueAndTask
(
catalogueTaskDTO
)){
Catalogue
catalogue
=
catalogueService
.
createCatalogueAndTask
(
catalogueTaskDTO
);
return
Result
.
succeed
(
"创建成功"
);
if
(
catalogue
.
getId
()!=
null
){
return
Result
.
succeed
(
catalogue
,
"创建成功"
);
}
else
{
}
else
{
return
Result
.
failed
(
"创建失败"
);
return
Result
.
failed
(
"创建失败"
);
}
}
...
...
dlink-admin/src/main/java/com/dlink/service/CatalogueService.java
View file @
7804ed29
...
@@ -16,7 +16,7 @@ public interface CatalogueService extends ISuperService<Catalogue> {
...
@@ -16,7 +16,7 @@ public interface CatalogueService extends ISuperService<Catalogue> {
List
<
Catalogue
>
getAllData
();
List
<
Catalogue
>
getAllData
();
boolean
createCatalogueAndTask
(
CatalogueTaskDTO
catalogueTaskDTO
);
Catalogue
createCatalogueAndTask
(
CatalogueTaskDTO
catalogueTaskDTO
);
boolean
toRename
(
Catalogue
catalogue
);
boolean
toRename
(
Catalogue
catalogue
);
...
...
dlink-admin/src/main/java/com/dlink/service/impl/CatalogueServiceImpl.java
View file @
7804ed29
...
@@ -36,7 +36,7 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
...
@@ -36,7 +36,7 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
public
boolean
createCatalogueAndTask
(
CatalogueTaskDTO
catalogueTaskDTO
)
{
public
Catalogue
createCatalogueAndTask
(
CatalogueTaskDTO
catalogueTaskDTO
)
{
Task
task
=
new
Task
();
Task
task
=
new
Task
();
task
.
setName
(
catalogueTaskDTO
.
getName
());
task
.
setName
(
catalogueTaskDTO
.
getName
());
task
.
setAlias
(
catalogueTaskDTO
.
getAlias
());
task
.
setAlias
(
catalogueTaskDTO
.
getAlias
());
...
@@ -46,7 +46,8 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
...
@@ -46,7 +46,8 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
catalogue
.
setIsLeaf
(
true
);
catalogue
.
setIsLeaf
(
true
);
catalogue
.
setTaskId
(
task
.
getId
());
catalogue
.
setTaskId
(
task
.
getId
());
catalogue
.
setParentId
(
catalogueTaskDTO
.
getParentId
());
catalogue
.
setParentId
(
catalogueTaskDTO
.
getParentId
());
return
this
.
save
(
catalogue
);
this
.
save
(
catalogue
);
return
catalogue
;
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
dlink-admin/src/main/java/com/dlink/service/impl/TaskServiceImpl.java
View file @
7804ed29
...
@@ -80,6 +80,15 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
...
@@ -80,6 +80,15 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
statementService
.
updateById
(
statement
);
statementService
.
updateById
(
statement
);
}
}
}
else
{
}
else
{
if
(
task
.
getCheckPoint
()==
null
){
task
.
setCheckPoint
(
0
);
}
if
(
task
.
getParallelism
()==
null
){
task
.
setParallelism
(
1
);
}
if
(
task
.
getClusterId
()==
null
){
task
.
setClusterId
(
0
);
}
this
.
save
(
task
);
this
.
save
(
task
);
Statement
statement
=
new
Statement
();
Statement
statement
=
new
Statement
();
statement
.
setId
(
task
.
getId
());
statement
.
setId
(
task
.
getId
());
...
...
dlink-web/config/config.ts
View file @
7804ed29
...
@@ -50,6 +50,9 @@ export default defineConfig({
...
@@ -50,6 +50,9 @@ export default defineConfig({
manifest
:
{
manifest
:
{
basePath
:
'/'
,
basePath
:
'/'
,
},
},
history
:{
type
:
'hash'
},
// Fast Refresh 热更新
// Fast Refresh 热更新
fastRefresh
:
{},
fastRefresh
:
{},
openAPI
:
[
openAPI
:
[
...
...
dlink-web/src/components/Common/crud.ts
View file @
7804ed29
...
@@ -72,6 +72,21 @@ export const handleAddOrUpdate = async (url:string,fields: any) => {
...
@@ -72,6 +72,21 @@ export const handleAddOrUpdate = async (url:string,fields: any) => {
}
}
};
};
export
const
handleAddOrUpdateWithResult
=
async
(
url
:
string
,
fields
:
any
)
=>
{
const
tipsTitle
=
fields
.
id
?
"修改"
:
"添加"
;
const
hide
=
message
.
loading
(
`正在
${
tipsTitle
}
`
);
try
{
const
{
msg
,
datas
}
=
await
addOrUpdateData
(
url
,{...
fields
});
hide
();
message
.
success
(
msg
);
return
datas
;
}
catch
(
error
)
{
hide
();
message
.
error
(
'出错啦'
);
return
null
;
}
};
export
const
handleRemove
=
async
(
url
:
string
,
selectedRows
:
[])
=>
{
export
const
handleRemove
=
async
(
url
:
string
,
selectedRows
:
[])
=>
{
const
hide
=
message
.
loading
(
'正在删除'
);
const
hide
=
message
.
loading
(
'正在删除'
);
if
(
!
selectedRows
)
return
true
;
if
(
!
selectedRows
)
return
true
;
...
@@ -87,6 +102,20 @@ export const handleRemove = async (url:string,selectedRows: []) => {
...
@@ -87,6 +102,20 @@ export const handleRemove = async (url:string,selectedRows: []) => {
}
}
};
};
export
const
handleRemoveById
=
async
(
url
:
string
,
id
:
number
)
=>
{
const
hide
=
message
.
loading
(
'正在删除'
);
try
{
const
{
msg
}
=
await
removeData
(
url
,[
id
]);
hide
();
message
.
success
(
msg
);
return
true
;
}
catch
(
error
)
{
hide
();
message
.
error
(
'删除失败,请重试'
);
return
false
;
}
};
export
const
handleSubmit
=
async
(
url
:
string
,
title
:
string
,
selectedRows
:
any
[])
=>
{
export
const
handleSubmit
=
async
(
url
:
string
,
title
:
string
,
selectedRows
:
any
[])
=>
{
const
hide
=
message
.
loading
(
'正在'
+
title
);
const
hide
=
message
.
loading
(
'正在'
+
title
);
if
(
!
selectedRows
)
return
true
;
if
(
!
selectedRows
)
return
true
;
...
...
dlink-web/src/components/Studio/StudioEdit/index.tsx
View file @
7804ed29
...
@@ -14,6 +14,7 @@ let provider = {
...
@@ -14,6 +14,7 @@ let provider = {
};
};
interface
IRightContent
{
interface
IRightContent
{
key
:
string
;
value
:
any
;
value
:
any
;
handleCheck
:
()
=>
Promise
<
boolean
>
;
handleCheck
:
()
=>
Promise
<
boolean
>
;
secondRightData
:
(
BaseDataSourceField
|
BaseDataSourceHeader
)[];
secondRightData
:
(
BaseDataSourceField
|
BaseDataSourceHeader
)[];
...
@@ -29,19 +30,30 @@ const FlinkSqlEditor = (props:any) => {
...
@@ -29,19 +30,30 @@ const FlinkSqlEditor = (props:any) => {
selectOnLineNumbers
:
true
,
selectOnLineNumbers
:
true
,
renderSideBySide
:
false
,
renderSideBySide
:
false
,
},
},
current
=
props
.
current
,
// current,
tabs
,
// current=props.current,
dispatch
,
dispatch
,
monaco
,
}
=
props
}
=
props
;
;
const
{
value
,
handleCheck
,
secondRightData
=
[]
}:
IRightContent
=
props
;
const
{
tabsKey
,
value
,
handleCheck
,
secondRightData
=
[]
}:
IRightContent
=
props
;
const
editorInstance
:
any
=
useRef
<
any
>
();
const
editorInstance
:
any
=
useRef
<
any
>
();
const
monacoInstance
:
any
=
useRef
();
const
monacoInstance
:
any
=
useRef
();
const
code
:
any
=
useRef
(
current
.
sql
?
current
.
sql
:
''
);
const
getTabIndex
=
():
number
=>
{
for
(
let
i
=
0
;
i
<
tabs
.
panes
.
length
;
i
++
){
if
(
tabs
.
panes
[
i
].
key
==
tabsKey
){
return
i
;
}
}
return
0
;
};
const
tabIndex
=
getTabIndex
();
const
code
:
any
=
useRef
(
tabs
.
panes
[
tabIndex
].
value
?
tabs
.
panes
[
tabIndex
].
value
:
''
);
// const code: any = useRef(current.sql ? current.sql : '');
// const code: any = useRef(value ? value.formulaContent : '');
// const code: any = useRef(value ? value.formulaContent : '');
const
cache
:
any
=
useRef
(
code
.
current
);
const
cache
:
any
=
useRef
(
code
.
current
);
...
@@ -148,11 +160,11 @@ const FlinkSqlEditor = (props:any) => {
...
@@ -148,11 +160,11 @@ const FlinkSqlEditor = (props:any) => {
return
(
return
(
<
React
.
Fragment
>
<
React
.
Fragment
>
<
MonacoEditor
<
MonacoEditor
ref=
{
monaco
}
ref=
{
tabs
.
panes
[
tabIndex
].
monaco
}
width=
{
width
}
width=
{
width
}
height=
{
height
}
height=
{
height
}
language=
{
language
}
language=
{
language
}
value=
{
current
.
value
}
value=
{
tabs
.
panes
[
tabIndex
]
.
value
}
options=
{
options
}
options=
{
options
}
onChange=
{
onChangeHandle
}
onChange=
{
onChangeHandle
}
theme=
"vs-dark"
theme=
"vs-dark"
...
...
dlink-web/src/components/Studio/StudioMenu/index.tsx
View file @
7804ed29
...
@@ -25,8 +25,8 @@ const StudioMenu = (props: any) => {
...
@@ -25,8 +25,8 @@ const StudioMenu = (props: any) => {
const
{
tabs
,
current
,
currentPath
,
form
,
dispatch
,
monaco
}
=
props
;
const
{
tabs
,
current
,
currentPath
,
form
,
dispatch
,
monaco
}
=
props
;
const
execute
=
()
=>
{
const
execute
=
()
=>
{
let
selection
=
monaco
.
current
.
editor
.
getSelection
();
let
selection
=
current
.
monaco
.
current
.
editor
.
getSelection
();
let
selectsql
=
monaco
.
current
.
editor
.
getModel
().
getValueInRange
(
selection
);
let
selectsql
=
current
.
monaco
.
current
.
editor
.
getModel
().
getValueInRange
(
selection
);
if
(
selectsql
==
null
||
selectsql
==
''
){
if
(
selectsql
==
null
||
selectsql
==
''
){
selectsql
=
current
.
value
;
selectsql
=
current
.
value
;
}
}
...
@@ -277,5 +277,5 @@ export default connect(({Studio}: { Studio: StateType }) => ({
...
@@ -277,5 +277,5 @@ export default connect(({Studio}: { Studio: StateType }) => ({
current
:
Studio
.
current
,
current
:
Studio
.
current
,
currentPath
:
Studio
.
currentPath
,
currentPath
:
Studio
.
currentPath
,
tabs
:
Studio
.
tabs
,
tabs
:
Studio
.
tabs
,
monaco
:
Studio
.
monaco
,
//
monaco: Studio.monaco,
}))(
StudioMenu
);
}))(
StudioMenu
);
dlink-web/src/components/Studio/StudioSetting/index.tsx
View file @
7804ed29
...
@@ -58,7 +58,6 @@ const StudioSetting = (props: any) => {
...
@@ -58,7 +58,6 @@ const StudioSetting = (props: any) => {
payload
:
newTabs
,
payload
:
newTabs
,
});
});
};
};
const
localOption
=
(<><
Tag
color=
"default"
>
Local
</
Tag
>
本地环境
</>);
return
(
return
(
<>
<>
<
Row
>
<
Row
>
...
@@ -126,13 +125,12 @@ const StudioSetting = (props: any) => {
...
@@ -126,13 +125,12 @@ const StudioSetting = (props: any) => {
<
Form
.
Item
label=
"Flink集群"
tooltip=
"选择Flink集群进行远程提交任务"
name=
"clusterId"
<
Form
.
Item
label=
"Flink集群"
tooltip=
"选择Flink集群进行远程提交任务"
name=
"clusterId"
className=
{
styles
.
form_item
}
>
className=
{
styles
.
form_item
}
>
<
Select
<
Select
//mode="multiple"
style=
{
{
width
:
'100%'
}
}
style=
{
{
width
:
'100%'
}
}
placeholder=
"选择Flink集群"
placeholder=
"选择Flink集群"
defaultValue=
{
[
'0'
]
}
defaultValue=
{
0
}
optionLabelProp=
"label"
optionLabelProp=
"label"
>
>
<
Option
value=
"0"
label=
{
localOption
}
>
<
Option
value=
{
0
}
label=
{
(<><
Tag
color=
"default"
>
Local
</
Tag
>
本地环境
</>)
}
>
<
Tag
color=
"default"
>
Local
</
Tag
>
<
Tag
color=
"default"
>
Local
</
Tag
>
本地环境
本地环境
</
Option
>
</
Option
>
...
...
dlink-web/src/components/Studio/StudioTabs/index.tsx
View file @
7804ed29
...
@@ -3,6 +3,7 @@ import React, {useState} from 'react';
...
@@ -3,6 +3,7 @@ import React, {useState} from 'react';
import
{
connect
}
from
"umi"
;
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'
;
const
{
TabPane
}
=
Tabs
;
const
{
TabPane
}
=
Tabs
;
...
@@ -70,6 +71,7 @@ const EditorTabs = (props: any) => {
...
@@ -70,6 +71,7 @@ const EditorTabs = (props: any) => {
>
>
{
tabs
.
panes
.
map
(
pane
=>
(
{
tabs
.
panes
.
map
(
pane
=>
(
<
TabPane
tab=
{
pane
.
title
}
key=
{
pane
.
key
}
closable=
{
pane
.
closable
}
>
<
TabPane
tab=
{
pane
.
title
}
key=
{
pane
.
key
}
closable=
{
pane
.
closable
}
>
<
StudioEdit
tabsKey=
{
pane
.
key
}
height=
'400px'
/>
</
TabPane
>
</
TabPane
>
))
}
))
}
</
Tabs
>
</
Tabs
>
...
...
dlink-web/src/components/Studio/StudioTree/Function.ts
View file @
7804ed29
...
@@ -34,3 +34,18 @@ export function convertToTreeData(data:TreeDataNode[], pid:number,path?:string[]
...
@@ -34,3 +34,18 @@ export function convertToTreeData(data:TreeDataNode[], pid:number,path?:string[]
}
}
return
result
return
result
}
}
export
function
getTreeNodeByKey
(
node
:
any
[],
key
:
number
)
{
for
(
let
i
=
0
;
i
<
node
.
length
;
i
++
)
{
if
(
node
[
i
].
key
==
key
)
{
return
node
[
i
];
}
else
if
(
node
[
i
].
children
)
{
let
result
=
getTreeNodeByKey
(
node
[
i
].
children
,
key
);
if
(
result
){
return
result
;
}
}
else
{
return
null
;
}
}
}
dlink-web/src/components/Studio/StudioTree/index.tsx
View file @
7804ed29
...
@@ -3,10 +3,13 @@ import {connect} from "umi";
...
@@ -3,10 +3,13 @@ import {connect} from "umi";
import
{
DownOutlined
,
SwitcherOutlined
,
FrownOutlined
,
MehOutlined
,
SmileOutlined
,
FolderAddOutlined
}
from
"@ant-design/icons"
;
import
{
DownOutlined
,
SwitcherOutlined
,
FrownOutlined
,
MehOutlined
,
SmileOutlined
,
FolderAddOutlined
}
from
"@ant-design/icons"
;
import
{
Tree
,
Input
,
Menu
,
Empty
,
Button
,
message
,
Modal
,
Tooltip
,
Row
,
Col
}
from
'antd'
;
import
{
Tree
,
Input
,
Menu
,
Empty
,
Button
,
message
,
Modal
,
Tooltip
,
Row
,
Col
}
from
'antd'
;
import
{
getCatalogueTreeData
}
from
"@/pages/FlinkSqlStudio/service"
;
import
{
getCatalogueTreeData
}
from
"@/pages/FlinkSqlStudio/service"
;
import
{
convertToTreeData
,
DataType
,
TreeDataNode
}
from
"@/components/Studio/StudioTree/Function"
;
import
{
convertToTreeData
,
DataType
,
getTreeNodeByKey
,
TreeDataNode
}
from
"@/components/Studio/StudioTree/Function"
;
import
style
from
"./index.less"
;
import
style
from
"./index.less"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
StateType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
getInfoById
,
handleAddOrUpdate
,
handleInfo
,
handleRemove
,
handleSubmit
}
from
"@/components/Common/crud"
;
import
{
getInfoById
,
handleAddOrUpdate
,
handleAddOrUpdateWithResult
,
handleInfo
,
handleRemove
,
handleRemoveById
,
handleSubmit
}
from
"@/components/Common/crud"
;
import
UpdateCatalogueForm
from
'./components/UpdateCatalogueForm'
;
import
UpdateCatalogueForm
from
'./components/UpdateCatalogueForm'
;
import
{
ActionType
}
from
"@ant-design/pro-table"
;
import
{
ActionType
}
from
"@ant-design/pro-table"
;
import
UpdateTaskForm
from
"@/components/Studio/StudioTree/components/UpdateTaskForm"
;
import
UpdateTaskForm
from
"@/components/Studio/StudioTree/components/UpdateTaskForm"
;
...
@@ -71,6 +74,21 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
...
@@ -71,6 +74,21 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
setTreeData
(
data
);
setTreeData
(
data
);
};
};
const
openByKey
=
async
(
key
)
=>
{
const
result
=
await
getCatalogueTreeData
();
let
data
=
result
.
datas
;
let
list
=
data
;
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
){
list
[
i
].
title
=
list
[
i
].
name
;
list
[
i
].
key
=
list
[
i
].
id
;
}
setDataList
(
list
);
data
=
convertToTreeData
(
data
,
0
);
setTreeData
(
data
);
let
node
=
getTreeNodeByKey
(
data
,
key
);
onSelect
([],{
node
:
node
});
};
useEffect
(()
=>
{
useEffect
(()
=>
{
getTreeData
();
getTreeData
();
},
[]);
},
[]);
...
@@ -192,7 +210,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
...
@@ -192,7 +210,7 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
setTaskFormValues
({
setTaskFormValues
({
parentId
:
node
.
id
,
parentId
:
node
.
id
,
});
});
getTreeData
();
//
getTreeData();
}
else
{
}
else
{
message
.
error
(
'只能在目录上创建作业'
);
message
.
error
(
'只能在目录上创建作业'
);
}
}
...
@@ -206,7 +224,13 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
...
@@ -206,7 +224,13 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
okText
:
'确认'
,
okText
:
'确认'
,
cancelText
:
'取消'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
onOk
:
async
()
=>
{
await
handleRemove
(
'/api/catalogue'
,[
node
]);
await
handleRemoveById
(
'/api/catalogue'
,
node
.
id
);
if
(
node
.
taskId
)
{
dispatch
({
type
:
"Studio/deleteTabByKey"
,
payload
:
node
.
taskId
,
});
}
getTreeData
();
getTreeData
();
}
}
});
});
...
@@ -358,11 +382,14 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
...
@@ -358,11 +382,14 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
{
updateTaskModalVisible
?
(
{
updateTaskModalVisible
?
(
<
UpdateTaskForm
<
UpdateTaskForm
onSubmit=
{
async
(
value
)
=>
{
onSubmit=
{
async
(
value
)
=>
{
const
success
=
await
handleAddOrUpdate
(
'/api/catalogue/createTask'
,
value
);
const
datas
=
await
handleAddOrUpdateWithResult
(
'/api/catalogue/createTask'
,
value
);
if
(
succes
s
)
{
if
(
data
s
)
{
handleUpdateTaskModalVisible
(
false
);
handleUpdateTaskModalVisible
(
false
);
setTaskFormValues
({});
setTaskFormValues
({});
getTreeData
()
openByKey
(
datas
.
id
);
// getTreeData();
// console.log(datas);
// onSelect([],openByKey(datas.id));
}
}
}
}
}
}
onCancel=
{
()
=>
{
onCancel=
{
()
=>
{
...
...
dlink-web/src/components/Studio/index.tsx
View file @
7804ed29
...
@@ -73,7 +73,7 @@ const Studio: React.FC<StudioProps> = (props) => {
...
@@ -73,7 +73,7 @@ const Studio: React.FC<StudioProps> = (props) => {
</
Col
>
</
Col
>
<
Col
span=
{
16
}
>
<
Col
span=
{
16
}
>
<
StudioTabs
/>
<
StudioTabs
/>
<
StudioEdit
/>
{
/*<StudioEdit/>*/
}
</
Col
>
</
Col
>
<
Col
span=
{
4
}
className=
{
styles
[
"vertical-tabs"
]
}
>
<
Col
span=
{
4
}
className=
{
styles
[
"vertical-tabs"
]
}
>
<
Tabs
defaultActiveKey=
"1"
size=
"small"
tabPosition=
"right"
style=
{
{
height
:
"100%"
,
border
:
"1px solid #f0f0f0"
}
}
>
<
Tabs
defaultActiveKey=
"1"
size=
"small"
tabPosition=
"right"
style=
{
{
height
:
"100%"
,
border
:
"1px solid #f0f0f0"
}
}
>
...
...
dlink-web/src/locales/zh-CN/pages.ts
View file @
7804ed29
...
@@ -29,7 +29,7 @@ export default {
...
@@ -29,7 +29,7 @@ export default {
'pages.welcome.link'
:
'欢迎加入'
,
'pages.welcome.link'
:
'欢迎加入'
,
'pages.welcome.star'
:
'欢迎 Star '
,
'pages.welcome.star'
:
'欢迎 Star '
,
'pages.welcome.advancedLayout'
:
'Github'
,
'pages.welcome.advancedLayout'
:
'Github'
,
'pages.welcome.alertMessage'
:
'实时计算平台 Dlink & Apache Flink 即将发布,目前为体验版,版本号为 0.2.
1
。'
,
'pages.welcome.alertMessage'
:
'实时计算平台 Dlink & Apache Flink 即将发布,目前为体验版,版本号为 0.2.
2
。'
,
'pages.admin.subPage.title'
:
' 这个页面只有 admin 权限才能查看'
,
'pages.admin.subPage.title'
:
' 这个页面只有 admin 权限才能查看'
,
'pages.admin.subPage.alertMessage'
:
'umi ui 现已发布,欢迎使用 npm run ui 启动体验。'
,
'pages.admin.subPage.alertMessage'
:
'umi ui 现已发布,欢迎使用 npm run ui 启动体验。'
,
'pages.searchTable.createForm.newRule'
:
'新建规则'
,
'pages.searchTable.createForm.newRule'
:
'新建规则'
,
...
...
dlink-web/src/pages/FlinkSqlStudio/model.ts
View file @
7804ed29
import
{
Effect
,
Reducer
}
from
"umi"
;
import
{
Effect
,
Reducer
}
from
"umi"
;
import
{
executeSql
}
from
"./service"
;
import
{
executeSql
}
from
"./service"
;
import
{
addOrUpdateData
,
handleAddOrUpdate
,
postAll
,
queryData
}
from
"@/components/Common/crud"
;
import
{
addOrUpdateData
,
handleAddOrUpdate
,
handleRemove
,
handleRemoveById
,
postAll
,
queryData
}
from
"@/components/Common/crud"
;
import
{
Form
}
from
"antd"
;
import
{
Form
}
from
"antd"
;
export
type
ClusterType
=
{
export
type
ClusterType
=
{
...
@@ -50,6 +53,7 @@ export type TabsItemType = {
...
@@ -50,6 +53,7 @@ export type TabsItemType = {
path
:
string
[];
path
:
string
[];
task
?:
TaskType
;
task
?:
TaskType
;
console
:
ConsoleType
;
console
:
ConsoleType
;
monaco
?:
any
;
}
}
export
type
TabsType
=
{
export
type
TabsType
=
{
...
@@ -118,14 +122,15 @@ const Model: ModelType = {
...
@@ -118,14 +122,15 @@ const Model: ModelType = {
savePointPath
:
''
,
savePointPath
:
''
,
parallelism
:
1
,
parallelism
:
1
,
fragment
:
true
,
fragment
:
true
,
clusterId
:
'0'
,
clusterId
:
0
,
maxRowNum
:
100
,
maxRowNum
:
100
,
session
:
'admin'
,
session
:
'admin'
,
alias
:
'草稿'
,
alias
:
'草稿'
,
},
},
console
:{
console
:{
result
:[],
result
:[],
}
},
monaco
:
{},
},
},
sql
:
''
,
sql
:
''
,
monaco
:
{},
monaco
:
{},
...
@@ -150,7 +155,8 @@ const Model: ModelType = {
...
@@ -150,7 +155,8 @@ const Model: ModelType = {
},
},
console
:{
console
:{
result
:[],
result
:[],
}
},
monaco
:
{},
}],
}],
},
},
session
:[
'admin'
],
session
:[
'admin'
],
...
@@ -219,6 +225,28 @@ const Model: ModelType = {
...
@@ -219,6 +225,28 @@ const Model: ModelType = {
},
},
};
};
},
},
deleteTabByKey
(
state
,
{
payload
})
{
let
newTabs
=
state
.
tabs
;
for
(
let
i
=
0
;
i
<
newTabs
.
panes
.
length
;
i
++
){
if
(
newTabs
.
panes
[
i
].
key
==
payload
){
newTabs
.
panes
.
splice
(
i
,
1
);
break
;
}
}
let
newCurrent
=
newTabs
.
panes
[
newTabs
.
panes
.
length
-
1
];
if
(
newTabs
.
activeKey
==
payload
)
{
newTabs
.
activeKey
=
newCurrent
.
key
;
}
return
{
...
state
,
current
:{
...
newCurrent
,
},
tabs
:{
...
newTabs
,
},
};
},
changeActiveKey
(
state
,
{
payload
})
{
changeActiveKey
(
state
,
{
payload
})
{
let
tabs
=
state
.
tabs
;
let
tabs
=
state
.
tabs
;
tabs
.
activeKey
=
payload
;
tabs
.
activeKey
=
payload
;
...
...
dlink-web/src/pages/Welcome.tsx
View file @
7804ed29
...
@@ -20,7 +20,7 @@ export default (): React.ReactNode => {
...
@@ -20,7 +20,7 @@ export default (): React.ReactNode => {
<
Alert
<
Alert
message=
{
intl
.
formatMessage
({
message=
{
intl
.
formatMessage
({
id
:
'pages.welcome.alertMessage'
,
id
:
'pages.welcome.alertMessage'
,
defaultMessage
:
'实时计算平台 Dlink & Apache Flink 即将发布,目前为体验版,版本号为 0.2.2
-rc1
。'
,
defaultMessage
:
'实时计算平台 Dlink & Apache Flink 即将发布,目前为体验版,版本号为 0.2.2。'
,
})
}
})
}
type=
"success"
type=
"success"
showIcon
showIcon
...
@@ -177,7 +177,7 @@ export default (): React.ReactNode => {
...
@@ -177,7 +177,7 @@ export default (): React.ReactNode => {
</
ul
>
</
ul
>
</
Paragraph
>
</
Paragraph
>
</
Timeline
.
Item
>
</
Timeline
.
Item
>
<
Timeline
.
Item
><
Text
code
>
0.2.2
-rc1
</
Text
>
<
Text
type=
"secondary"
>
2021-06-15
</
Text
>
<
Timeline
.
Item
><
Text
code
>
0.2.2
</
Text
>
<
Text
type=
"secondary"
>
2021-06-15
</
Text
>
<
p
>
</
p
>
<
p
>
</
p
>
<
Paragraph
>
<
Paragraph
>
<
ul
>
<
ul
>
...
@@ -190,6 +190,21 @@ export default (): React.ReactNode => {
...
@@ -190,6 +190,21 @@ export default (): React.ReactNode => {
<
li
>
<
li
>
<
Link
href=
""
>
解决了表单无法正确提交 Fragment 的问题
</
Link
>
<
Link
href=
""
>
解决了表单无法正确提交 Fragment 的问题
</
Link
>
</
li
>
</
li
>
<
li
>
<
Link
href=
""
>
开启Hash路由解决了历史路由集成Springboot的问题
</
Link
>
</
li
>
<
li
>
<
Link
href=
""
>
解决了 FlinkSQL 编辑器的 CTRL+C 撤销乱窜问题
</
Link
>
</
li
>
<
li
>
<
Link
href=
""
>
解决了右键删除目录树的作业时对应选项卡不关闭的问题
</
Link
>
</
li
>
<
li
>
<
Link
href=
""
>
解决了新增作业其配置无法正常初始化的问题
</
Link
>
</
li
>
<
li
>
<
Link
href=
""
>
增加了新增作业自动定位及打开选项卡的功能
</
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