You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ke...@apache.org on 2022/12/23 07:25:05 UTC

[dolphinscheduler] branch dev updated: [Improvement][UI] Support to display extra columns such as 'Worker Group' and 'Environment Name' on the page of cron manage. (#13267)

This is an automated email from the ASF dual-hosted git repository.

kerwin pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new a235d3cd6a [Improvement][UI] Support to display extra columns such as 'Worker Group' and 'Environment Name' on the page of cron manage. (#13267)
a235d3cd6a is described below

commit a235d3cd6a0f889b4793f81b07aaa73ba23c2412
Author: calvin <ji...@163.com>
AuthorDate: Fri Dec 23 15:24:59 2022 +0800

    [Improvement][UI] Support to display extra columns such as 'Worker Group' and 'Environment Name' on the page of cron manage. (#13267)
---
 .../java/org/apache/dolphinscheduler/api/vo/ScheduleVo.java    |  6 ++++++
 .../java/org/apache/dolphinscheduler/dao/entity/Schedule.java  |  6 ++++++
 .../org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.xml  |  3 ++-
 .../src/views/projects/workflow/definition/timing/use-table.ts | 10 ++++++++++
 4 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/vo/ScheduleVo.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/vo/ScheduleVo.java
index 944a992ed7..8be0545279 100644
--- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/vo/ScheduleVo.java
+++ b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/vo/ScheduleVo.java
@@ -130,6 +130,11 @@ public class ScheduleVo {
      */
     private Long environmentCode;
 
+    /**
+     * environment name
+     */
+    private String environmentName;
+
     public ScheduleVo(Schedule schedule) {
         this.setId(schedule.getId());
         this.setCrontab(schedule.getCrontab());
@@ -150,5 +155,6 @@ public class ScheduleVo {
         this.setEnvironmentCode(schedule.getEnvironmentCode());
         this.setStartTime(DateUtils.dateToString(schedule.getStartTime(), ZoneId.systemDefault().getId()));
         this.setEndTime(DateUtils.dateToString(schedule.getEndTime(), ZoneId.systemDefault().getId()));
+        this.setEnvironmentName(schedule.getEnvironmentName());
     }
 }
diff --git a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Schedule.java b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Schedule.java
index e5f52c0d8f..82253900e0 100644
--- a/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Schedule.java
+++ b/dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/Schedule.java
@@ -137,4 +137,10 @@ public class Schedule {
      * environment code
      */
     private Long environmentCode;
+
+    /**
+     * environment name
+     */
+    @TableField(exist = false)
+    private String environmentName;
 }
diff --git a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.xml b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.xml
index 8c17213a07..3849ca87e2 100644
--- a/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.xml
+++ b/dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ScheduleMapper.xml
@@ -29,7 +29,7 @@
         ${alias}.update_time
     </sql>
     <select id="queryByProcessDefineCodePaging" resultType="org.apache.dolphinscheduler.dao.entity.Schedule">
-        select p_f.name as process_definition_name, p.name as project_name,u.user_name,
+        select p_f.name as process_definition_name, p.name as project_name,u.user_name,e.name as environment_name,
         <include refid="baseSqlV2">
             <property name="alias" value="s"/>
         </include>
@@ -37,6 +37,7 @@
         join t_ds_process_definition p_f on s.process_definition_code = p_f.code
         join t_ds_project as p on p_f.project_code = p.code
         join t_ds_user as u on s.user_id = u.id
+        join t_ds_environment as e on s.environment_code = e.code
         where 1=1
         <if test="processDefinitionCode != 0">
             and s.process_definition_code = #{processDefinitionCode}
diff --git a/dolphinscheduler-ui/src/views/projects/workflow/definition/timing/use-table.ts b/dolphinscheduler-ui/src/views/projects/workflow/definition/timing/use-table.ts
index 85ea79f284..308daaad27 100644
--- a/dolphinscheduler-ui/src/views/projects/workflow/definition/timing/use-table.ts
+++ b/dolphinscheduler-ui/src/views/projects/workflow/definition/timing/use-table.ts
@@ -123,6 +123,16 @@ export function useTable() {
             ? t('project.workflow.up_line')
             : t('project.workflow.down_line')
       },
+      {
+        title: t('project.workflow.worker_group'),
+        key: 'workerGroup',
+        width: 140
+      },
+      {
+        title: t('project.workflow.environment_name'),
+        key: 'environmentName',
+        width: 160
+      },
       {
         title: t('project.workflow.create_time'),
         key: 'createTime',