Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
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
wangpeng
dinky
Commits
22be7cf2
Unverified
Commit
22be7cf2
authored
Sep 22, 2023
by
gaoyan
Committed by
GitHub
Sep 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor cluster model,Fix submit bug (#2332)
* refactor ClusterConfiguration Model
parent
7d966bf8
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
188 additions
and
83 deletions
+188
-83
ClusterConfigurationController.java
.../org/dinky/controller/ClusterConfigurationController.java
+16
-6
ClusterConfigurationDTO.java
...main/java/org/dinky/data/dto/ClusterConfigurationDTO.java
+95
-0
ClusterConfiguration.java
.../main/java/org/dinky/data/model/ClusterConfiguration.java
+0
-10
JobInfoDetail.java
...min/src/main/java/org/dinky/data/model/JobInfoDetail.java
+2
-1
JobRefeshHandler.java
...src/main/java/org/dinky/job/handler/JobRefeshHandler.java
+3
-3
ClusterConfigurationService.java
...n/java/org/dinky/service/ClusterConfigurationService.java
+2
-1
ClusterConfigurationServiceImpl.java
...g/dinky/service/impl/ClusterConfigurationServiceImpl.java
+8
-7
ClusterInstanceServiceImpl.java
...va/org/dinky/service/impl/ClusterInstanceServiceImpl.java
+6
-5
JobInstanceServiceImpl.java
...n/java/org/dinky/service/impl/JobInstanceServiceImpl.java
+3
-2
TaskServiceImpl.java
...src/main/java/org/dinky/service/impl/TaskServiceImpl.java
+25
-27
FlinkClusterConfig.java
...main/java/org/dinky/gateway/model/FlinkClusterConfig.java
+9
-0
index.tsx
...ster/Configuration/components/ConfigurationList/index.tsx
+1
-2
index.tsx
...rationModal/ConfigurationForm/ApplicationConfig/index.tsx
+1
-1
index.tsx
...s/ConfigurationModal/ConfigurationForm/FlinkK8s/index.tsx
+10
-10
index.tsx
...ationModal/ConfigurationForm/HighPriorityConfig/index.tsx
+2
-2
index.tsx
...ConfigurationModal/ConfigurationForm/YarnConfig/index.tsx
+5
-5
data.d.ts
dinky-web/src/types/RegCenter/data.d.ts
+0
-1
No files found.
dinky-admin/src/main/java/org/dinky/controller/ClusterConfigurationController.java
View file @
22be7cf2
...
...
@@ -20,6 +20,7 @@
package
org
.
dinky
.
controller
;
import
org.dinky.data.annotation.Log
;
import
org.dinky.data.dto.ClusterConfigurationDTO
;
import
org.dinky.data.enums.BusinessType
;
import
org.dinky.data.enums.Status
;
import
org.dinky.data.model.ClusterConfiguration
;
...
...
@@ -29,6 +30,7 @@ import org.dinky.gateway.result.TestResult;
import
org.dinky.service.ClusterConfigurationService
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -75,11 +77,10 @@ public class ClusterConfigurationController {
paramType
=
"body"
,
required
=
true
,
dataTypeClass
=
ClusterConfiguration
.
class
)
public
Result
<
Void
>
saveOrUpdateClusterConfig
(
@RequestBody
ClusterConfiguration
clusterConfiguration
)
{
Integer
id
=
clusterConfiguration
.
getId
();
public
Result
<
Void
>
saveOrUpdateClusterConfig
(
@RequestBody
ClusterConfigurationDTO
clusterConfiguration
)
{
TestResult
testResult
=
clusterConfigurationService
.
testGateway
(
clusterConfiguration
);
clusterConfiguration
.
setIsAvailable
(
testResult
.
isAvailable
());
if
(
clusterConfigurationService
.
saveOrUpdate
(
clusterConfiguration
))
{
if
(
clusterConfigurationService
.
saveOrUpdate
(
clusterConfiguration
.
toBean
()
))
{
return
Result
.
succeed
(
Status
.
SAVE_SUCCESS
);
}
else
{
return
Result
.
failed
(
Status
.
SAVE_FAILED
);
...
...
@@ -100,8 +101,17 @@ public class ClusterConfigurationController {
dataType
=
"JsonNode"
,
paramType
=
"body"
,
required
=
true
)
public
ProTableResult
<
ClusterConfiguration
>
listClusterConfigList
(
@RequestBody
JsonNode
para
)
{
return
clusterConfigurationService
.
selectForProTable
(
para
);
public
ProTableResult
<
ClusterConfigurationDTO
>
listClusterConfigList
(
@RequestBody
JsonNode
para
)
{
ProTableResult
<
ClusterConfiguration
>
result
=
clusterConfigurationService
.
selectForProTable
(
para
);
List
<
ClusterConfigurationDTO
>
dtoList
=
result
.
getData
().
stream
().
map
(
ClusterConfigurationDTO:
:
fromBean
).
collect
(
Collectors
.
toList
());
return
ProTableResult
.<
ClusterConfigurationDTO
>
builder
()
.
success
(
true
)
.
data
(
dtoList
)
.
total
(
result
.
getTotal
())
.
current
(
result
.
getCurrent
())
.
pageSize
(
result
.
getPageSize
())
.
build
();
}
/**
...
...
@@ -174,7 +184,7 @@ public class ClusterConfigurationController {
paramType
=
"body"
,
required
=
true
,
dataTypeClass
=
ClusterConfiguration
.
class
)
public
Result
<
Void
>
testConnect
(
@RequestBody
ClusterConfiguration
clusterConfiguration
)
{
public
Result
<
Void
>
testConnect
(
@RequestBody
ClusterConfiguration
DTO
clusterConfiguration
)
{
TestResult
testResult
=
clusterConfigurationService
.
testGateway
(
clusterConfiguration
);
if
(
testResult
.
isAvailable
())
{
return
Result
.
succeed
(
Status
.
TEST_CONNECTION_SUCCESS
);
...
...
dinky-admin/src/main/java/org/dinky/data/dto/ClusterConfigurationDTO.java
0 → 100644
View file @
22be7cf2
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package
org
.
dinky
.
data
.
dto
;
import
org.dinky.data.model.ClusterConfiguration
;
import
org.dinky.gateway.model.FlinkClusterConfig
;
import
org.dinky.mybatis.annotation.Save
;
import
org.dinky.utils.JSONUtil
;
import
javax.validation.constraints.NotNull
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
cn.hutool.core.bean.BeanUtil
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
ClusterConfigurationDTO
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"ID"
,
required
=
true
,
dataType
=
"Integer"
,
example
=
"1"
,
notes
=
"Primary Key"
)
private
Integer
id
;
@NotNull
(
message
=
"Name cannot be null"
,
groups
=
{
Save
.
class
})
@ApiModelProperty
(
value
=
"Name"
,
required
=
true
,
dataType
=
"String"
,
example
=
"Name"
)
private
String
name
;
@NotNull
(
message
=
"Enabled cannot be null"
,
groups
=
{
Save
.
class
})
@ApiModelProperty
(
value
=
"Enabled"
,
required
=
true
,
dataType
=
"Boolean"
,
example
=
"true"
)
private
Boolean
enabled
;
@ApiModelProperty
(
value
=
"type"
,
required
=
true
,
dataType
=
"String"
,
example
=
"test"
,
notes
=
"cluster type, such as: yarn ,k8s-native ,k8s-session"
)
private
String
type
;
@ApiModelProperty
(
value
=
"configJson"
,
required
=
true
,
dataType
=
"String"
,
example
=
"test"
,
notes
=
"cluster config json"
)
private
FlinkClusterConfig
config
;
@ApiModelProperty
(
value
=
"isAvailable"
,
required
=
true
,
dataType
=
"Boolean"
,
example
=
"true"
,
notes
=
"cluster is available, 0: not available, 1: available"
)
private
Boolean
isAvailable
;
@ApiModelProperty
(
value
=
"note"
,
required
=
true
,
dataType
=
"String"
,
example
=
"test"
,
notes
=
"cluster note"
)
private
String
note
;
public
static
ClusterConfigurationDTO
fromBean
(
ClusterConfiguration
bean
)
{
ClusterConfigurationDTO
clusterConfigurationDTO
=
new
ClusterConfigurationDTO
();
BeanUtil
.
copyProperties
(
bean
,
clusterConfigurationDTO
);
clusterConfigurationDTO
.
setConfig
(
FlinkClusterConfig
.
create
(
bean
.
getType
(),
bean
.
getConfigJson
()));
return
clusterConfigurationDTO
;
}
public
ClusterConfiguration
toBean
()
{
ClusterConfiguration
clusterConfiguration
=
new
ClusterConfiguration
();
BeanUtil
.
copyProperties
(
this
,
clusterConfiguration
);
clusterConfiguration
.
setConfigJson
(
JSONUtil
.
toJsonString
(
this
.
getConfig
()));
return
clusterConfiguration
;
}
}
dinky-admin/src/main/java/org/dinky/data/model/ClusterConfiguration.java
View file @
22be7cf2
...
...
@@ -19,13 +19,10 @@
package
org
.
dinky
.
data
.
model
;
import
org.dinky.gateway.enums.GatewayType
;
import
org.dinky.gateway.model.FlinkClusterConfig
;
import
org.dinky.mybatis.model.SuperEntity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
cn.hutool.json.JSONObject
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -73,11 +70,4 @@ public class ClusterConfiguration extends SuperEntity {
@ApiModelProperty
(
value
=
"note"
,
required
=
true
,
dataType
=
"String"
,
example
=
"test"
,
notes
=
"cluster note"
)
private
String
note
;
public
FlinkClusterConfig
getFlinkClusterCfg
()
{
JSONObject
json
=
new
JSONObject
(
getConfigJson
());
FlinkClusterConfig
flinkClusterConfig
=
json
.
toBean
(
FlinkClusterConfig
.
class
);
flinkClusterConfig
.
setType
(
GatewayType
.
get
(
type
));
return
flinkClusterConfig
;
}
}
dinky-admin/src/main/java/org/dinky/data/model/JobInfoDetail.java
View file @
22be7cf2
...
...
@@ -19,6 +19,7 @@
package
org
.
dinky
.
data
.
model
;
import
org.dinky.data.dto.ClusterConfigurationDTO
;
import
org.dinky.data.dto.JobDataDto
;
import
java.util.HashMap
;
...
...
@@ -47,7 +48,7 @@ public class JobInfoDetail {
private
Cluster
cluster
;
@ApiModelProperty
(
value
=
"Cluster Configuration"
,
notes
=
"Details about the cluster configuration"
)
private
ClusterConfiguration
clusterConfiguration
;
private
ClusterConfiguration
DTO
clusterConfiguration
;
@ApiModelProperty
(
value
=
"History"
,
notes
=
"Details about the history"
)
private
History
history
;
...
...
dinky-admin/src/main/java/org/dinky/job/handler/JobRefeshHandler.java
View file @
22be7cf2
...
...
@@ -23,9 +23,9 @@ import org.dinky.api.FlinkAPI;
import
org.dinky.assertion.Asserts
;
import
org.dinky.context.SpringContextUtils
;
import
org.dinky.data.constant.FlinkRestResultConstant
;
import
org.dinky.data.dto.ClusterConfigurationDTO
;
import
org.dinky.data.dto.JobDataDto
;
import
org.dinky.data.enums.JobStatus
;
import
org.dinky.data.model.ClusterConfiguration
;
import
org.dinky.data.model.JobInfoDetail
;
import
org.dinky.data.model.JobInstance
;
import
org.dinky.gateway.Gateway
;
...
...
@@ -170,13 +170,13 @@ public class JobRefeshHandler {
*/
private
static
JobStatus
getJobStatus
(
JobInfoDetail
jobInfoDetail
)
{
ClusterConfiguration
clusterCfg
=
jobInfoDetail
.
getClusterConfiguration
();
ClusterConfiguration
DTO
clusterCfg
=
jobInfoDetail
.
getClusterConfiguration
();
if
(!
Asserts
.
isNull
(
clusterCfg
))
{
try
{
String
appId
=
jobInfoDetail
.
getCluster
().
getName
();
GatewayConfig
gatewayConfig
=
GatewayConfig
.
build
(
clusterCfg
.
get
FlinkClusterCf
g
());
GatewayConfig
gatewayConfig
=
GatewayConfig
.
build
(
clusterCfg
.
get
Confi
g
());
gatewayConfig
.
getClusterConfig
().
setAppId
(
appId
);
gatewayConfig
.
getFlinkConfig
()
...
...
dinky-admin/src/main/java/org/dinky/service/ClusterConfigurationService.java
View file @
22be7cf2
...
...
@@ -19,6 +19,7 @@
package
org
.
dinky
.
service
;
import
org.dinky.data.dto.ClusterConfigurationDTO
;
import
org.dinky.data.model.ClusterConfiguration
;
import
org.dinky.gateway.model.FlinkClusterConfig
;
import
org.dinky.gateway.result.TestResult
;
...
...
@@ -39,7 +40,7 @@ public interface ClusterConfigurationService extends ISuperService<ClusterConfig
FlinkClusterConfig
getFlinkClusterCfg
(
Integer
id
);
TestResult
testGateway
(
ClusterConfiguration
clusterConfiguration
);
TestResult
testGateway
(
ClusterConfiguration
DTO
clusterConfiguration
);
Boolean
modifyClusterConfigStatus
(
Integer
id
);
}
dinky-admin/src/main/java/org/dinky/service/impl/ClusterConfigurationServiceImpl.java
View file @
22be7cf2
...
...
@@ -19,8 +19,10 @@
package
org
.
dinky
.
service
.
impl
;
import
org.dinky.data.dto.ClusterConfigurationDTO
;
import
org.dinky.data.model.ClusterConfiguration
;
import
org.dinky.gateway.config.GatewayConfig
;
import
org.dinky.gateway.enums.GatewayType
;
import
org.dinky.gateway.model.FlinkClusterConfig
;
import
org.dinky.gateway.result.TestResult
;
import
org.dinky.job.JobManager
;
...
...
@@ -61,16 +63,15 @@ public class ClusterConfigurationServiceImpl extends SuperServiceImpl<ClusterCon
@Override
public
FlinkClusterConfig
getFlinkClusterCfg
(
Integer
id
)
{
ClusterConfiguration
c
lusterConfiguration
=
this
.
getClusterConfigById
(
id
);
Assert
.
notNull
(
c
lusterConfiguration
,
"The clusterConfiguration not exists!"
);
return
clusterConfiguration
.
getFlinkClusterCfg
(
);
ClusterConfiguration
c
fg
=
this
.
getClusterConfigById
(
id
);
Assert
.
notNull
(
c
fg
,
"The clusterConfiguration not exists!"
);
return
FlinkClusterConfig
.
create
(
cfg
.
getType
(),
cfg
.
getConfigJson
()
);
}
@Override
public
TestResult
testGateway
(
ClusterConfiguration
clusterConfiguration
)
{
FlinkClusterConfig
config
=
clusterConfiguration
.
getFlinkClusterCfg
();
GatewayConfig
gatewayConfig
=
GatewayConfig
.
build
(
config
);
return
JobManager
.
testGateway
(
gatewayConfig
);
public
TestResult
testGateway
(
ClusterConfigurationDTO
config
)
{
config
.
getConfig
().
setType
(
GatewayType
.
get
(
config
.
getType
()));
return
JobManager
.
testGateway
(
GatewayConfig
.
build
(
config
.
getConfig
()));
}
/**
...
...
dinky-admin/src/main/java/org/dinky/service/impl/ClusterInstanceServiceImpl.java
View file @
22be7cf2
...
...
@@ -174,17 +174,18 @@ public class ClusterInstanceServiceImpl extends SuperServiceImpl<ClusterInstance
@Override
public
Cluster
deploySessionCluster
(
Integer
id
)
{
ClusterConfiguration
clusterC
onfiguration
=
clusterConfigurationService
.
getClusterConfigById
(
id
);
if
(
Asserts
.
isNull
(
clusterC
onfiguration
))
{
ClusterConfiguration
clusterC
fg
=
clusterConfigurationService
.
getClusterConfigById
(
id
);
if
(
Asserts
.
isNull
(
clusterC
fg
))
{
throw
new
GatewayException
(
"The cluster configuration does not exist."
);
}
GatewayConfig
gatewayConfig
=
GatewayConfig
.
build
(
clusterConfiguration
.
getFlinkClusterCfg
());
GatewayConfig
gatewayConfig
=
GatewayConfig
.
build
(
FlinkClusterConfig
.
create
(
clusterCfg
.
getType
(),
clusterCfg
.
getConfigJson
()));
GatewayResult
gatewayResult
=
JobManager
.
deploySessionCluster
(
gatewayConfig
);
return
registersCluster
(
Cluster
.
autoRegistersCluster
(
gatewayResult
.
getWebURL
().
replace
(
"http://"
,
""
),
gatewayResult
.
getId
(),
clusterC
onfiguration
.
getName
()
+
"_"
+
LocalDateTime
.
now
(),
clusterC
onfiguration
.
getName
()
+
LocalDateTime
.
now
(),
clusterC
fg
.
getName
()
+
"_"
+
LocalDateTime
.
now
(),
clusterC
fg
.
getName
()
+
LocalDateTime
.
now
(),
id
,
null
));
}
...
...
dinky-admin/src/main/java/org/dinky/service/impl/JobInstanceServiceImpl.java
View file @
22be7cf2
...
...
@@ -23,6 +23,7 @@ import org.dinky.assertion.Asserts;
import
org.dinky.context.TenantContextHolder
;
import
org.dinky.daemon.task.DaemonFactory
;
import
org.dinky.daemon.task.DaemonTaskConfig
;
import
org.dinky.data.dto.ClusterConfigurationDTO
;
import
org.dinky.data.dto.JobDataDto
;
import
org.dinky.data.enums.JobStatus
;
import
org.dinky.data.enums.Status
;
...
...
@@ -162,9 +163,9 @@ public class JobInstanceServiceImpl extends SuperServiceImpl<JobInstanceMapper,
history
.
setConfig
(
JSONUtil
.
parseObject
(
history
.
getConfigJson
()));
jobInfoDetail
.
setHistory
(
history
);
if
(
Asserts
.
isNotNull
(
history
.
getClusterConfigurationId
()))
{
ClusterConfiguration
clusterConfig
ById
=
ClusterConfiguration
clusterConfig
=
clusterConfigurationService
.
getClusterConfigById
(
history
.
getClusterConfigurationId
());
jobInfoDetail
.
setClusterConfiguration
(
clusterConfigById
);
jobInfoDetail
.
setClusterConfiguration
(
ClusterConfigurationDTO
.
fromBean
(
clusterConfig
)
);
}
JobDataDto
jobDataDto
=
jobHistoryService
.
getJobHistoryDto
(
jobInstance
.
getId
());
...
...
dinky-admin/src/main/java/org/dinky/service/impl/TaskServiceImpl.java
View file @
22be7cf2
...
...
@@ -22,7 +22,6 @@ package org.dinky.service.impl;
import
org.dinky.assertion.Assert
;
import
org.dinky.assertion.Asserts
;
import
org.dinky.config.Dialect
;
import
org.dinky.config.Docker
;
import
org.dinky.context.RowLevelPermissionsContext
;
import
org.dinky.context.TenantContextHolder
;
import
org.dinky.data.constant.CommonConstant
;
...
...
@@ -95,7 +94,6 @@ import org.dinky.service.TaskService;
import
org.dinky.service.TaskVersionService
;
import
org.dinky.service.UDFTemplateService
;
import
org.dinky.service.UserService
;
import
org.dinky.utils.DockerClientUtils
;
import
org.dinky.utils.FragmentVariableUtils
;
import
org.dinky.utils.UDFUtils
;
...
...
@@ -246,31 +244,31 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
}
private
void
loadDocker
(
Integer
taskId
,
Integer
clusterConfigurationId
,
GatewayConfig
gatewayConfig
)
{
Map
<
String
,
Object
>
dockerConfig
=
clusterCfgService
.
getClusterConfigById
(
clusterConfigurationId
)
.
getFlinkClusterCfg
()
.
getKubernetesConfig
()
.
getDockerConfig
();
if
(
dockerConfig
==
null
)
{
return
;
}
String
[]
params
=
buildParas
(
taskId
,
dockerConfig
.
getOrDefault
(
"dinky.remote.addr"
,
""
).
toString
());
gatewayConfig
.
getAppConfig
().
setUserJarParas
(
params
);
Docker
docker
=
Docker
.
build
(
dockerConfig
);
if
(
docker
==
null
||
StringUtils
.
isBlank
(
docker
.
getInstance
()))
{
return
;
}
DockerClientUtils
dockerClientUtils
=
new
DockerClientUtils
(
docker
);
String
tag
=
dockerClientUtils
.
getDocker
().
getTag
();
if
(
StrUtil
.
isNotBlank
(
tag
))
{
gatewayConfig
.
getFlinkConfig
().
getConfiguration
().
put
(
"kubernetes.container.image"
,
tag
);
}
//
Map<String, Object> dockerConfig = clusterCfgService
//
.getClusterConfigById(clusterConfigurationId)
//
.getFlinkClusterCfg()
//
.getKubernetesConfig()
//
.getDockerConfig();
//
//
if (dockerConfig == null) {
//
return;
//
}
//
//
String[] params = buildParas(
//
taskId, dockerConfig.getOrDefault("dinky.remote.addr", "").toString());
//
//
gatewayConfig.getAppConfig().setUserJarParas(params);
//
//
Docker docker = Docker.build(dockerConfig);
//
if (docker == null || StringUtils.isBlank(docker.getInstance())) {
//
return;
//
}
//
//
DockerClientUtils dockerClientUtils = new DockerClientUtils(docker);
//
String tag = dockerClientUtils.getDocker().getTag();
//
if (StrUtil.isNotBlank(tag)) {
//
gatewayConfig.getFlinkConfig().getConfiguration().put("kubernetes.container.image", tag);
//
}
}
@Override
...
...
dinky-gateway/src/main/java/org/dinky/gateway/model/FlinkClusterConfig.java
View file @
22be7cf2
...
...
@@ -24,6 +24,9 @@ import org.dinky.gateway.config.ClusterConfig;
import
org.dinky.gateway.config.FlinkConfig
;
import
org.dinky.gateway.config.K8sConfig
;
import
org.dinky.gateway.enums.GatewayType
;
import
org.dinky.utils.JSONUtil
;
import
java.util.Optional
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -66,4 +69,10 @@ public class FlinkClusterConfig {
dataType
=
"K8sConfig"
,
notes
=
"Configuration settings for Kubernetes (if applicable)"
)
private
K8sConfig
kubernetesConfig
;
public
static
FlinkClusterConfig
create
(
String
type
,
String
json
)
{
FlinkClusterConfig
flinkClusterConfig
=
JSONUtil
.
parseObject
(
json
,
FlinkClusterConfig
.
class
);
Optional
.
ofNullable
(
flinkClusterConfig
).
ifPresent
(
config
->
config
.
setType
(
GatewayType
.
get
(
type
)));
return
flinkClusterConfig
;
}
}
dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationList/index.tsx
View file @
22be7cf2
...
...
@@ -145,7 +145,6 @@ export default () => {
*/
const
handleSubmit
=
async
(
value
:
Partial
<
Cluster
.
Config
>
)
=>
{
await
executeAndCallbackRefresh
(
async
()
=>
{
value
.
configJson
=
JSON
.
stringify
(
value
.
configJson
);
await
handleAddOrUpdate
(
API_CONSTANTS
.
CLUSTER_CONFIGURATION
,
value
);
await
handleCancel
();
});
...
...
@@ -175,7 +174,7 @@ export default () => {
setClusterConfigState
((
prevState
)
=>
({
...
prevState
,
editOpen
:
true
,
value
:
{
...
item
,
configJson
:
JSON
.
stringify
(
item
?.
configJson
??
{})
}
value
:
{
...
item
}
}));
};
...
...
dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal/ConfigurationForm/ApplicationConfig/index.tsx
View file @
22be7cf2
...
...
@@ -28,7 +28,7 @@ const ApplicationConfig = () => {
<
ProFormGroup
labelLayout=
{
'inline'
}
>
<
ProFormText
width=
{
'xl'
}
name=
{
[
'config
Json
'
,
'appConfig'
,
'userJarPath'
]
}
name=
{
[
'config'
,
'appConfig'
,
'userJarPath'
]
}
placeholder=
{
l
(
'rc.cc.sqlSubmitJarPathHelp'
)
}
label=
{
l
(
'rc.cc.sqlSubmitJarPath'
)
}
tooltip=
{
l
(
'rc.cc.sqlSubmitJarPathHelp'
)
}
...
...
dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal/ConfigurationForm/FlinkK8s/index.tsx
View file @
22be7cf2
...
...
@@ -55,7 +55,7 @@ const FlinkK8s = (props: { type: string; value: any } & connect) => {
<
ProFormText
tooltip=
{
item
.
tooltip
}
key=
{
item
.
name
}
name=
{
[
'config
Json
'
,
'kubernetesConfig'
,
'configuration'
,
item
.
name
]
}
name=
{
[
'config'
,
'kubernetesConfig'
,
'configuration'
,
item
.
name
]
}
label=
{
item
.
label
}
width=
{
260
}
placeholder=
{
item
.
placeholder
}
...
...
@@ -70,10 +70,10 @@ const FlinkK8s = (props: { type: string; value: any } & connect) => {
key
:
'defaultPodTemplate'
,
label
:
<
TagAlignCenter
>
Default Pod Template
</
TagAlignCenter
>,
children
:
(
<
ProFormItem
key=
'dpe'
name=
{
[
'config
Json
'
,
'kubernetesConfig'
,
'podTemplate'
]
}
>
<
ProFormItem
key=
'dpe'
name=
{
[
'config'
,
'kubernetesConfig'
,
'podTemplate'
]
}
>
<
CodeEdit
{
...
CodeEditProps
}
code=
{
value
.
config
Json
?.
kubernetesConfig
?.
podTemplate
??
''
}
code=
{
value
.
config
?.
kubernetesConfig
?.
podTemplate
??
''
}
/>
</
ProFormItem
>
)
...
...
@@ -82,10 +82,10 @@ const FlinkK8s = (props: { type: string; value: any } & connect) => {
key
:
'JMPodTemplate'
,
label
:
<
TagAlignCenter
>
JM Pod Template
</
TagAlignCenter
>,
children
:
(
<
ProFormItem
key=
'jmdpe'
name=
{
[
'config
Json
'
,
'kubernetesConfig'
,
'jmPodTemplate'
]
}
>
<
ProFormItem
key=
'jmdpe'
name=
{
[
'config'
,
'kubernetesConfig'
,
'jmPodTemplate'
]
}
>
<
CodeEdit
{
...
CodeEditProps
}
code=
{
value
.
config
Json
?.
kubernetesConfig
?.
jmPodTemplate
??
''
}
code=
{
value
.
config
?.
kubernetesConfig
?.
jmPodTemplate
??
''
}
/>
</
ProFormItem
>
)
...
...
@@ -94,10 +94,10 @@ const FlinkK8s = (props: { type: string; value: any } & connect) => {
key
:
'TMPodTemplate'
,
label
:
<
TagAlignCenter
>
TM Pod Template
</
TagAlignCenter
>,
children
:
(
<
ProFormItem
key=
'tmdpe'
name=
{
[
'config
Json
'
,
'kubernetesConfig'
,
'tmPodTemplate'
]
}
>
<
ProFormItem
key=
'tmdpe'
name=
{
[
'config'
,
'kubernetesConfig'
,
'tmPodTemplate'
]
}
>
<
CodeEdit
{
...
CodeEditProps
}
code=
{
value
.
config
Json
?.
kubernetesConfig
?.
tmPodTemplate
??
''
}
code=
{
value
.
config
?.
kubernetesConfig
?.
tmPodTemplate
??
''
}
/>
</
ProFormItem
>
)
...
...
@@ -113,7 +113,7 @@ const FlinkK8s = (props: { type: string; value: any } & connect) => {
{
type
&&
type
===
ClusterType
.
KUBERNETES_NATIVE
&&
(
<
ProFormSelect
name=
{
[
'config
Json
'
,
'config'
,
'kubernetesConfig'
,
'configuration'
,
'kubernetes.rest-service.exposed.type'
...
...
@@ -127,7 +127,7 @@ const FlinkK8s = (props: { type: string; value: any } & connect) => {
)
}
{
type
&&
type
===
ClusterType
.
KUBERNETES_OPERATOR
&&
(
<
ProFormSelect
name=
{
[
'config
Json
'
,
'flinkConfig'
,
'flinkVersion'
]
}
name=
{
[
'config'
,
'flinkConfig'
,
'flinkVersion'
]
}
label=
{
l
(
'rc.cc.k8sOp.version'
)
}
width=
{
250
}
placeholder=
{
l
(
'rc.cc.k8sOp.versionHelp'
)
}
...
...
@@ -137,7 +137,7 @@ const FlinkK8s = (props: { type: string; value: any } & connect) => {
{
renderK8sConfig
()
}
</
ProFormGroup
>
<
ProFormList
name=
{
[
'config
Json
'
,
'flinkConfig'
,
'flinkConfigList'
]
}
name=
{
[
'config'
,
'flinkConfig'
,
'flinkConfigList'
]
}
copyIconProps=
{
false
}
deleteIconProps=
{
{
tooltipText
:
l
(
'rc.cc.deleteConfig'
)
}
}
creatorButtonProps=
{
{
...
...
dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal/ConfigurationForm/HighPriorityConfig/index.tsx
View file @
22be7cf2
...
...
@@ -27,7 +27,7 @@ const HighPriorityConfig = () => {
return
FLINK_CONFIG_LIST
.
map
((
item
)
=>
(
<>
<
ProFormText
name=
{
[
'config
Json
'
,
'flinkConfig'
,
'configuration'
,
item
.
name
]
}
name=
{
[
'config'
,
'flinkConfig'
,
'configuration'
,
item
.
name
]
}
label=
{
item
.
label
}
width=
{
400
}
placeholder=
{
item
.
placeholder
}
...
...
@@ -43,7 +43,7 @@ const HighPriorityConfig = () => {
<
ProFormGroup
direction=
{
'horizontal'
}
align=
{
'baseline'
}
>
{
renderHighPriorityConfig
()
}
<
ProFormText
name=
{
[
'config
Json
'
,
'clusterConfig'
,
'flinkConfigPath'
]
}
name=
{
[
'config'
,
'clusterConfig'
,
'flinkConfigPath'
]
}
label=
{
'Flink Conf Yaml Path'
}
width=
{
400
}
/>
...
...
dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal/ConfigurationForm/YarnConfig/index.tsx
View file @
22be7cf2
...
...
@@ -39,7 +39,7 @@ const YarnConfig = (props: { flinkConfigOptions: DefaultOptionType[] }) => {
<
Divider
>
{
l
(
'rc.cc.hadoopConfig'
)
}
</
Divider
>
<
ProFormGroup
>
<
ProFormText
name=
{
[
'config
Json
'
,
'hadoopConfigPath'
]
}
name=
{
[
'config'
,
'hadoopConfigPath'
]
}
label=
{
l
(
'rc.cc.hadoopConfigPath'
)
}
width=
'md'
rules=
{
[
...
...
@@ -54,7 +54,7 @@ const YarnConfig = (props: { flinkConfigOptions: DefaultOptionType[] }) => {
</
ProFormGroup
>
<
Divider
>
{
l
(
'rc.cc.hadoop.defineConfig'
)
}
</
Divider
>
<
ProFormList
name=
{
[
'config
Json
'
,
'hadoopConfigList'
]
}
name=
{
[
'config'
,
'hadoopConfigList'
]
}
copyIconProps=
{
false
}
deleteIconProps=
{
{
tooltipText
:
l
(
'rc.cc.deleteConfig'
)
...
...
@@ -79,7 +79,7 @@ const YarnConfig = (props: { flinkConfigOptions: DefaultOptionType[] }) => {
<
Divider
>
{
l
(
'rc.cc.flinkConfig'
)
}
</
Divider
>
<
ProFormGroup
>
<
ProFormText
name=
{
[
'config
Json
'
,
'flinkLibPath'
]
}
name=
{
[
'config'
,
'flinkLibPath'
]
}
label=
{
l
(
'rc.cc.libPath'
)
}
width=
'md'
rules=
{
[{
required
:
true
,
message
:
l
(
'rc.cc.libPathPlaceholder'
)
}]
}
...
...
@@ -88,7 +88,7 @@ const YarnConfig = (props: { flinkConfigOptions: DefaultOptionType[] }) => {
/>
<
ProFormText
name=
{
[
'config
Json
'
,
'flinkConfigPath'
]
}
name=
{
[
'config'
,
'flinkConfigPath'
]
}
label=
{
l
(
'rc.cc.flinkConfigPath'
)
}
width=
'md'
rules=
{
[
...
...
@@ -104,7 +104,7 @@ const YarnConfig = (props: { flinkConfigOptions: DefaultOptionType[] }) => {
<
Divider
>
{
l
(
'rc.cc.flink.defineConfig'
)
}
</
Divider
>
<
ProFormList
name=
{
[
'config
Json
'
,
'flinkConfigList'
]
}
name=
{
[
'config'
,
'flinkConfigList'
]
}
copyIconProps=
{
false
}
deleteIconProps=
{
{
tooltipText
:
l
(
'rc.cc.deleteConfig'
)
...
...
dinky-web/src/types/RegCenter/data.d.ts
View file @
22be7cf2
...
...
@@ -85,7 +85,6 @@ declare namespace Cluster {
export
type
Config
=
BaseBeanColumns
&
{
type
:
string
;
config
?:
any
;
configJson
:
any
;
isAvailable
?:
boolean
;
note
:
string
;
};
...
...
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