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
3cb783b0
Commit
3cb783b0
authored
Nov 13, 2021
by
godkaikai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Studio添加执行模式
parent
ce40970f
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
96 additions
and
30 deletions
+96
-30
Jar.java
dlink-admin/src/main/java/com/dlink/model/Jar.java
+2
-0
Task.java
dlink-admin/src/main/java/com/dlink/model/Task.java
+2
-0
TaskMapper.xml
dlink-admin/src/main/resources/mapper/TaskMapper.xml
+2
-1
dlink.sql
dlink-doc/sql/dlink.sql
+3
-0
index.tsx
...components/Studio/StudioRightTool/StudioSetting/index.tsx
+63
-25
index.tsx
dlink-web/src/components/Studio/index.tsx
+5
-1
model.ts
dlink-web/src/pages/FlinkSqlStudio/model.ts
+6
-0
JarForm.tsx
dlink-web/src/pages/Jar/components/JarForm.tsx
+8
-1
data.d.ts
dlink-web/src/pages/Jar/data.d.ts
+1
-0
index.tsx
dlink-web/src/pages/Jar/index.tsx
+4
-2
No files found.
dlink-admin/src/main/java/com/dlink/model/Jar.java
View file @
3cb783b0
...
...
@@ -29,5 +29,7 @@ public class Jar extends SuperEntity {
private
String
mainClass
;
private
String
paras
;
private
String
note
;
}
dlink-admin/src/main/java/com/dlink/model/Task.java
View file @
3cb783b0
...
...
@@ -41,6 +41,8 @@ public class Task extends SuperEntity{
private
Integer
clusterId
;
private
Integer
clusterConfigurationId
;
private
String
config
;
private
String
note
;
...
...
dlink-admin/src/main/resources/mapper/TaskMapper.xml
View file @
3cb783b0
...
...
@@ -13,6 +13,7 @@
<result
column=
"parallelism"
property=
"parallelism"
/>
<result
column=
"fragment"
property=
"fragment"
/>
<result
column=
"cluster_id"
property=
"clusterId"
/>
<result
column=
"cluster_configuration_id"
property=
"clusterConfigurationId"
/>
<result
column=
"config"
property=
"config"
/>
<result
column=
"note"
property=
"note"
/>
<result
column=
"enabled"
property=
"enabled"
/>
...
...
@@ -22,7 +23,7 @@
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, name, alias, type,check_point,save_point_path, parallelism,fragment,cluster_id,config,note, enabled, create_time, update_time
id, name, alias, type,check_point,save_point_path, parallelism,fragment,cluster_id,c
luster_configuration_id,c
onfig,note, enabled, create_time, update_time
</sql>
...
...
dlink-doc/sql/dlink.sql
View file @
3cb783b0
...
...
@@ -389,6 +389,7 @@ CREATE TABLE `dlink_job` (
`type`
varchar
(
50
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'类型'
,
`path`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'文件路径'
,
`main_class`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'启动类'
,
`paras`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'启动类入参'
,
`note`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
DEFAULT
NULL
COMMENT
'注释'
,
`enabled`
tinyint
(
1
)
NOT
NULL
DEFAULT
'1'
COMMENT
'是否启用'
,
`create_time`
datetime
DEFAULT
NULL
COMMENT
'创建时间'
,
...
...
@@ -396,4 +397,6 @@ CREATE TABLE `dlink_job` (
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Dynamic
;
ALTER
TABLE
`dlink`
.
`dlink_task`
ADD
COLUMN
`cluster_configuration_id`
int
(
11
)
NULL
COMMENT
'集群配置ID'
AFTER
`cluster_id`
;
SET
FOREIGN_KEY_CHECKS
=
1
;
dlink-web/src/components/Studio/StudioRightTool/StudioSetting/index.tsx
View file @
3cb783b0
...
...
@@ -11,7 +11,7 @@ const { Text } = Typography;
const
StudioSetting
=
(
props
:
any
)
=>
{
const
{
cluster
,
current
,
form
,
dispatch
,
tabs
,
currentSession
}
=
props
;
const
{
cluster
,
c
lusterConfiguration
,
c
urrent
,
form
,
dispatch
,
tabs
,
currentSession
}
=
props
;
const
getClusterOptions
=
()
=>
{
let
itemList
=
[(<
Option
value=
{
0
}
label=
{
(<><
Tag
color=
"default"
>
Local
</
Tag
>
本地环境
</>)
}
>
...
...
@@ -27,6 +27,17 @@ const StudioSetting = (props: any) => {
return
itemList
;
};
const
getClusterConfigurationOptions
=
()
=>
{
let
itemList
=
[];
for
(
let
item
of
clusterConfiguration
){
let
tag
=
(<><
Tag
color=
{
item
.
enabled
?
"processing"
:
"error"
}
>
{
item
.
type
}
</
Tag
>
{
item
.
alias
}
</>);
itemList
.
push
(<
Option
value=
{
item
.
id
}
label=
{
tag
}
>
{
tag
}
</
Option
>)
}
return
itemList
;
};
form
.
setFieldsValue
(
current
.
task
);
const
onValuesChange
=
(
change
:
any
,
all
:
any
)
=>
{
...
...
@@ -39,7 +50,6 @@ const StudioSetting = (props: any) => {
break
;
}
}
// console.log(change);
dispatch
&&
dispatch
({
type
:
"Studio/saveTabs"
,
payload
:
newTabs
,
...
...
@@ -69,6 +79,56 @@ const StudioSetting = (props: any) => {
className=
{
styles
.
form_setting
}
onValuesChange=
{
onValuesChange
}
>
<
Form
.
Item
label=
"执行模式"
className=
{
styles
.
form_item
}
name=
"type"
tooltip=
'指定 Flink 任务的执行模式,默认为 yarn-session'
>
<
Select
defaultValue=
"yarn-session"
value=
"yarn-session"
>
<
Option
value=
"standalone"
>
standalone
</
Option
>
<
Option
value=
"yarn-session"
>
yarn-session
</
Option
>
<
Option
value=
"yarn-per-job"
>
yarn-per-job
</
Option
>
<
Option
value=
"yarn-application"
>
yarn-application
</
Option
>
</
Select
>
</
Form
.
Item
>
{
(
current
.
task
.
type
==
'yarn-session'
||
current
.
task
.
type
==
'standalone'
)?(
<
Row
>
<
Col
span=
{
24
}
>
<
Form
.
Item
label=
"Flink集群"
tooltip=
{
`选择Flink集群进行 ${current.task.type} 模式的远程提交任务`
}
name=
"clusterId"
className=
{
styles
.
form_item
}
>
{
currentSession
.
session
?
(
currentSession
.
sessionConfig
&&
currentSession
.
sessionConfig
.
clusterId
?
(<><
Badge
status=
"success"
/><
Text
type=
"success"
>
{
currentSession
.
sessionConfig
.
clusterName
}
</
Text
></>)
:(<><
Badge
status=
"error"
/><
Text
type=
"danger"
>
本地模式
</
Text
></>)
):(<
Select
style=
{
{
width
:
'100%'
}
}
placeholder=
"选择Flink集群"
defaultValue=
{
0
}
optionLabelProp=
"label"
onChange=
{
onChangeClusterSession
}
>
{
getClusterOptions
()
}
</
Select
>)
}
</
Form
.
Item
>
</
Col
>
</
Row
>):
''
}
{
(
current
.
task
.
type
==
'yarn-per-job'
||
current
.
task
.
type
==
'yarn-application'
)?(
<
Row
>
<
Col
span=
{
24
}
>
<
Form
.
Item
label=
"Flink集群配置"
tooltip=
{
`选择Flink集群配置进行 ${current.task.type} 模式的远程提交任务`
}
name=
"clusterConfigurationId"
className=
{
styles
.
form_item
}
>
<
Select
style=
{
{
width
:
'100%'
}
}
placeholder=
"选择Flink集群配置"
defaultValue=
{
0
}
optionLabelProp=
"label"
>
{
getClusterConfigurationOptions
()
}
</
Select
>
</
Form
.
Item
>
</
Col
>
</
Row
>):
''
}
<
Form
.
Item
label=
"作业名"
className=
{
styles
.
form_item
}
name=
"jobName"
tooltip=
'设置任务名称,默认为作业名'
...
...
@@ -108,29 +168,6 @@ const StudioSetting = (props: any) => {
>
<
Input
placeholder=
"hdfs://..."
/>
</
Form
.
Item
>
<
Row
>
<
Col
span=
{
24
}
>
<
Form
.
Item
label=
"Flink集群"
tooltip=
"选择Flink集群进行远程提交任务"
name=
"clusterId"
className=
{
styles
.
form_item
}
>
{
currentSession
.
session
?
(
currentSession
.
sessionConfig
&&
currentSession
.
sessionConfig
.
clusterId
?
(<><
Badge
status=
"success"
/><
Text
type=
"success"
>
{
currentSession
.
sessionConfig
.
clusterName
}
</
Text
></>)
:(<><
Badge
status=
"error"
/><
Text
type=
"danger"
>
本地模式
</
Text
></>)
):(<
Select
style=
{
{
width
:
'100%'
}
}
placeholder=
"选择Flink集群"
defaultValue=
{
0
}
optionLabelProp=
"label"
onChange=
{
onChangeClusterSession
}
>
{
getClusterOptions
()
}
</
Select
>)
}
</
Form
.
Item
>
</
Col
>
</
Row
>
<
Form
.
Item
label=
"其他配置"
className=
{
styles
.
form_item
}
tooltip=
{
{
title
:
'其他配置项,将被应用于执行环境,如 pipeline.name'
,
icon
:
<
InfoCircleOutlined
/>
}
}
...
...
@@ -177,6 +214,7 @@ const StudioSetting = (props: any) => {
export
default
connect
(({
Studio
}:
{
Studio
:
StateType
})
=>
({
cluster
:
Studio
.
cluster
,
clusterConfiguration
:
Studio
.
clusterConfiguration
,
current
:
Studio
.
current
,
tabs
:
Studio
.
tabs
,
session
:
Studio
.
session
,
...
...
dlink-web/src/components/Studio/index.tsx
View file @
3cb783b0
...
...
@@ -11,7 +11,10 @@ import {StateType} from "@/pages/FlinkSqlStudio/model";
import
StudioConsole
from
"./StudioConsole"
;
import
StudioLeftTool
from
"./StudioLeftTool"
;
import
StudioRightTool
from
"./StudioRightTool"
;
import
{
listSession
,
showCluster
,
showDataBase
,
getFillAllByVersion
}
from
"@/components/Studio/StudioEvent/DDL"
;
import
{
listSession
,
showCluster
,
showDataBase
,
getFillAllByVersion
,
showClusterConfiguration
}
from
"@/components/Studio/StudioEvent/DDL"
;
type
StudioProps
=
{
rightClickMenu
:
StateType
[
'rightClickMenu'
];
...
...
@@ -24,6 +27,7 @@ const Studio: React.FC<StudioProps> = (props) => {
const
[
form
]
=
Form
.
useForm
();
getFillAllByVersion
(
''
,
dispatch
);
showCluster
(
dispatch
);
showClusterConfiguration
(
dispatch
);
showDataBase
(
dispatch
);
listSession
(
dispatch
);
...
...
dlink-web/src/pages/FlinkSqlStudio/model.ts
View file @
3cb783b0
...
...
@@ -63,6 +63,8 @@ export type TaskType = {
config
?:
[],
clusterId
?:
any
,
clusterName
?:
string
,
clusterConfigurationId
?:
string
,
clusterConfigurationName
?:
string
,
note
?:
string
,
enabled
?:
boolean
,
createTime
?:
Date
,
...
...
@@ -181,6 +183,8 @@ const Model: ModelType = {
fragment
:
true
,
clusterId
:
0
,
clusterName
:
"本地环境"
,
clusterConfigurationId
:
undefined
,
clusterConfigurationName
:
undefined
,
maxRowNum
:
100
,
config
:
[],
session
:
''
,
...
...
@@ -214,6 +218,8 @@ const Model: ModelType = {
fragment
:
true
,
clusterId
:
0
,
clusterName
:
"本地环境"
,
clusterConfigurationId
:
undefined
,
clusterConfigurationName
:
undefined
,
session
:
''
,
config
:
[],
maxRowNum
:
100
,
...
...
dlink-web/src/pages/Jar/components/JarForm.tsx
View file @
3cb783b0
...
...
@@ -25,6 +25,7 @@ const JarForm: React.FC<JarFormProps> = (props) => {
type
:
props
.
values
.
type
?
props
.
values
.
type
:
'UserApp'
,
path
:
props
.
values
.
path
,
mainClass
:
props
.
values
.
mainClass
,
paras
:
props
.
values
.
paras
,
note
:
props
.
values
.
note
,
enabled
:
props
.
values
.
enabled
?
props
.
values
.
enabled
:
true
,
});
...
...
@@ -68,7 +69,13 @@ const JarForm: React.FC<JarFormProps> = (props) => {
>
<
Input
placeholder=
"com.dlink.app.MainApp"
/>
</
Form
.
Item
>
<
Divider
orientation=
"left"
plain
>
自定义配置(高优先级)
</
Divider
>
<
Form
.
Item
name=
"paras"
label=
"执行参数"
help=
"指定可执行 Jar 的启动类入参,(可选)"
>
<
Input
placeholder=
"--id 1,2"
/>
</
Form
.
Item
>
<
Divider
>
基本配置
</
Divider
>
<
Form
.
Item
name=
"name"
...
...
dlink-web/src/pages/Jar/data.d.ts
View file @
3cb783b0
...
...
@@ -5,6 +5,7 @@ export type JarTableListItem = {
type
:
string
,
path
:
string
,
mainClass
:
string
,
paras
:
string
,
note
:
string
,
enabled
:
boolean
,
createTime
:
Date
,
...
...
dlink-web/src/pages/Jar/index.tsx
View file @
3cb783b0
...
...
@@ -107,13 +107,15 @@ const JarTableList: React.FC<{}> = (props: any) => {
title
:
'文件路径'
,
sorter
:
true
,
dataIndex
:
'path'
,
hideInTable
:
false
,
},
{
title
:
'启动类'
,
sorter
:
true
,
dataIndex
:
'mainClass'
,
hideInTable
:
false
,
},{
title
:
'执行参数'
,
sorter
:
true
,
dataIndex
:
'paras'
,
},
{
title
:
'注释'
,
...
...
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