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
b7d9b0dc
Commit
b7d9b0dc
authored
Mar 18, 2022
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
作业剪切和粘贴
parent
cea2b80b
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
420 additions
and
320 deletions
+420
-320
CatalogueController.java
...c/main/java/com/dlink/controller/CatalogueController.java
+12
-0
CatalogueService.java
...min/src/main/java/com/dlink/service/CatalogueService.java
+2
-0
CatalogueServiceImpl.java
...ain/java/com/dlink/service/impl/CatalogueServiceImpl.java
+18
-7
DDL.ts
dlink-web/src/components/Studio/StudioEvent/DDL.ts
+55
-29
index.tsx
dlink-web/src/components/Studio/StudioMenu/index.tsx
+107
-100
index.tsx
dlink-web/src/components/Studio/StudioTree/index.tsx
+226
-184
No files found.
dlink-admin/src/main/java/com/dlink/controller/CatalogueController.java
View file @
b7d9b0dc
...
...
@@ -217,4 +217,16 @@ public class CatalogueController {
return
Result
.
failed
(
"重命名失败"
);
}
}
/**
* 重命名节点和作业
*/
@PutMapping
(
"/moveCatalogue"
)
public
Result
moveCatalogue
(
@RequestBody
Catalogue
catalogue
)
throws
Exception
{
if
(
catalogueService
.
moveCatalogue
(
catalogue
.
getId
(),
catalogue
.
getParentId
()))
{
return
Result
.
succeed
(
true
,
"移动成功"
);
}
else
{
return
Result
.
failed
(
false
,
"移动失败"
);
}
}
}
dlink-admin/src/main/java/com/dlink/service/CatalogueService.java
View file @
b7d9b0dc
...
...
@@ -25,4 +25,6 @@ public interface CatalogueService extends ISuperService<Catalogue> {
boolean
toRename
(
Catalogue
catalogue
);
boolean
removeCatalogueAndTaskById
(
Integer
id
);
boolean
moveCatalogue
(
Integer
id
,
Integer
parentId
);
}
dlink-admin/src/main/java/com/dlink/service/impl/CatalogueServiceImpl.java
View file @
b7d9b0dc
...
...
@@ -15,6 +15,9 @@ import org.springframework.transaction.annotation.Transactional;
import
java.util.List
;
import
static
com
.
dlink
.
assertion
.
Asserts
.
isNotNull
;
import
static
com
.
dlink
.
assertion
.
Asserts
.
isNull
;
/**
* CatalogueServiceImpl
*
...
...
@@ -29,9 +32,6 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
@Autowired
private
StatementService
statementService
;
@Autowired
private
CatalogueMapper
catalogueMapper
;
@Override
public
List
<
Catalogue
>
getAllData
()
{
return
this
.
list
();
...
...
@@ -39,7 +39,7 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
@Override
public
Catalogue
findByParentIdAndName
(
Integer
parent_id
,
String
name
)
{
return
catalogu
eMapper
.
selectOne
(
Wrappers
.<
Catalogue
>
query
().
eq
(
"parent_id"
,
parent_id
).
eq
(
"name"
,
name
));
return
bas
eMapper
.
selectOne
(
Wrappers
.<
Catalogue
>
query
().
eq
(
"parent_id"
,
parent_id
).
eq
(
"name"
,
name
));
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -83,7 +83,7 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
@Override
public
boolean
toRename
(
Catalogue
catalogue
)
{
Catalogue
oldCatalogue
=
this
.
getById
(
catalogue
.
getId
());
if
(
oldCatalogue
==
null
)
{
if
(
isNull
(
oldCatalogue
)
)
{
return
false
;
}
else
{
Task
task
=
new
Task
();
...
...
@@ -99,10 +99,10 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
@Override
public
boolean
removeCatalogueAndTaskById
(
Integer
id
)
{
Catalogue
catalogue
=
this
.
getById
(
id
);
if
(
catalogue
==
null
)
{
if
(
isNull
(
catalogue
)
)
{
return
false
;
}
else
{
if
(
catalogue
.
getTaskId
()
!=
null
)
{
if
(
isNotNull
(
catalogue
.
getTaskId
())
)
{
taskService
.
removeById
(
catalogue
.
getTaskId
());
statementService
.
removeById
(
catalogue
.
getTaskId
());
}
...
...
@@ -110,4 +110,15 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
return
true
;
}
}
@Override
public
boolean
moveCatalogue
(
Integer
id
,
Integer
parentId
)
{
Catalogue
catalogue
=
this
.
getById
(
id
);
if
(
isNull
(
catalogue
))
{
return
false
;
}
else
{
catalogue
.
setParentId
(
parentId
);
return
updateById
(
catalogue
);
}
}
}
dlink-web/src/components/Studio/StudioEvent/DDL.ts
View file @
b7d9b0dc
import
{
executeDDL
}
from
"@/pages/FlinkSqlStudio/service"
;
import
FlinkSQL
from
"./FlinkSQL"
;
import
{
SessionType
}
from
"@/pages/FlinkSqlStudio/model"
;
import
{
Modal
,
message
}
from
"antd"
;
import
{
Modal
,
message
}
from
"antd"
;
import
{
addOrUpdateData
,
getData
,
handleRemove
}
from
"@/components/Common/crud"
;
/*--- 保存sql ---*/
export
function
saveTask
(
current
:
any
,
dispatch
:
any
)
{
export
function
saveTask
(
current
:
any
,
dispatch
:
any
)
{
if
(
current
.
task
)
{
let
task
=
{
...
current
.
task
,
...
...
@@ -19,24 +19,26 @@ export function saveTask(current:any,dispatch: any){
}
/*--- 创建会话 ---*/
export
function
createSession
(
session
:
SessionType
,
dispatch
:
any
)
{
const
res
=
addOrUpdateData
(
"api/studio/createSession"
,
session
)
export
function
createSession
(
session
:
SessionType
,
dispatch
:
any
)
{
const
res
=
addOrUpdateData
(
"api/studio/createSession"
,
session
)
res
.
then
((
result
)
=>
{
message
.
success
(
`创建会话【
${
session
.
session
}
】成功!`
);
result
.
datas
&&
changeSession
(
result
.
datas
,
dispatch
);
result
.
datas
&&
changeSession
(
result
.
datas
,
dispatch
);
listSession
(
dispatch
);
});
}
/*--- 查询会话列表 ---*/
export
function
listSession
(
dispatch
:
any
)
{
const
res
=
getData
(
"api/studio/listSession"
);
res
.
then
((
result
)
=>
{
res
.
then
((
result
)
=>
{
dispatch
&&
dispatch
({
type
:
"Studio/saveSession"
,
payload
:
result
.
datas
,
});
});
}
/*--- 切换会话 ---*/
export
function
changeSession
(
session
:
SessionType
,
dispatch
:
any
)
{
dispatch
&&
dispatch
({
...
...
@@ -44,15 +46,17 @@ export function changeSession(session: SessionType, dispatch: any) {
payload
:
session
,
});
setTimeout
(
function
()
{
showTables
(
session
.
session
,
dispatch
);
},
200
);
showTables
(
session
.
session
,
dispatch
);
},
200
);
}
/*--- 退出会话 ---*/
export
function
quitSession
(
dispatch
:
any
)
{
export
function
quitSession
(
dispatch
:
any
)
{
dispatch
&&
dispatch
({
type
:
"Studio/quitCurrentSession"
,
});
}
/*--- 注销会话 ---*/
export
function
clearSession
(
session
:
string
,
dispatch
:
any
)
{
Modal
.
confirm
({
...
...
@@ -71,9 +75,10 @@ export function clearSession(session: string, dispatch: any) {
}
});
}
/*--- 刷新 Catalog Table ---*/
export
function
showTables
(
session
:
string
,
dispatch
:
any
)
{
if
(
session
==
null
||
session
==
''
)
{
if
(
session
==
null
||
session
==
''
)
{
return
;
}
const
res
=
executeDDL
({
...
...
@@ -90,11 +95,12 @@ export function showTables(session: string, dispatch: any) {
dispatch
&&
dispatch
({
type
:
"Studio/refreshCurrentSession"
,
payload
:
{
connectors
:
tableData
connectors
:
tableData
},
});
});
}
/*--- 移除 Catalog Table ---*/
export
function
removeTable
(
tablename
:
string
,
session
:
string
,
dispatch
:
any
)
{
Modal
.
confirm
({
...
...
@@ -114,6 +120,7 @@ export function removeTable(tablename: string, session: string, dispatch: any) {
}
});
}
/*--- 刷新 集群 ---*/
export
function
showCluster
(
dispatch
:
any
)
{
const
res
=
getData
(
'api/cluster/listEnabledAll'
);
...
...
@@ -124,6 +131,7 @@ export function showCluster(dispatch: any) {
});
});
}
/*--- 刷新 Session集群 ---*/
export
function
showSessionCluster
(
dispatch
:
any
)
{
const
res
=
getData
(
'api/cluster/listSessionEnable'
);
...
...
@@ -134,6 +142,7 @@ export function showSessionCluster(dispatch: any) {
});
});
}
/*--- 刷新 数据源 ---*/
export
function
showDataBase
(
dispatch
:
any
)
{
const
res
=
getData
(
'api/database/listEnabledAll'
);
...
...
@@ -144,6 +153,7 @@ export function showDataBase(dispatch: any) {
});
});
}
/*--- 刷新 执行环境 ---*/
export
function
showEnv
(
dispatch
:
any
)
{
const
res
=
getData
(
'api/task/listFlinkSQLEnv'
);
...
...
@@ -154,6 +164,7 @@ export function showEnv(dispatch: any) {
});
});
}
/*--- 刷新 自定义Jar ---*/
export
function
showJars
(
dispatch
:
any
)
{
const
res
=
getData
(
'api/jar/listEnabledAll'
);
...
...
@@ -164,6 +175,7 @@ export function showJars(dispatch: any) {
});
});
}
/*--- 刷新 报警实例 ---*/
export
function
showAlertInstance
(
dispatch
:
any
)
{
const
res
=
getData
(
'api/alertInstance/listEnabledAll'
);
...
...
@@ -174,6 +186,7 @@ export function showAlertInstance(dispatch: any) {
});
});
}
/*--- 刷新 报警组 ---*/
export
function
showAlertGroup
(
dispatch
:
any
)
{
const
res
=
getData
(
'api/alertGroup/listEnabledAll'
);
...
...
@@ -184,29 +197,35 @@ export function showAlertGroup(dispatch: any) {
});
});
}
/*--- 刷新 元数据表 ---*/
export
function
showMetaDataTable
(
id
:
number
)
{
return
getData
(
'api/database/getSchemasAndTables'
,
{
id
:
id
});
export
function
showMetaDataTable
(
id
:
number
)
{
return
getData
(
'api/database/getSchemasAndTables'
,
{
id
:
id
});
}
/*--- 刷新 Flink Jobs ---*/
export
function
showFlinkJobs
(
clusterId
:
number
)
{
return
getData
(
'api/studio/listJobs'
,
{
clusterId
:
clusterId
});
export
function
showFlinkJobs
(
clusterId
:
number
)
{
return
getData
(
'api/studio/listJobs'
,
{
clusterId
:
clusterId
});
}
/*--- 停止 Flink Jobs ---*/
export
function
cancelJob
(
clusterId
:
number
,
jobId
:
string
)
{
return
getData
(
'api/studio/cancel'
,
{
clusterId
:
clusterId
,
jobId
:
jobId
});
export
function
cancelJob
(
clusterId
:
number
,
jobId
:
string
)
{
return
getData
(
'api/studio/cancel'
,
{
clusterId
:
clusterId
,
jobId
:
jobId
});
}
/*--- 重启 Flink Jobs ---*/
export
function
restartJob
(
id
:
number
)
{
return
getData
(
'api/task/restartTask'
,
{
id
});
export
function
restartJob
(
id
:
number
,
isOnLine
:
boolean
)
{
return
getData
(
'api/task/restartTask'
,
{
id
,
isOnLine
});
}
/*--- 停止 SavePoint Jobs ---*/
export
function
savepointJob
(
clusterId
:
number
,
jobId
:
string
,
savePointType
:
string
,
name
:
string
,
taskId
:
number
)
{
return
getData
(
'api/studio/savepoint'
,
{
clusterId
,
jobId
,
savePointType
,
name
,
taskId
});
export
function
savepointJob
(
clusterId
:
number
,
jobId
:
string
,
savePointType
:
string
,
name
:
string
,
taskId
:
number
)
{
return
getData
(
'api/studio/savepoint'
,
{
clusterId
,
jobId
,
savePointType
,
name
,
taskId
});
}
/*--- 根据版本号获取所有自动补全的文档 ---*/
export
function
getFillAllByVersion
(
version
:
string
,
dispatch
:
any
)
{
const
res
=
getData
(
'api/document/getFillAllByVersion'
,
{
version
:
version
});
export
function
getFillAllByVersion
(
version
:
string
,
dispatch
:
any
)
{
const
res
=
getData
(
'api/document/getFillAllByVersion'
,
{
version
:
version
});
res
.
then
((
result
)
=>
{
result
.
datas
&&
dispatch
&&
dispatch
({
type
:
"Document/saveAllFillDocuments"
,
...
...
@@ -214,6 +233,7 @@ export function getFillAllByVersion(version:string,dispatch: any) {
});
});
}
/*--- 刷新 集群 ---*/
export
function
showClusterConfiguration
(
dispatch
:
any
)
{
const
res
=
getData
(
'api/clusterConfiguration/listEnabledAll'
);
...
...
@@ -224,27 +244,33 @@ export function showClusterConfiguration(dispatch: any) {
});
});
}
/*--- 发布作业 ---*/
export
function
releaseTask
(
id
:
number
)
{
return
getData
(
'api/task/releaseTask'
,{
id
});
return
getData
(
'api/task/releaseTask'
,
{
id
});
}
/*--- 发布作业 ---*/
export
function
developTask
(
id
:
number
)
{
return
getData
(
'api/task/developTask'
,{
id
});
return
getData
(
'api/task/developTask'
,
{
id
});
}
/*--- 上线作业 ---*/
export
function
onLineTask
(
id
:
number
)
{
return
getData
(
'api/task/onLineTask'
,{
id
});
return
getData
(
'api/task/onLineTask'
,
{
id
});
}
/*--- 下线作业 ---*/
export
function
offLineTask
(
id
:
number
,
type
:
string
)
{
return
getData
(
'api/task/offLineTask'
,{
id
,
type
});
return
getData
(
'api/task/offLineTask'
,
{
id
,
type
});
}
/*--- 注销作业 ---*/
export
function
cancelTask
(
id
:
number
)
{
return
getData
(
'api/task/cancelTask'
,{
id
});
return
getData
(
'api/task/cancelTask'
,
{
id
});
}
/*--- 恢复作业 ---*/
export
function
recoveryTask
(
id
:
number
)
{
return
getData
(
'api/task/recoveryTask'
,{
id
});
return
getData
(
'api/task/recoveryTask'
,
{
id
});
}
dlink-web/src/components/Studio/StudioMenu/index.tsx
View file @
b7d9b0dc
This diff is collapsed.
Click to expand it.
dlink-web/src/components/Studio/StudioTree/index.tsx
View file @
b7d9b0dc
This diff is collapsed.
Click to expand it.
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