Unverified Commit 9276709d authored by zhu-mingye's avatar zhu-mingye Committed by GitHub

refactor: delete task alias

2.rollback cluster instance alias
parent 1a8479e8
......@@ -155,10 +155,9 @@ public class CatalogueController {
return subcata;
}
private CatalogueTaskDTO getCatalogueTaskDTO(String alias, Integer parentId) {
private CatalogueTaskDTO getCatalogueTaskDTO(String name, Integer parentId) {
CatalogueTaskDTO catalogueTaskDTO = new CatalogueTaskDTO();
catalogueTaskDTO.setName(UUID.randomUUID().toString().substring(0, 6) + alias);
catalogueTaskDTO.setAlias(alias);
catalogueTaskDTO.setName(UUID.randomUUID().toString().substring(0, 6) + name);
catalogueTaskDTO.setId(null);
catalogueTaskDTO.setParentId(parentId);
catalogueTaskDTO.setLeaf(true);
......@@ -221,11 +220,11 @@ public class CatalogueController {
/** 创建节点和作业 */
@PutMapping("/createTask")
public Result<Catalogue> createTask(@RequestBody CatalogueTaskDTO catalogueTaskDTO) {
Catalogue catalogue = catalogueService.createCatalogueAndTask(catalogueTaskDTO);
Catalogue catalogue = catalogueService.saveOrUpdateCatalogueAndTask(catalogueTaskDTO);
if (catalogue.getId() != null) {
return Result.succeed(catalogue, "创建成功");
return Result.succeed(catalogue, "保存成功");
} else {
return Result.failed("创建失败");
return Result.failed("保存失败");
}
}
......
......@@ -73,9 +73,9 @@ public class TaskController {
@PutMapping
public Result<Void> saveOrUpdate(@RequestBody Task task) throws Exception {
if (taskService.saveOrUpdateTask(task)) {
return Result.succeed("操作成功");
return Result.succeed("保存成功");
} else {
return Result.failed("操作失败");
return Result.failed("保存失败");
}
}
......
......@@ -70,7 +70,6 @@ public class TaskVersionController {
versionHistoryDTO.setId(t.getId());
versionHistoryDTO.setTaskId(t.getTaskId());
versionHistoryDTO.setName(t.getName());
versionHistoryDTO.setAlias(t.getAlias());
versionHistoryDTO.setDialect(t.getDialect());
versionHistoryDTO.setType(t.getType());
versionHistoryDTO.setStatement(t.getStatement());
......
......@@ -28,7 +28,7 @@ import java.time.LocalDateTime;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
/**
* DateMetaObjectHandler
* DateMeta Object Handler
*
* @author wenmo
* @since 2021/5/25
......@@ -57,7 +57,6 @@ public class DateMetaObjectHandler implements MetaObjectHandler {
getFieldValByName(mybatisPlusFillProperties.getCreateTimeField(), metaObject);
Object updateTime =
getFieldValByName(mybatisPlusFillProperties.getUpdateTimeField(), metaObject);
Object alias = getFieldValByName(mybatisPlusFillProperties.getAlias(), metaObject);
Object name = getFieldValByName(mybatisPlusFillProperties.getName(), metaObject);
if (createTime == null) {
setFieldValByName(
......@@ -71,9 +70,6 @@ public class DateMetaObjectHandler implements MetaObjectHandler {
LocalDateTime.now(),
metaObject);
}
if (alias == null) {
setFieldValByName(mybatisPlusFillProperties.getAlias(), name, metaObject);
}
}
@Override
......
......@@ -46,6 +46,4 @@ public class MybatisPlusFillProperties {
private String updateTimeField = "updateTime";
private String name = "name";
private String alias = "alias";
}
......@@ -19,8 +19,6 @@
package org.dinky.dto;
import org.dinky.config.Dialect;
import java.util.HashMap;
import java.util.Map;
......@@ -40,9 +38,10 @@ public class CatalogueTaskDTO {
private Integer id;
private Integer tenantId;
private Integer parentId;
private Integer taskId;
private boolean isLeaf;
private String name;
private String alias;
private String dialect = Dialect.DEFAULT.getValue();
private String type;
private String dialect;
private Map<String, String> config = new HashMap<>();
}
......@@ -34,7 +34,6 @@ public class TaskVersionHistoryDTO implements Serializable {
private Integer id;
private Integer taskId;
private String name;
private String alias;
private String dialect;
private String type;
private String statement;
......
......@@ -139,11 +139,8 @@ public class Job2MysqlHandler implements JobHandler {
clusterService.registersCluster(
Cluster.autoRegistersCluster(
job.getJobManagerAddress(),
job.getJobId()
+ "_"
+ job.getJobConfig().getJobName()
+ "_"
+ LocalDateTime.now(),
job.getJobId(),
job.getJobConfig().getJobName() + "_" + LocalDateTime.now(),
job.getType().getLongValue(),
clusterConfigurationId,
taskId));
......@@ -156,11 +153,8 @@ public class Job2MysqlHandler implements JobHandler {
clusterService.registersCluster(
Cluster.autoRegistersCluster(
job.getJobManagerAddress(),
job.getJobId()
+ "_"
+ job.getJobConfig().getJobName()
+ "_"
+ LocalDateTime.now(),
job.getJobId(),
job.getJobConfig().getJobName() + "_" + LocalDateTime.now(),
job.getType().getLongValue(),
null,
taskId));
......
......@@ -21,6 +21,8 @@ package org.dinky.model;
import org.dinky.db.model.SuperEntity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
......@@ -41,6 +43,9 @@ public class Cluster extends SuperEntity {
private Integer tenantId;
@TableField(fill = FieldFill.INSERT)
private String alias;
private String type;
private String hosts;
......@@ -62,11 +67,13 @@ public class Cluster extends SuperEntity {
public static Cluster autoRegistersCluster(
String hosts,
String name,
String alias,
String type,
Integer clusterConfigurationId,
Integer taskId) {
Cluster cluster = new Cluster();
cluster.setName(name);
cluster.setAlias(alias);
cluster.setHosts(hosts);
cluster.setType(type);
cluster.setClusterConfigurationId(clusterConfigurationId);
......
......@@ -53,7 +53,6 @@ public class History implements Serializable {
private String session;
private String jobId;
private String jobName;
private String jobManagerAddress;
......@@ -85,9 +84,6 @@ public class History implements Serializable {
@TableField(exist = false)
private String clusterName;
@TableField(exist = false)
private String taskAlias;
public JobInstance buildJobInstance() {
JobInstance jobInstance = new JobInstance();
jobInstance.setHistoryId(id);
......
......@@ -21,8 +21,6 @@ package org.dinky.model;
import org.dinky.db.model.SuperEntity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
......@@ -41,9 +39,6 @@ public class Jar extends SuperEntity {
private static final long serialVersionUID = 3769276772487490408L;
@TableField(fill = FieldFill.INSERT)
private String alias;
private Integer tenantId;
private String type;
......
......@@ -28,7 +28,6 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.core.JsonProcessingException;
......@@ -53,10 +52,6 @@ import lombok.extern.slf4j.Slf4j;
public class Task extends SuperEntity<Task> {
private static final long serialVersionUID = 5988972129893667154L;
@TableField(fill = FieldFill.INSERT)
private String alias;
private String dialect;
private Integer tenantId;
......@@ -169,7 +164,7 @@ public class Task extends SuperEntity<Task> {
clusterConfigurationId,
jid,
getId(),
alias,
getName(),
fg,
sts,
batchModel,
......@@ -183,7 +178,6 @@ public class Task extends SuperEntity<Task> {
public JsonNode parseJsonNode(ObjectMapper mapper) {
ObjectNode jsonNode = mapper.createObjectNode();
jsonNode.put("name", this.getName());
jsonNode.put("alias", this.alias);
jsonNode.put("dialect", this.dialect);
jsonNode.put("type", this.type);
jsonNode.put("statement", this.statement);
......
......@@ -67,10 +67,6 @@ public class TaskVersion implements Serializable {
@TableField(value = "`name`")
private String name;
/** 别名 */
@TableField(value = "`alias`")
private String alias;
/** 方言 */
@TableField(value = "dialect")
private String dialect;
......
......@@ -37,7 +37,7 @@ public interface CatalogueService extends ISuperService<Catalogue> {
Catalogue findByParentIdAndName(Integer parentId, String name);
Catalogue createCatalogueAndTask(CatalogueTaskDTO catalogueTaskDTO);
Catalogue saveOrUpdateCatalogueAndTask(CatalogueTaskDTO catalogueTaskDTO);
Catalogue createCatalogAndFileTask(CatalogueTaskDTO catalogueTaskDTO, String ment);
......
......@@ -83,21 +83,28 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
@Transactional(rollbackFor = Exception.class)
@Override
public Catalogue createCatalogueAndTask(CatalogueTaskDTO catalogueTaskDTO) {
Task task = new Task();
public Catalogue saveOrUpdateCatalogueAndTask(CatalogueTaskDTO catalogueTaskDTO) {
Task task = null;
Catalogue catalogue = null;
if (catalogueTaskDTO.getId() == null) {
task = new Task();
catalogue = new Catalogue();
} else {
catalogue = baseMapper.selectById(catalogueTaskDTO.getId());
task = taskService.getById(catalogue.getTaskId());
}
task.setName(catalogueTaskDTO.getName());
task.setAlias(catalogueTaskDTO.getAlias());
task.setDialect(catalogueTaskDTO.getDialect());
task.setConfig(Collections.singletonList(catalogueTaskDTO.getConfig()));
taskService.saveOrUpdateTask(task);
Catalogue catalogue = new Catalogue();
catalogue.setTenantId(catalogueTaskDTO.getTenantId());
catalogue.setName(catalogueTaskDTO.getAlias());
catalogue.setName(catalogueTaskDTO.getName());
catalogue.setIsLeaf(true);
catalogue.setTaskId(task.getId());
catalogue.setType(catalogueTaskDTO.getDialect());
catalogue.setParentId(catalogueTaskDTO.getParentId());
this.save(catalogue);
this.saveOrUpdate(catalogue);
return catalogue;
}
......@@ -105,13 +112,12 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
public Catalogue createCatalogAndFileTask(CatalogueTaskDTO catalogueTaskDTO, String ment) {
Task task = new Task();
task.setName(catalogueTaskDTO.getName());
task.setAlias(catalogueTaskDTO.getAlias());
task.setDialect(catalogueTaskDTO.getDialect());
task.setStatement(ment);
task.setEnabled(true);
taskService.saveOrUpdateTask(task);
Catalogue catalogue = new Catalogue();
catalogue.setName(catalogueTaskDTO.getAlias());
catalogue.setName(catalogueTaskDTO.getName());
catalogue.setIsLeaf(true);
catalogue.setTaskId(task.getId());
catalogue.setType(catalogueTaskDTO.getDialect());
......@@ -130,7 +136,6 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
Task task = new Task();
task.setId(oldCatalogue.getTaskId());
task.setName(catalogue.getName());
task.setAlias(catalogue.getName());
taskService.updateById(task);
this.updateById(catalogue);
return true;
......@@ -192,7 +197,7 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
.collect(Collectors.toList());
subDirCatalogue.forEach(
catalogue -> {
if (id != catalogue.getId()) {
if (!id.equals(catalogue.getId())) {
findAllCatalogueInDir(catalogue.getId(), all, del);
}
});
......@@ -249,7 +254,6 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
// 设置复制后的作业名称为:原名称+自增序列
size = size + 1;
newTask.setName(oldTask.getName() + "_" + size);
newTask.setAlias(oldTask.getAlias() + "_" + size);
newTask.setStep(JobLifeCycle.DEVELOP.getValue());
taskService.save(newTask);
......@@ -265,7 +269,7 @@ public class CatalogueServiceImpl extends SuperServiceImpl<CatalogueMapper, Cata
new LambdaQueryWrapper<Catalogue>()
.eq(Catalogue::getTaskId, catalogue.getTaskId()));
catalogue.setName(newTask.getAlias());
catalogue.setName(newTask.getName());
catalogue.setIsLeaf(one.getIsLeaf());
catalogue.setTaskId(newTask.getId());
catalogue.setType(one.getType());
......
......@@ -183,11 +183,8 @@ public class ClusterServiceImpl extends SuperServiceImpl<ClusterMapper, Cluster>
return registersCluster(
Cluster.autoRegistersCluster(
gatewayResult.getWebURL().replace("http://", ""),
gatewayResult.getAppId()
+ "_"
+ clusterConfiguration.getName()
+ "_"
+ LocalDateTime.now(),
gatewayResult.getAppId(),
clusterConfiguration.getName() + "_" + LocalDateTime.now(),
clusterConfiguration.getName() + LocalDateTime.now(),
id,
null));
......
......@@ -344,7 +344,7 @@ public class StudioServiceImpl implements StudioService {
sessionDTO.getType(),
true,
cluster.getId(),
cluster.getName(),
cluster.getAlias(),
clusterService.buildEnvironmentAddress(
true, sessionDTO.getClusterId()));
return JobManager.createSession(sessionDTO.getSession(), sessionConfig, createUser);
......
......@@ -408,7 +408,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
if (task.getClusterId() != null) {
Cluster cluster = clusterService.getById(task.getClusterId());
if (cluster != null) {
task.setClusterName(cluster.getName());
task.setClusterName(cluster.getAlias());
}
}
......@@ -519,7 +519,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
public Task initDefaultFlinkSQLEnv(Integer tenantId) {
String separator = SystemConfiguration.getInstances().getSqlSeparator();
separator = separator.replace("\\r", "\r").replace("\\n", "\n");
String name = "dinky_default_catalog";
String name = "DefaultCatalog";
Task defaultFlinkSQLEnvTask = getTaskByNameAndTenantId(name, tenantId);
if (null != defaultFlinkSQLEnvTask) {
......@@ -538,8 +538,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
username(), password(), url(), separator, separator);
defaultFlinkSQLEnvTask = new Task();
defaultFlinkSQLEnvTask.setName(name);
defaultFlinkSQLEnvTask.setAlias("DefaultCatalog");
defaultFlinkSQLEnvTask.setName("DefaultCatalog");
defaultFlinkSQLEnvTask.setDialect(Dialect.FLINK_SQL_ENV.getValue());
defaultFlinkSQLEnvTask.setStatement(sql);
defaultFlinkSQLEnvTask.setFragment(true);
......@@ -1288,7 +1287,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
tasks.add(task);
}
Catalogue catalogue =
new Catalogue(task.getAlias(), task.getId(), task.getDialect(), parentId, true);
new Catalogue(task.getName(), task.getId(), task.getDialect(), parentId, true);
catalogueService.saveOrUpdate(catalogue);
}
......@@ -1334,7 +1333,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
public String getTaskPathByTaskId(Integer taskId) {
StringBuilder path = new StringBuilder();
path.append(getById(taskId).getAlias());
path.append(getById(taskId).getName());
Catalogue catalogue =
catalogueService.getOne(new QueryWrapper<Catalogue>().eq("task_id", taskId));
if (Asserts.isNull(catalogue)) {
......@@ -1466,7 +1465,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TaskMapper, Task> implemen
alertInstance.getType(),
JSONUtil.toMap(alertInstance.getParams()));
Alert alert = Alert.build(alertConfig);
String title = "Task[" + task.getAlias() + "]: " + jobInstance.getStatus();
String title = "Task[" + task.getName() + "]: " + jobInstance.getStatus();
String content = alertMsg.toString();
AlertResult alertResult = alert.send(title, content);
......
......@@ -6,6 +6,7 @@
<resultMap id="BaseResultMap" type="org.dinky.model.Cluster">
<id column="id" property="id" />
<result column="name" property="name" />
<result column="alias" property="alias" />
<result column="type" property="type" />
<result column="hosts" property="hosts" />
<result column="job_manager_host" property="jobManagerHost" />
......@@ -22,7 +23,7 @@
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, type,hosts,job_manager_host,version, status,note,auto_registers,cluster_configuration_id,task_id, enabled, create_time, update_time
id, name, alias,type,hosts,job_manager_host,version, status,note,auto_registers,cluster_configuration_id,task_id, enabled, create_time, update_time
</sql>
......@@ -36,6 +37,9 @@
<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>
......
......@@ -6,7 +6,7 @@
select
a.*,
(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.name FROM dinky_task c where c.id=a.task_id) as jobName
from
dinky_history a
<where>
......
......@@ -12,9 +12,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.path!=null and param.path!=""'>
and a.path like "%${param.path}%"
</if>
......
......@@ -30,9 +30,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>
......
......@@ -83,7 +83,7 @@ public class Submitter {
if (id == null) {
throw new SQLException("请指定任务ID");
}
return "select id, name, alias as jobName, type,check_point as checkpoint,"
return "select id, name as jobName, type,check_point as checkPoint,"
+ "save_point_path as savePointPath, parallelism,fragment as useSqlFragment,statement_set as useStatementSet,config_json as config,"
+ " env_id as envId,batch_model AS useBatchModel from dinky_task where id = "
+ id;
......
......@@ -115,6 +115,7 @@ CREATE TABLE `dinky_cluster` (
`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 instance name',
`alias` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'cluster instance alias',
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'cluster types',
`hosts` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'cluster hosts',
`job_manager_host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Job Manager Host',
......@@ -492,7 +493,6 @@ CREATE TABLE `dinky_jar` (
`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 'jar name',
`alias` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'jar alias',
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'jar type',
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'file path',
`main_class` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'application of main class',
......@@ -690,7 +690,6 @@ CREATE TABLE `dinky_task` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'Job name',
`tenant_id` int(11) NOT NULL DEFAULT 1 COMMENT 'tenant id',
`alias` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Job alias',
`dialect` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'dialect',
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Job type',
`check_point` int(11) NULL DEFAULT NULL COMMENT 'CheckPoint trigger seconds',
......@@ -749,7 +748,6 @@ CREATE TABLE `dinky_task_version` (
`version_id` int(11) NOT NULL COMMENT 'version ID ',
`statement` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT 'flink sql statement',
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'version name',
`alias` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'alisa',
`dialect` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'dialect',
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'type',
`task_configure` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'task configuration',
......
......@@ -70,7 +70,11 @@ ALTER TABLE dinky_user_tenant RENAME INDEX `dlink_user_role_un` TO `user_tenant_
ALTER TABLE dinky_catalogue RENAME INDEX `dlink_catalogue_un` TO `catalogue_un_idx1`;
ALTER TABLE dinky_schema_history RENAME INDEX `dlink_schema_history_s_idx` TO `schema_history_idx`;
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
ALTER TABLE dinky_cluster_configuration DROP COLUMN `alias`;
ALTER TABLE dinky_task_version DROP COLUMN `alias`;
ALTER TABLE dinky_task DROP COLUMN `alias`;
ALTER TABLE dinky_jar DROP COLUMN `alias`;
......@@ -27,7 +27,7 @@ export type CodeShowFormProps = {
theme?: string;
options?: any;
code: string;
editorDidMountHandle: any;
editorDidMountHandle?: any;
};
const CodeShow = (props: CodeShowFormProps) => {
......
......@@ -37,5 +37,4 @@ export type HistoryItem = {
startTime: string;
endTime: string;
taskId: number;
taskAlias: string;
};
......@@ -74,7 +74,7 @@ const SessionForm: React.FC<UpdateFormProps> = (props) => {
</Option>)];
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>)
......
......@@ -57,7 +57,8 @@ import TaskAPI from "@/pages/API/TaskAPI";
import StudioHelp from "./StudioHelp";
import StudioGraph from "./StudioGraph";
import {
cancelTask, clearConsole,
cancelTask,
clearConsole,
developTask,
offLineTask,
onLineTask,
......@@ -177,7 +178,7 @@ const StudioMenu = (props: any) => {
const taskKey = (Math.random() * 1000) + '';
Modal.confirm({
title: l('pages.datastudio.editor.async.submit'),
content: l('pages.datastudio.editor.async.submitConfirm','',{jobName: current.task.alias}),
content: l('pages.datastudio.editor.async.submitConfirm','',{jobName: current.task.jobName}),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -185,7 +186,7 @@ const StudioMenu = (props: any) => {
id: current.task.id,
};
notification.success({
message: l('pages.datastudio.editor.async.submiting','',{jobName: current.task.alias}),
message: l('pages.datastudio.editor.async.submiting','',{jobName: current.task.jobName}),
description: current.task.statement,
duration: null,
key: taskKey,
......@@ -338,7 +339,7 @@ const StudioMenu = (props: any) => {
const toReleaseTask = () => {
Modal.confirm({
title: l('pages.datastudio.editor.release.job'),
content: l('pages.datastudio.editor.release.jobConfirm','',{jobName: current.task.alias}),
content: l('pages.datastudio.editor.release.jobConfirm','',{jobName: current.task.jobName}),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -346,9 +347,9 @@ const StudioMenu = (props: any) => {
res.then((result) => {
if (result.code == CODE.SUCCESS) {
props.changeTaskStep(current.task.id, JOB_LIFE_CYCLE.RELEASE);
message.success(l('pages.datastudio.editor.release.job.success','',{jobName: current.task.alias}))
message.success(l('pages.datastudio.editor.release.job.success','',{jobName: current.task.jobName}))
} else {
message.error(l('pages.datastudio.editor.release.job.error','',{jobName: current.task.alias}));
message.error(l('pages.datastudio.editor.release.job.error','',{jobName: current.task.jobName}));
}
});
}
......@@ -358,7 +359,7 @@ const StudioMenu = (props: any) => {
const toDevelopTask = () => {
Modal.confirm({
title: l('pages.datastudio.editor.edit.job'),
content: l('pages.datastudio.editor.edit.jobConfirm','',{jobName: current.task.alias}),
content: l('pages.datastudio.editor.edit.jobConfirm','',{jobName: current.task.jobName}),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -366,7 +367,7 @@ const StudioMenu = (props: any) => {
res.then((result) => {
result.datas && props.changeTaskStep(current.task.id, JOB_LIFE_CYCLE.DEVELOP);
if (result.code == CODE.SUCCESS) {
message.success(l('pages.datastudio.editor.edit.job.success','',{jobName: current.task.alias}))
message.success(l('pages.datastudio.editor.edit.job.success','',{jobName: current.task.jobName}))
}
});
}
......@@ -376,7 +377,7 @@ const StudioMenu = (props: any) => {
const toOnLineTask = () => {
Modal.confirm({
title: l('pages.datastudio.editor.online.job'),
content: l('pages.datastudio.editor.online.jobConfirm','',{jobName: current.task.alias}),
content: l('pages.datastudio.editor.online.jobConfirm','',{jobName: current.task.jobName}),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -385,9 +386,9 @@ const StudioMenu = (props: any) => {
if (result.code === CODE.SUCCESS) {
props.changeTaskStep(current.task.id, JOB_LIFE_CYCLE.ONLINE);
result.datas?.jobInstanceId && props.changeTaskJobInstance(current.task.id, result.datas?.jobInstanceId);
message.success(l('pages.datastudio.editor.online.job.success','',{jobName: current.task.alias}))
message.success(l('pages.datastudio.editor.online.job.success','',{jobName: current.task.jobName}))
} else {
message.error(l('pages.datastudio.editor.online.job.error','',{jobName: current.task.alias,msg: result.msg}));
message.error(l('pages.datastudio.editor.online.job.error','',{jobName: current.task.jobName,msg: result.msg}));
}
});
}
......@@ -397,7 +398,7 @@ const StudioMenu = (props: any) => {
const handleCancelTask = (type: string) => {
Modal.confirm({
title: l('pages.datastudio.editor.stop.job'),
content: l('pages.datastudio.editor.stop.jobConfirm','',{jobName: current.task.alias}),
content: l('pages.datastudio.editor.stop.jobConfirm','',{jobName: current.task.jobName}),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -408,9 +409,9 @@ const StudioMenu = (props: any) => {
props.changeTaskStep(current.task.id, JOB_LIFE_CYCLE.RELEASE);
}
props.changeTaskJobInstance(current.task.id, 0);
message.success(l('pages.datastudio.editor.stop.job.success','',{jobName: current.task.alias}))
message.success(l('pages.datastudio.editor.stop.job.success','',{jobName: current.task.jobName}))
} else {
message.error(l('pages.datastudio.editor.stop.job.error','',{jobName: current.task.alias,msg: result.msg}));
message.error(l('pages.datastudio.editor.stop.job.error','',{jobName: current.task.jobName,msg: result.msg}));
}
});
}
......@@ -420,7 +421,7 @@ const StudioMenu = (props: any) => {
const toOffLineTask = (type: string) => {
Modal.confirm({
title: l('pages.datastudio.editor.offline.job'),
content: l('pages.datastudio.editor.offline.jobConfirm','',{jobName: current.task.alias}),
content: l('pages.datastudio.editor.offline.jobConfirm','',{jobName: current.task.jobName}),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -429,9 +430,9 @@ const StudioMenu = (props: any) => {
if (result.code === CODE.SUCCESS) {
props.changeTaskStep(current.task.id, JOB_LIFE_CYCLE.RELEASE);
props.changeTaskJobInstance(current.task.id, 0);
message.success(l('pages.datastudio.editor.offline.job.success','',{jobName: current.task.alias}))
message.success(l('pages.datastudio.editor.offline.job.success','',{jobName: current.task.jobName}))
} else {
message.error(l('pages.datastudio.editor.offline.job.error','',{jobName: current.task.alias,msg: result.msg}));
message.error(l('pages.datastudio.editor.offline.job.error','',{jobName: current.task.jobName,msg: result.msg}));
}
});
}
......@@ -441,7 +442,7 @@ const StudioMenu = (props: any) => {
const toCancelTask = () => {
Modal.confirm({
title: l('pages.datastudio.editor.delete.job'),
content: l('pages.datastudio.editor.delete.jobConfirm','',{jobName: current.task.alias}),
content: l('pages.datastudio.editor.delete.jobConfirm','',{jobName: current.task.jobName}),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -449,9 +450,9 @@ const StudioMenu = (props: any) => {
res.then((result) => {
if (result.code === CODE.SUCCESS) {
props.changeTaskStep(current.task.id, JOB_LIFE_CYCLE.CANCEL);
message.success(l('pages.datastudio.editor.delete.job.success','',{jobName: current.task.alias}))
message.success(l('pages.datastudio.editor.delete.job.success','',{jobName: current.task.jobName}))
} else {
message.error(l('pages.datastudio.editor.delete.job.error','',{jobName: current.task.alias,msg: result.msg}));
message.error(l('pages.datastudio.editor.delete.job.error','',{jobName: current.task.jobName,msg: result.msg}));
}
});
}
......@@ -461,7 +462,7 @@ const StudioMenu = (props: any) => {
const toRecoveryTask = () => {
Modal.confirm({
title: l('pages.datastudio.editor.recovery.job'),
content: l('pages.datastudio.editor.recovery.jobConfirm','',{jobName: current.task.alias}),
content: l('pages.datastudio.editor.recovery.jobConfirm','',{jobName: current.task.jobName}),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......@@ -469,7 +470,7 @@ const StudioMenu = (props: any) => {
res.then((result) => {
result.datas && props.changeTaskStep(current.task.id, JOB_LIFE_CYCLE.DEVELOP);
if (result.code == CODE.SUCCESS) {
message.success(l('pages.datastudio.editor.recovery.job.success','',{jobName: current.task.alias}))
message.success(l('pages.datastudio.editor.recovery.job.success','',{jobName: current.task.jobName}))
}
});
}
......@@ -509,7 +510,7 @@ const StudioMenu = (props: any) => {
const showAPI = () => {
Modal.info({
title: current.task.alias + l('pages.datastudio.editor.api.doc'),
title: current.task.jobName + l('pages.datastudio.editor.api.doc'),
width: 1000,
content: (
<TaskAPI task={current.task}/>
......@@ -775,7 +776,7 @@ const StudioMenu = (props: any) => {
</Modal>
{current?.task ?
<ModalForm
title={`${current.task.alias} 的 ${current.task.dialect} 导出`}
title={`${current.task.jobName} 的 ${current.task.dialect} 导出`}
visible={exportModalVisible}
width={1000}
modalProps={{
......
......@@ -69,7 +69,7 @@ const StudioHistory = (props: any) => {
return (
<>
<Modal title={l('pages.datastudio.label.version.diff')} visible={versionDiffVisible} destroyOnClose={true} width={"85%"}
<Modal title={l('pages.datastudio.label.version.diff')} open={versionDiffVisible} destroyOnClose={true} width={"85%"}
bodyStyle={{height: "700px"}}
onCancel={() => {
cancelHandle();
......
......@@ -63,7 +63,7 @@ const StudioJarSetting = (props: any) => {
const itemList = [];
for (const item of jars) {
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>)
......
......@@ -86,7 +86,7 @@ const StudioSetting = (props: any) => {
</Option>];
for (const item of env) {
const tag = (<>{item.enabled ? <Badge status="success"/> : <Badge status="error"/>}
{item.fragment ? <PaperClipOutlined/> : undefined}{item.alias}</>);
{item.fragment ? <PaperClipOutlined/> : undefined}{item.name}</>);
itemList.push(<Option key={item.id} value={item.id} label={tag}>
{tag}
</Option>)
......
......@@ -71,7 +71,7 @@ const StudioTaskInfo = (props: any) => {
<Paragraph copyable>{current.task.id}</Paragraph>
</Descriptions.Item>
<Descriptions.Item label={l('pages.datastudio.label.jobInfo.name')}>
{current.task.alias}
{current.task.jobName}
</Descriptions.Item>
<Descriptions.Item label={l('pages.datastudio.label.jobInfo.dialect')}>
{current.task.dialect}
......
......@@ -28,6 +28,7 @@ export type DataType = {
};
export interface TreeDataNode extends DataNode {
name:string;
type?:string;
id:number;
taskId:number;
parentId:number;
......@@ -47,6 +48,7 @@ export function convertToTreeData(data:TreeDataNode[], pid:number,path?:string[]
obj.key = obj.id;
obj.path = path.slice();
obj.path.push(obj.name);
obj.type= obj.type
temp = convertToTreeData(data, data[i].id,obj.path);
if (temp.length > 0) {
obj.children = temp
......
......@@ -33,7 +33,7 @@ export type UpdateFormProps = {
onSubmit: (values: Partial<TaskTableListItem>) => void;
updateModalVisible: boolean;
isCreate: boolean;
dialect: string;
dialect?: string;
values: Partial<TaskTableListItem>;
};
......@@ -48,16 +48,15 @@ const isUDF = (dialect: string) => {
const SimpleTaskForm: React.FC<UpdateFormProps> = (props) => {
const [formVals, setFormVals] = useState<Partial<TaskTableListItem>>({
id: props.values.id,
name: props.values.name,
alias: props.values.alias,
dialect: DIALECT.FLINKSQL,
parentId: props.values.parentId,
config: props.values.config,
});
const [dialect, setDialect] = useState<string>('')
const [dialect, setDialect] = useState<string>(DIALECT.FLINKSQL)
const [isShowUDFClassName, setShowUDFClassName] = useState<boolean>(true)
const [templateTree, setTemplateTree] = useState<Object[]>([])
const [templateData, setTemplateData] = useState<Object[]>([])
......@@ -97,7 +96,7 @@ const SimpleTaskForm: React.FC<UpdateFormProps> = (props) => {
const handlerChangeUdf = (value: any[]) => {
if (value[1] == 0) {
setShowUDFClassName(false)
}else{
} else {
setShowUDFClassName(true)
}
}
......@@ -120,11 +119,14 @@ const SimpleTaskForm: React.FC<UpdateFormProps> = (props) => {
const renderContent = () => {
return (
<>
{isCreate ? (<Form.Item
<Form.Item
label="作业类型" name="dialect"
tooltip='指定作业类型,默认为 FlinkSql'
tooltip='指定作业类型,默认为 FlinkSql,创建后类型不可修改'
rules={[{required: true, message: '必选!'}]}
>
<Select defaultValue={DIALECT.FLINKSQL} value={DIALECT.FLINKSQL} onChange={handlerSetDialect}>
<Select disabled={!isCreate} defaultValue={DIALECT.FLINKSQL}
value={DIALECT.FLINKSQL}
onChange={handlerSetDialect}>
<Option value={DIALECT.FLINKSQL}>{DIALECT.FLINKSQL}</Option>
<Option value={DIALECT.KUBERNETES_APPLICATION}>{DIALECT.KUBERNETES_APPLICATION}</Option>
<Option value={DIALECT.FLINKJAR}>{DIALECT.FLINKJAR}</Option>
......@@ -144,23 +146,18 @@ const SimpleTaskForm: React.FC<UpdateFormProps> = (props) => {
<Option key={DIALECT.PYTHON} value={DIALECT.PYTHON}>{DIALECT.PYTHON}</Option>
<Option value={DIALECT.SQL}>{DIALECT.SQL}</Option>
</Select>
</Form.Item>) : undefined}
<Form.Item
name="name"
label="名称"
rules={[{required: true, message: '请输入唯一名称!'}]}>
<Input placeholder="请输入"/>
</Form.Item>
<Form.Item
name="alias"
label="别名"
rules={[{required: true, message: '请输入别名!'}]}>
<Input placeholder="请输入"/>
name="name"
label="作业名称"
tooltip={"此处为提交的任务的 Pipeline 名称"}
rules={[{required: true, message: '请输入任务的 Pipeline 名称!'}]}>
<Input placeholder="任务的 Pipeline 名称!"/>
</Form.Item>
{isUDF(dialect) ? (<>
<Form.Item
name="config.templateId"
label="udf 模板"
label="UDF 模板"
rules={[{required: true, message: '请选择udf模板!'}]}>
{<Cascader
displayRender={(label: string[]) => label.slice(0, 2).join(" / ")}
......@@ -196,7 +193,7 @@ const SimpleTaskForm: React.FC<UpdateFormProps> = (props) => {
bodyStyle={{padding: '32px 40px 48px'}}
destroyOnClose
title={isCreate ? '创建新作业' : ('重命名作业-' + formVals.name)}
visible={updateModalVisible}
open={updateModalVisible}
footer={renderFooter()}
onCancel={() => handleUpdateModalVisible()}
>
......@@ -206,7 +203,6 @@ const SimpleTaskForm: React.FC<UpdateFormProps> = (props) => {
initialValues={{
id: formVals.id,
name: formVals.name,
alias: formVals.alias,
dialect: formVals.dialect,
parentId: formVals.parentId,
}}
......
......@@ -94,7 +94,7 @@ const UpdateCatalogueForm: React.FC<UpdateFormProps> = (props) => {
bodyStyle={{padding: '32px 40px 48px'}}
destroyOnClose
title={isCreate ? '创建新目录' : ('重命名目录-' + formVals.name)}
visible={updateModalVisible}
open={updateModalVisible}
footer={renderFooter()}
onCancel={() => handleUpdateModalVisible()}
>
......
......@@ -59,7 +59,7 @@ const UploadModal: React.FC<UploadModalProps> = (props: any) => {
return (
<div>
<Modal title="上传文件"
visible={visible}
open={visible}
onOk={handleOk}
onCancel={onCancel}
maskClosable={false}
......
......@@ -22,6 +22,7 @@ export type CatalogueTableListItem = {
id: number,
taskId: number,
name: string,
type: string,
isLeaf: string,
parentId: number,
};
......@@ -29,7 +30,6 @@ export type CatalogueTableListItem = {
export type TaskTableListItem = {
id: number,
name: string,
alias: string,
dialect: string,
config: Object<string, object>,
parentId: number,
......
......@@ -344,7 +344,7 @@ export default {
'pages.datastudio.label.history.result': 'Preview Data',
'pages.datastudio.label.history.error': 'Exception Info',
'pages.datastudio.label.history.jobId': 'Job ID',
'pages.datastudio.label.history.jobName': 'job name',
'pages.datastudio.label.history.jobName': 'Job name',
'pages.datastudio.label.history.runningCluster': 'Running Cluster',
'pages.datastudio.label.history.session': 'Shared Session',
'pages.datastudio.label.history.taskType': 'Task Type',
......@@ -486,6 +486,8 @@ export default {
'pages.rc.clusterManagement': 'Cluster Instance Management',
'pages.rc.cluster.instanceName': 'Instance name',
'pages.rc.cluster.aliasPlaceholder': 'Please enter alias!',
'pages.rc.cluster.alias': 'Instance alias',
'pages.rc.cluster.type': 'Type',
'pages.rc.cluster.jobManagerAddress': 'JobManger Address',
'pages.rc.cluster.version': 'Version',
......@@ -539,7 +541,6 @@ export default {
'pages.rc.clusterConfig.otherConfig': 'Other Config',
'pages.rc.clusterConfig.addDefineConfig': 'Add a Custom Item',
'pages.rc.clusterConfig.typePlaceholder': 'Please select cluster type!',
'pages.rc.clusterConfig.aliasPlaceholder': 'Please enter Alias!',
'pages.rc.clusterConfig.namePlaceholder': 'Please enter Name!',
'pages.rc.clusterConfig.hadoopConfigPathPlaceholder': 'Please enter the hadoop Config file path, the value is /etc/hadoop/conf! ',
'pages.rc.clusterConfig.hadoopConfigPathHelp': 'Specify the Config file path (without / at the end), the following files need to be included: core-site.xml, hdfs-site.xml, yarn-site.xml! ',
......@@ -672,9 +673,8 @@ export default {
'pages.rc.alert.group.disableTotalOf': 'Total Of {total} Alarm group Is Disabled',
'pages.rc.jar.Management': 'Jar Config Management',
'pages.rc.jar.name': 'Name',
'pages.rc.jar.name': 'Job Name',
'pages.rc.jar.id': 'Jar ID',
'pages.rc.jar.alias': 'Alias',
'pages.rc.jar.type': 'Type',
'pages.rc.jar.filePath': 'File Path',
'pages.rc.jar.mainClass': 'Startup Class',
......@@ -696,7 +696,6 @@ export default {
'pages.rc.jar.execParamsHelp': 'Specify the startup class input parameter of the executable Jar, (optional)',
'pages.rc.jar.execParamsPleaseHolder': '--id 1,2',
'pages.rc.jar.baseConfig': 'Base Config',
'pages.rc.jar.aliasPlaceholder': 'Please enter alias!',
'pages.rc.jar.namePlaceholder': 'Please enter name!',
'pages.rc.db.Management': 'DataSource',
......@@ -794,10 +793,9 @@ export default {
'pages.task.add.job' : 'Add Task',
'pages.task.management' : 'Task Management',
'pages.task.name' : 'Task Name',
'pages.task.name' : 'Job Name',
'pages.task.namePlaceHolder' : 'Please Enter Task Name',
'pages.task.id' : 'Task ID',
'pages.task.alias' : 'Alias',
'pages.task.type' : 'Type',
'pages.task.checkPoint' : 'CheckPoint',
'pages.task.savePointPath' : 'SavePoint Path',
......@@ -924,7 +922,7 @@ export default {
'pages.devops.jobinfo.job.keyConfirm': 'Are you sure {key} this job?',
'pages.devops.baseinfo.taskid': 'Task Id',
'pages.devops.baseinfo.name': 'Name',
'pages.devops.baseinfo.name': 'Job Name',
'pages.devops.baseinfo.status': 'Status',
'pages.devops.baseinfo.readbytes': 'Receive Bytes',
'pages.devops.baseinfo.readrecords': 'Receive Records',
......
......@@ -346,7 +346,7 @@ export default {
'pages.datastudio.label.history.result': '预览数据',
'pages.datastudio.label.history.error': '异常信息',
'pages.datastudio.label.history.jobId': '作业ID',
'pages.datastudio.label.history.jobName': '作业名',
'pages.datastudio.label.history.jobName': '任务名名',
'pages.datastudio.label.history.runningCluster': '运行集群',
'pages.datastudio.label.history.session': '共享会话',
'pages.datastudio.label.history.taskType': '任务类型',
......@@ -490,6 +490,8 @@ export default {
'pages.rc.clusterManagement': '集群实例管理',
'pages.rc.cluster.instanceName': '实例名称',
'pages.rc.cluster.alias': '实例别名',
'pages.rc.cluster.aliasPlaceholder': '请输入别名!',
'pages.rc.cluster.type': '类型',
'pages.rc.cluster.jobManagerAddress': 'JobManger 地址',
'pages.rc.cluster.version': '版本',
......@@ -673,9 +675,8 @@ export default {
'pages.rc.alert.group.disableTotalOf': '被禁用的报警组共 {total} 个',
'pages.rc.jar.Management': 'Jar 管理',
'pages.rc.jar.name': '名称',
'pages.rc.jar.name': '任务名称',
'pages.rc.jar.id': 'Jar ID',
'pages.rc.jar.alias': '别名',
'pages.rc.jar.type': '类型',
'pages.rc.jar.filePath': '文件路径',
'pages.rc.jar.mainClass': '启动类',
......@@ -697,7 +698,6 @@ export default {
'pages.rc.jar.execParamsHelp': '指定可执行 Jar 的启动类入参,(可选)',
'pages.rc.jar.execParamsPleaseHolder': '--id 1,2',
'pages.rc.jar.baseConfig': '基本配置',
'pages.rc.jar.aliasPlaceholder': '请输入别名!',
'pages.rc.jar.namePlaceholder': '请输入名称!',
......@@ -928,7 +928,7 @@ export default {
'pages.devops.jobinfo.job.keyConfirm':'确定{key} 该作业吗?',
'pages.devops.baseinfo.taskid': '任务ID',
'pages.devops.baseinfo.name': '名称',
'pages.devops.baseinfo.name': '任务名称',
'pages.devops.baseinfo.status': '状态',
'pages.devops.baseinfo.readbytes': '接收字节',
'pages.devops.baseinfo.readrecords': '接收记录',
......
......@@ -55,7 +55,6 @@ const MetaDataContainer: React.FC<{}> = (props: any) => {
let [database, setDatabase] = useState<[{
id: number,
name: string,
alias: string,
type: string,
enabled: string,
groupName: string,
......@@ -64,7 +63,6 @@ const MetaDataContainer: React.FC<{}> = (props: any) => {
}]>([{
id: -1,
name: '',
alias: '',
type: '',
enabled: '',
groupName: '',
......@@ -163,7 +161,7 @@ const MetaDataContainer: React.FC<{}> = (props: any) => {
</Col>
<Col span={11}>
<div>
<p>{item.alias}</p>
<p>{item.name}</p>
<Tag color="blue" key={item.groupName}>
{item.groupName}
</Tag>
......@@ -199,7 +197,7 @@ const MetaDataContainer: React.FC<{}> = (props: any) => {
}}
>{l('button.refresh')}</Button>
</div>
<div>{item.alias}</div>
<div>{item.name}</div>
</div>
)
}
......
......@@ -25,7 +25,6 @@ import type {SqlMetaData} from "@/components/Studio/StudioEvent/data";
export type ClusterType = {
id: number,
name: string,
alias: string,
type: string,
hosts: string,
jobManagerHost: string,
......@@ -39,7 +38,6 @@ export type ClusterType = {
export type ClusterConfigurationType = {
id: number,
name: string,
alias: string,
type: string,
config: any,
available: boolean,
......@@ -52,7 +50,6 @@ export type ClusterConfigurationType = {
export type DataBaseType = {
id: number,
name: string,
alias: string,
groupName: string,
type: string,
url: string,
......@@ -71,7 +68,6 @@ export type DataBaseType = {
export type EnvType = {
id?: number,
name?: string,
alias?: string,
fragment?: boolean,
};
......@@ -79,7 +75,6 @@ export type TaskType = {
id?: number,
catalogueId?: number,
name?: string,
alias?: string,
dialect?: string,
type?: string,
checkPoint?: number,
......@@ -632,13 +627,13 @@ const Model: ModelType = {
if (newTabs.panes[i].key == payload.key) {
newTabs.panes[i].title = payload.title;
newTabs.panes[i].icon = payload.icon;
newTabs.panes[i].task.alias = payload.title;
newTabs.panes[i].task.name = payload.title;
newTabs.panes[i].path[newTabs.panes[i].path.length - 1] = payload.title;
}
if (newTabs.panes[i].key == newCurrent.key) {
newCurrent.title = payload.title;
newCurrent.icon = payload.icon;
newCurrent.task.alias = payload.title;
newCurrent.task.name = payload.title;
newCurrent.path[newCurrent.path.length - 1] = payload.title;
}
}
......
......@@ -43,7 +43,7 @@ const Config = (props: any) => {
{job?.cluster?.alias ? <Link>{job?.cluster?.alias}</Link> : '-'}
</Descriptions.Item>
<Descriptions.Item label={l('pages.devops.config.clusterConfiguration')}>
{job?.clusterConfiguration?.alias ? <Link>{job?.clusterConfiguration?.alias}</Link> : '-'}
{job?.clusterConfiguration?.name ? <Link>{job?.clusterConfiguration?.name}</Link> : '-'}
</Descriptions.Item>
<Descriptions.Item label={l('pages.devops.config.session')}>
{job?.history?.session ? <Link>{job?.history?.session}</Link> : l('button.disable')}
......
......@@ -45,7 +45,7 @@ const VersionList = (props: any) => {
const handleShowStatement = (item: any) => {
return (
<div style={{width: "1100px"}}>
<Modal title={l('pages.devops.jobinfo.version.sql.title')} visible={modalVisible} destroyOnClose={true} width={"60%"}
<Modal title={l('pages.devops.jobinfo.version.sql.title')} open={modalVisible} destroyOnClose={true} width={"60%"}
onCancel={() => {
cancelHandle();
}}
......@@ -77,12 +77,6 @@ const VersionList = (props: any) => {
sorter: true,
dataIndex: 'name',
},
{
title: l('pages.devops.jobinfo.version.alias'),
align: 'center',
sorter: true,
dataIndex: 'alias',
},
{
title: l('pages.devops.jobinfo.version.dialect'),
align: 'center',
......
......@@ -122,7 +122,8 @@ const JobInstanceTable = (props: any) => {
}
const getColumns = () => {
const columns: ProColumns<JobInstanceTableListItem>[] = [{
const columns: ProColumns<JobInstanceTableListItem>[] = [
{
title: l('global.table.jobname'),
dataIndex: "name",
sorter: true,
......
......@@ -130,7 +130,6 @@ export type TaskVersion = {
id: number,
taskId: number,
name: string,
alias: string,
dialect: string,
type: string,
versionId: number,
......
......@@ -44,6 +44,7 @@ const ClusterForm: React.FC<ClusterFormProps> = (props) => {
const [formVals, setFormVals] = useState<Partial<ClusterTableListItem>>({
id: props.values.id,
name: props.values.name,
alias: props.values.alias,
type: props.values.type,
hosts: props.values.hosts,
note: props.values.note,
......@@ -63,7 +64,6 @@ const ClusterForm: React.FC<ClusterFormProps> = (props) => {
if (!fieldsValue.alias || fieldsValue.alias.length == 0) {
fieldsValue.alias = fieldsValue.name;
}
setFormVals(fieldsValue);
handleSubmit(fieldsValue);
};
......@@ -82,7 +82,12 @@ const ClusterForm: React.FC<ClusterFormProps> = (props) => {
rules={[{required: true, message: l('pages.rc.cluster.namePlaceholder') }]}>
<Input placeholder={l('pages.rc.cluster.namePlaceholder') }/>
</Form.Item>
<Form.Item
name="alias"
label={l('pages.rc.cluster.alias')}
>
<Input placeholder={l('pages.rc.cluster.aliasPlaceholder') }/>
</Form.Item>
<Form.Item
name="type"
label={l('pages.rc.cluster.type')}
......
......@@ -132,6 +132,12 @@ const ClusterTableList: React.FC<{}> = (props: any) => {
return <a onClick={() => setRow(entity)}>{dom}</a>;
},
},
{
title: l('pages.rc.cluster.alias'),
sorter: true,
dataIndex: 'alias',
hideInTable: false,
},
{
title: l('pages.rc.cluster.instanceId'),
dataIndex: 'id',
......
......@@ -91,7 +91,6 @@ export function getConfigFormValues(values: any) {
let formValues = addValueToMap(values, [
'id',
'name',
'alias',
'type',
'note',
'enabled',
......
......@@ -75,7 +75,7 @@ const DataBaseTableList: React.FC<{}> = (props: any) => {
const onDeleteDataBase = (row: DataBaseItem) => {
Modal.confirm({
title: l('pages.rc.db.delete'),
content: l('pages.rc.db.deleteConfirm','',{dbName: (row.alias === "" ? row.name : row.alias)}),
content: l('pages.rc.db.deleteConfirm','',{dbName: row.name}),
okText: l('button.confirm'),
cancelText: l('button.cancel'),
onOk: async () => {
......
......@@ -43,7 +43,6 @@ const JarForm: React.FC<JarFormProps> = (props) => {
const [formVals, setFormVals] = useState<Partial<JarTableListItem>>({
id: props.values.id,
name: props.values.name,
alias: props.values.alias,
type: props.values.type ? props.values.type : 'UserApp',
path: props.values.path,
mainClass: props.values.mainClass,
......@@ -105,12 +104,6 @@ const JarForm: React.FC<JarFormProps> = (props) => {
rules={[{required: true, message: l('pages.rc.jar.namePlaceholder')}]}>
<Input placeholder={l('pages.rc.jar.namePlaceholder')}/>
</Form.Item>
<Form.Item
name="alias"
label={l('pages.rc.jar.alias')}
>
<Input placeholder={l('pages.rc.jar.aliasPlaceholder')}/>
</Form.Item>
<Form.Item
name="note"
label={l('global.table.note')}
......
......@@ -118,12 +118,6 @@ const JarTableList: React.FC<{}> = (props: any) => {
hideInForm: true,
hideInSearch: true,
},
{
title: l('pages.rc.jar.alias'),
sorter: true,
dataIndex: 'alias',
hideInTable: false,
},
{
title: l('pages.rc.jar.type'),
sorter: true,
......
......@@ -21,7 +21,6 @@
export type AlertGroupTableListItem = {
id: number,
name: string,
alias: string,
alertInstanceIds: string,
note: string,
enabled: boolean,
......@@ -44,6 +43,7 @@ export type AlertInstanceTableListItem = {
export type ClusterTableListItem = {
id: number,
name: string,
alias: string,
type: string,
hosts: string,
jobManagerHost: string,
......@@ -152,7 +152,6 @@ export type FragmentVariableTableListItem = {
export type JarTableListItem = {
id: number,
name: string,
alias: string,
type: string,
path: string,
mainClass: string,
......
......@@ -44,7 +44,6 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
const [formVals, setFormVals] = useState<Partial<TaskTableListItem>>({
id: props.values.id,
name: props.values.name,
alias: props.values.alias,
type: props.values.type,
checkPoint: props.values.checkPoint,
savePointPath: props.values.savePointPath,
......@@ -79,12 +78,6 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
rules={[{required: true, message: l('pages.task.namePlaceHolder')}]}>
<Input placeholder={l('pages.task.placeHolder')}/>
</FormItem>
<FormItem
name="alias"
label={l('pages.task.alias')}
>
<Input placeholder={l('pages.task.placeHolder')}/>
</FormItem>
<FormItem
name="type"
label={l('pages.task.type')}
......@@ -158,7 +151,6 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
initialValues={{
id: formVals.id,
name: formVals.name,
alias: formVals.alias,
type: formVals.type,
note: formVals.note,
checkPoint: formVals.checkPoint,
......
......@@ -21,7 +21,6 @@
export type TaskTableListItem = {
id: number,
name: string,
alias: string,
dialect: string,
type: string,
checkPoint: number,
......
......@@ -108,12 +108,6 @@ const TaskTableList: React.FC<{}> = () => {
hideInForm: true,
hideInSearch: true,
},
{
title: l('pages.task.alias'),
sorter: true,
dataIndex: 'alias',
hideInTable: false,
},
{
title: l('pages.task.type'),
sorter: true,
......
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