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