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
3bf91a3f
Commit
3bf91a3f
authored
Jan 16, 2022
by
wenmo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复 批量启用禁用集群、关闭tab无法更新位置及无法取消FlinkSQLEnv的bug
parent
983bbecb
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
52 additions
and
23 deletions
+52
-23
README.md
README.md
+2
-2
ClusterController.java
...src/main/java/com/dlink/controller/ClusterController.java
+9
-0
ClusterService.java
...admin/src/main/java/com/dlink/service/ClusterService.java
+2
-0
ClusterServiceImpl.java
.../main/java/com/dlink/service/impl/ClusterServiceImpl.java
+8
-0
StudioServiceImpl.java
...c/main/java/com/dlink/service/impl/StudioServiceImpl.java
+1
-1
TaskServiceImpl.java
...src/main/java/com/dlink/service/impl/TaskServiceImpl.java
+1
-1
index.tsx
...components/Studio/StudioRightTool/StudioSetting/index.tsx
+4
-1
index.tsx
dlink-web/src/components/Studio/StudioTabs/index.tsx
+5
-1
index.tsx
dlink-web/src/components/Studio/StudioTree/index.tsx
+0
-1
index.tsx
dlink-web/src/components/Studio/index.tsx
+13
-14
index.tsx
dlink-web/src/pages/Cluster/index.tsx
+2
-2
model.ts
dlink-web/src/pages/FlinkSqlStudio/model.ts
+2
-0
Welcome.tsx
dlink-web/src/pages/Welcome.tsx
+3
-0
No files found.
README.md
View file @
3bf91a3f
...
...
@@ -97,9 +97,9 @@ Dinky(原 Dlink):
### 版本
抢先体验( main 主支):dlink-0.
5
.0-SNAPSHOT
抢先体验( main 主支):dlink-0.
6
.0-SNAPSHOT
稳定版本( 0.
4.0 分支):dlink-0.4
.0
稳定版本( 0.
5.0 分支):dlink-0.5
.0
### 从安装包开始
...
...
dlink-admin/src/main/java/com/dlink/controller/ClusterController.java
View file @
3bf91a3f
...
...
@@ -39,6 +39,15 @@ public class ClusterController {
return
Result
.
succeed
(
Asserts
.
isNotNull
(
cluster
.
getId
())?
"修改成功"
:
"新增成功"
);
}
/**
* 启用和禁用
*/
@PutMapping
(
"/enable"
)
public
Result
enableCluster
(
@RequestBody
Cluster
cluster
)
throws
Exception
{
clusterService
.
enableCluster
(
cluster
);
return
Result
.
succeed
(
"修改成功"
);
}
/**
* 动态查询列表
*/
...
...
dlink-admin/src/main/java/com/dlink/service/ClusterService.java
View file @
3bf91a3f
...
...
@@ -32,5 +32,7 @@ public interface ClusterService extends ISuperService<Cluster> {
Cluster
registersCluster
(
Cluster
cluster
);
boolean
enableCluster
(
Cluster
cluster
);
int
clearCluster
();
}
dlink-admin/src/main/java/com/dlink/service/impl/ClusterServiceImpl.java
View file @
3bf91a3f
...
...
@@ -95,6 +95,14 @@ public class ClusterServiceImpl extends SuperServiceImpl<ClusterMapper, Cluster>
return
cluster
;
}
@Override
public
boolean
enableCluster
(
Cluster
cluster
)
{
Cluster
clusterInfo
=
getById
(
cluster
);
clusterInfo
.
setEnabled
(
cluster
.
getEnabled
());
checkHealth
(
clusterInfo
);
return
updateById
(
clusterInfo
);
}
@Override
public
int
clearCluster
()
{
List
<
Cluster
>
clusters
=
listAutoEnable
();
...
...
dlink-admin/src/main/java/com/dlink/service/impl/StudioServiceImpl.java
View file @
3bf91a3f
...
...
@@ -64,7 +64,7 @@ public class StudioServiceImpl implements StudioService {
private
TaskService
taskService
;
private
void
addFlinkSQLEnv
(
AbstractStatementDTO
statementDTO
){
if
(
Asserts
.
isNotNull
(
statementDTO
.
getEnvId
())){
if
(
Asserts
.
isNotNull
(
statementDTO
.
getEnvId
())
&&
statementDTO
.
getEnvId
()!=
0
){
Task
task
=
taskService
.
getTaskInfoById
(
statementDTO
.
getEnvId
());
if
(
Asserts
.
isNotNull
(
task
)&&
Asserts
.
isNotNullString
(
task
.
getStatement
()))
{
statementDTO
.
setStatement
(
task
.
getStatement
()
+
"\r\n"
+
statementDTO
.
getStatement
());
...
...
dlink-admin/src/main/java/com/dlink/service/impl/TaskServiceImpl.java
View file @
3bf91a3f
...
...
@@ -167,7 +167,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
private
JobConfig
buildJobConfig
(
Task
task
){
boolean
isJarTask
=
isJarTask
(
task
);
if
(!
isJarTask
&&
Asserts
.
isNotNull
(
task
.
getEnvId
())){
if
(!
isJarTask
&&
Asserts
.
isNotNull
(
task
.
getEnvId
())
&&
task
.
getEnvId
()!=
0
){
Task
envTask
=
getTaskInfoById
(
task
.
getEnvId
());
if
(
Asserts
.
isNotNull
(
envTask
)&&
Asserts
.
isNotNullString
(
envTask
.
getStatement
()))
{
task
.
setStatement
(
envTask
.
getStatement
()
+
"\r\n"
+
task
.
getStatement
());
...
...
dlink-web/src/components/Studio/StudioRightTool/StudioSetting/index.tsx
View file @
3bf91a3f
...
...
@@ -50,7 +50,9 @@ const StudioSetting = (props: any) => {
};
const
getEnvOptions
=
()
=>
{
const
itemList
=
[];
const
itemList
=
[<
Option
key=
{
0
}
value=
{
0
}
label=
'无'
>
无
</
Option
>];
for
(
const
item
of
env
)
{
const
tag
=
(<>
{
item
.
enabled
?
<
Badge
status=
"success"
/>
:
<
Badge
status=
"error"
/>
}
{
item
.
fragment
?
<
PaperClipOutlined
/>
:
undefined
}{
item
.
alias
}
</>);
...
...
@@ -188,6 +190,7 @@ const StudioSetting = (props: any) => {
placeholder=
"选择 FlinkSQL 环境,非必填"
allowClear
optionLabelProp=
"label"
defaultValue=
{
0
}
value=
{
0
}
>
{
getEnvOptions
()
}
</
Select
>
...
...
dlink-web/src/components/Studio/StudioTabs/index.tsx
View file @
3bf91a3f
...
...
@@ -5,6 +5,7 @@ import {StateType} from '@/pages/FlinkSqlStudio/model';
import
styles
from
'./index.less'
;
import
StudioEdit
from
'../StudioEdit'
;
import
{
DIALECT
}
from
'../conf'
;
import
StudioHome
from
"@/components/Studio/StudioHome"
;
const
{
TabPane
}
=
Tabs
;
...
...
@@ -105,6 +106,8 @@ const EditorTabs = (props: any) => {
);
return
(
<>
{
tabs
.
panes
.
length
===
0
?<
StudioHome
width=
{
width
}
/>:
<
Tabs
hideAdd
type=
"editable-card"
...
...
@@ -125,7 +128,8 @@ const EditorTabs = (props: any) => {
/>
</
TabPane
>
))
}
</
Tabs
>
</
Tabs
>
}
</>
);
};
...
...
dlink-web/src/components/Studio/StudioTree/index.tsx
View file @
3bf91a3f
...
...
@@ -126,7 +126,6 @@ const StudioTree: React.FC<StudioTreeProps> = (props) => {
setAvailable
(
true
);
},
200
);
if
(
node
?.
isLeaf
&&
node
.
taskId
)
{
// @ts-ignore
for
(
let
item
of
tabs
.
panes
){
if
(
item
.
key
==
node
.
taskId
){
dispatch
&&
dispatch
({
...
...
dlink-web/src/components/Studio/index.tsx
View file @
3bf91a3f
...
...
@@ -17,11 +17,10 @@ import {
import
{
loadSettings
}
from
"@/pages/Settings/function"
;
import
DraggleLayout
from
"@/components/DraggleLayout"
;
import
DraggleVerticalLayout
from
"@/components/DraggleLayout/DraggleVerticalLayout"
;
import
{
Dispatch
}
from
"@@/plugin-dva/connect"
;
const
Studio
=
(
props
:
any
)
=>
{
const
{
rightClickMenu
,
toolHeight
,
toolLeftWidth
,
toolRightWidth
,
tabs
,
current
,
dispatch
}
=
props
;
const
{
rightClickMenu
,
toolHeight
,
toolLeftWidth
,
toolRightWidth
,
dispatch
}
=
props
;
const
[
form
]
=
Form
.
useForm
();
const
VIEW
=
{
leftToolWidth
:
300
,
...
...
@@ -51,15 +50,17 @@ const Studio = (props: any) => {
};
},
[
onResize
]);
loadSettings
(
dispatch
);
getFillAllByVersion
(
''
,
dispatch
);
showCluster
(
dispatch
);
showSessionCluster
(
dispatch
);
showClusterConfiguration
(
dispatch
);
showDataBase
(
dispatch
);
listSession
(
dispatch
);
showJars
(
dispatch
);
showEnv
(
dispatch
);
useEffect
(()
=>
{
loadSettings
(
dispatch
);
getFillAllByVersion
(
''
,
dispatch
);
showCluster
(
dispatch
);
showSessionCluster
(
dispatch
);
showClusterConfiguration
(
dispatch
);
showDataBase
(
dispatch
);
listSession
(
dispatch
);
showJars
(
dispatch
);
showEnv
(
dispatch
);
},
[]);
const
onClick
=
()
=>
{
if
(
rightClickMenu
)
{
...
...
@@ -133,7 +134,7 @@ const Studio = (props: any) => {
}
}
/>
</
Col
>
<
Col
>
{
tabs
.
panes
.
length
===
0
?<
StudioHome
width=
{
size
.
width
-
toolRightWidth
-
toolLeftWidth
}
/>:<
StudioTabs
width=
{
size
.
width
-
toolRightWidth
-
toolLeftWidth
}
/>
}
<
StudioTabs
width=
{
size
.
width
-
toolRightWidth
-
toolLeftWidth
}
/>
</
Col
>
</
DraggleLayout
>
<
Col
id=
'StudioRightTool'
className=
{
styles
[
"vertical-tabs"
]
}
>
...
...
@@ -158,6 +159,4 @@ export default connect(({Studio}: { Studio: StateType }) => ({
toolHeight
:
Studio
.
toolHeight
,
toolLeftWidth
:
Studio
.
toolLeftWidth
,
toolRightWidth
:
Studio
.
toolRightWidth
,
tabs
:
Studio
.
tabs
,
current
:
Studio
.
current
,
}))(
Studio
);
dlink-web/src/pages/Cluster/index.tsx
View file @
3bf91a3f
...
...
@@ -367,7 +367,7 @@ const ClusterTableList: React.FC<{}> = (props: any) => {
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
await
updateEnabled
(
url
,
selectedRowsState
,
true
);
await
updateEnabled
(
url
+
'/enable'
,
selectedRowsState
,
true
);
setSelectedRows
([]);
actionRef
.
current
?.
reloadAndRest
?.();
}
...
...
@@ -382,7 +382,7 @@ const ClusterTableList: React.FC<{}> = (props: any) => {
okText
:
'确认'
,
cancelText
:
'取消'
,
onOk
:
async
()
=>
{
await
updateEnabled
(
url
,
selectedRowsState
,
false
);
await
updateEnabled
(
url
+
'/enable'
,
selectedRowsState
,
false
);
setSelectedRows
([]);
actionRef
.
current
?.
reloadAndRest
?.();
}
...
...
dlink-web/src/pages/FlinkSqlStudio/model.ts
View file @
3bf91a3f
...
...
@@ -317,6 +317,7 @@ const Model: ModelType = {
tabs
:
{
...
payload
,
},
currentPath
:
[
'引导页'
],
};
}
return
{
...
...
@@ -328,6 +329,7 @@ const Model: ModelType = {
tabs
:
{
...
payload
,
},
currentPath
:
newCurrent
.
path
,
};
},
deleteTabByKey
(
state
,
{
payload
})
{
...
...
dlink-web/src/pages/Welcome.tsx
View file @
3bf91a3f
...
...
@@ -559,6 +559,9 @@ export default (): React.ReactNode => {
<
li
>
<
Link
>
修改 草稿为引导页
</
Link
>
</
li
>
<
li
>
<
Link
>
修复 批量启用禁用集群、关闭tab无法更新位置及无法取消FlinkSQLEnv的bug
</
Link
>
</
li
>
</
ul
>
</
Paragraph
>
</
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