Unverified Commit 1a6b2288 authored by zhu-mingye's avatar zhu-mingye Committed by GitHub

refactor: delete cluster config alias (#1603)

* refactor: delete cluster config alias * format code
parent c5c61b37
......@@ -25,7 +25,6 @@ import org.dinky.db.model.SuperEntity;
import java.util.HashMap;
import java.util.Map;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.core.JsonProcessingException;
......@@ -49,11 +48,7 @@ public class ClusterConfiguration extends SuperEntity {
private Integer tenantId;
@TableField(fill = FieldFill.INSERT)
private String alias;
private String type;
private String configJson;
private Boolean isAvailable;
......
......@@ -83,7 +83,7 @@ public class History implements Serializable {
private String statusText;
@TableField(exist = false)
private String clusterAlias;
private String clusterName;
@TableField(exist = false)
private String taskAlias;
......
......@@ -85,7 +85,7 @@ public class JobInstance implements Serializable {
private String type;
@TableField(exist = false)
private String clusterAlias;
private String clusterName;
@TableField(exist = false)
private String jobManagerAddress;
......
......@@ -6,7 +6,6 @@
<resultMap id="BaseResultMap" type="org.dinky.model.ClusterConfiguration">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="alias" property="alias" />
<result column="type" property="type" />
<result column="config_json" property="configJson" />
<result column="is_available" property="isAvailable" />
......@@ -18,7 +17,7 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, alias, type,config_json,is_available,note, enabled, create_time, update_time
id, name, type,config_json,is_available,note, enabled, create_time, update_time
</sql>
......@@ -32,9 +31,6 @@
<if test='param.name!=null and param.name!=""'>
and a.name like "%${param.name}%"
</if>
<if test='param.alias!=null and param.alias!=""'>
and a.alias like "%${param.alias}%"
</if>
<if test='param.createTime!=null and param.createTime!=""'>
and a.create_time <![CDATA[>=]]> str_to_date( #{param.createTime},'%Y-%m-%d %H:%i:%s')
</if>
......
......@@ -5,7 +5,7 @@
<select id="selectForProTable" resultType="org.dinky.model.History">
select
a.*,
(select b.alias FROM dinky_cluster b where b.id=a.cluster_id) as clusterAlias,
(select b.name FROM dinky_cluster b where b.id=a.cluster_id) as clusterName,
(select c.alias FROM dinky_task c where c.id=a.task_id) as taskAlias
from
dinky_history a
......
......@@ -13,7 +13,7 @@
select
a.*,
dh.type as type,
(select dc.alias FROM dinky_cluster dc where dc.id=a.cluster_id) as clusterAlias
(select dc.name FROM dinky_cluster dc where dc.id=a.cluster_id) as clusterName
from
dinky_job_instance a
<if test='!(param.isHistory!=null and param.isHistory==true)'>
......
......@@ -143,7 +143,6 @@ CREATE TABLE `dinky_cluster_configuration` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`tenant_id` int(11) NOT NULL DEFAULT 1 COMMENT 'tenant id',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'cluster configuration name',
`alias` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'cluster configuration alias',
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'cluster type',
`config_json` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'json of configuration',
`is_available` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'is available',
......
......@@ -73,3 +73,4 @@ ALTER TABLE dinky_schema_history RENAME INDEX `dlink_schema_history_s_idx` TO `s
ALTER TABLE dinky_cluster DROP COLUMN `alias`;
ALTER TABLE dinky_fragment DROP COLUMN `alias`;
ALTER TABLE dinky_database DROP COLUMN `alias`;
ALTER TABLE dinky_cluster_configuration DROP COLUMN `alias`;
\ No newline at end of file
......@@ -21,7 +21,7 @@
export type HistoryItem = {
id: number;
clusterId: number;
clusterAlias: string;
clusterName: string;
session: string;
jobId: string;
jobName: string;
......
......@@ -159,11 +159,11 @@ const StudioHistory = (props: any) => {
<MessageOutlined/> {row.session}
</Tag>
) : ''}
{row.clusterAlias ? (
<Tag color="green" key={row.clusterAlias}>
<ClusterOutlined/> {row.clusterAlias}
{row.clusterName ? (
<Tag color="green" key={row.clusterName}>
<ClusterOutlined/> {row.clusterName}
</Tag>
) : (<Tag color="green" key={row.clusterAlias}>
) : (<Tag color="green" key={row.clusterName}>
<ClusterOutlined/> {l('pages.devops.jobinfo.localenv')}
</Tag>)}
{row.type ? (
......@@ -275,7 +275,7 @@ const StudioHistory = (props: any) => {
/>
<Modal
width={'80%'}
visible={modalVisit}
open={modalVisit}
destroyOnClose
centered
footer={false}
......
......@@ -194,7 +194,7 @@ const StudioProcess = (props: any) => {
let itemList = [];
for (let item of cluster) {
let tag = (<><Tag
color={item.enabled ? "processing" : "error"}>{item.type}</Tag>{item.alias === "" ? item.name : item.alias}</>);
color={item.enabled ? "processing" : "error"}>{item.type}</Tag>{item.name}</>);
itemList.push(<Option value={item.id} label={tag}>
{tag}
</Option>)
......
......@@ -51,7 +51,7 @@ const StudioJarSetting = (props: any) => {
const itemList = [];
for (const item of clusterConfiguration) {
const tag = (<><Tag
color={item.enabled ? "processing" : "error"}>{item.type}</Tag>{item.alias === "" ? item.name : item.alias}</>);
color={item.enabled ? "processing" : "error"}>{item.type}</Tag>{item.name}</>);
itemList.push(<Option key={item.id} value={item.id} label={tag}>
{tag}
</Option>)
......
......@@ -49,7 +49,7 @@ const StudioKubernetesConfig = (props: any) => {
const getClusterConfigurationOptions = () => {
const itemList = [];
for (const item of clusterConfiguration) {
const tag = (<><Tag color={item.enabled ? "processing" : "error"}>{item.type}</Tag>{item.alias === "" ? item.name : item.alias}</>);
const tag = (<><Tag color={item.enabled ? "processing" : "error"}>{item.type}</Tag>{item.name}</>);
//opeartor mode can not have normal application config
if (current.task.type == 'kubernetes-application-operator' && item.type == 'FlinkKubernetesOperator'){
itemList.push(<Option key={item.id} value={item.id} label={tag}>{tag}</Option>)
......
......@@ -72,7 +72,7 @@ const StudioSetting = (props: any) => {
const itemList = [];
for (const item of clusterConfiguration) {
const tag = (<><Tag
color={item.enabled ? "processing" : "error"}>{item.type}</Tag>{item.alias === "" ? item.name : item.alias}</>);
color={item.enabled ? "processing" : "error"}>{item.type}</Tag>{item.name}</>);
itemList.push(<Option key={item.id} value={item.id} label={tag}>
{tag}
</Option>)
......
......@@ -516,7 +516,6 @@ export default {
'pages.rc.clusterConfigManagement': 'Cluster Config Management',
'pages.rc.clusterConfig.name': 'Cluster Config Name',
'pages.rc.clusterConfig.alias': 'Alias',
'pages.rc.clusterConfig.id': 'Cluster Config ID',
'pages.rc.clusterConfig.type': 'Type',
'pages.rc.clusterConfig.hadoopConfigPath': 'Hadoop Config file path',
......
......@@ -522,7 +522,6 @@ export default {
'pages.rc.clusterConfigManagement': '集群配置管理',
'pages.rc.clusterConfig.name': '集群配置名称',
'pages.rc.clusterConfig.alias': '别名',
'pages.rc.clusterConfig.id': '集群配置ID',
'pages.rc.clusterConfig.type': '类型',
'pages.rc.clusterConfig.hadoopConfigPath': 'Hadoop 配置文件路径',
......
......@@ -191,7 +191,7 @@ const JobInstanceTable = (props: any) => {
},
}, {
title: l('pages.rc.cluster.instanceName'),
dataIndex: "clusterAlias",
dataIndex: "clusterName",
sorter: true,
}, {
title: l('global.table.jobid'),
......
......@@ -29,7 +29,7 @@ export type JobInstanceTableListItem = {
taskId: number,
step: number,
clusterId: number,
clusterAlias: string,
clusterName: string,
type: string,
jobManagerAddress: string,
jid: string,
......
......@@ -52,7 +52,6 @@ const ClusterConfigurationForm: React.FC<ClusterConfigurationFormProps> = (props
const [formVals, setFormVals] = useState<Partial<ClusterConfigurationTableListItem>>({
id: props.values.id,
name: props.values.name,
alias: props.values.alias,
type: props.values.type ? props.values.type : "Yarn",
configJson: props.values.configJson,
note: props.values.note,
......@@ -105,7 +104,6 @@ const ClusterConfigurationForm: React.FC<ClusterConfigurationFormProps> = (props
const formValues = {
id: formVals.id,
name: fieldsValue.name,
alias: fieldsValue.alias,
type: fieldsValue.type,
note: fieldsValue.note,
enabled: fieldsValue.enabled,
......@@ -326,12 +324,6 @@ const ClusterConfigurationForm: React.FC<ClusterConfigurationFormProps> = (props
rules={[{required: true, message: l('pages.rc.clusterConfig.namePlaceholder')}]}>
<Input placeholder={l('pages.rc.clusterConfig.namePlaceholder')}/>
</Form.Item>
<Form.Item
name="alias"
label={l('pages.rc.clusterConfig.alias')}
>
<Input placeholder={l('pages.rc.clusterConfig.aliasPlaceholder')}/>
</Form.Item>
<Form.Item
name="note"
label={l('global.table.note')}
......@@ -354,7 +346,6 @@ const ClusterConfigurationForm: React.FC<ClusterConfigurationFormProps> = (props
const formValues = {
id: formVals.id,
name: fieldsValue.name,
alias: fieldsValue.alias,
type: fieldsValue.type,
note: fieldsValue.note,
enabled: fieldsValue.enabled,
......
......@@ -104,12 +104,6 @@ const ClusterConfigurationTableList: React.FC<{}> = (props: any) => {
hideInForm: true,
hideInSearch: true,
},
{
title: l('pages.rc.clusterConfig.alias'),
sorter: true,
dataIndex: 'alias',
hideInTable: false,
},
{
title: l('pages.rc.clusterConfig.type'),
sorter: true,
......
......@@ -60,7 +60,6 @@ export type ClusterTableListItem = {
export type ClusterConfigurationTableListItem = {
id: number,
name: string,
alias: string,
type: string,
config: any,
configJson: string,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment