You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by so...@apache.org on 2022/03/28 01:13:04 UTC

[dolphinscheduler] branch dev updated: [Fix][UI Next][V1.0.0-Alpha] Serial execte proces (#9229)

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

songjian 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 b2cccc8  [Fix][UI Next][V1.0.0-Alpha] Serial execte proces (#9229)
b2cccc8 is described below

commit b2cccc8959574afae4ca34eb5e9c97a135e49848
Author: Devosend <de...@gmail.com>
AuthorDate: Mon Mar 28 09:12:57 2022 +0800

    [Fix][UI Next][V1.0.0-Alpha] Serial execte proces (#9229)
    
    * add Process execute type for workflow
    
    * fix icon spin
---
 dolphinscheduler-ui-next/src/locales/modules/en_US.ts |  6 ++++++
 dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts |  6 ++++++
 .../src/service/modules/process-definition/types.ts   |  1 +
 dolphinscheduler-ui-next/src/utils/common.ts          |  6 +++---
 .../src/views/projects/task/instance/use-table.ts     |  3 +--
 .../workflow/components/dag/dag-save-modal.tsx        | 19 +++++++++++++++++++
 .../views/projects/workflow/components/dag/types.ts   |  2 ++
 .../workflow/definition/components/start-modal.tsx    |  2 +-
 .../projects/workflow/definition/create/index.tsx     |  1 +
 .../projects/workflow/definition/detail/index.tsx     |  1 +
 10 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/dolphinscheduler-ui-next/src/locales/modules/en_US.ts b/dolphinscheduler-ui-next/src/locales/modules/en_US.ts
index 6e17ee3..d1f8298 100644
--- a/dolphinscheduler-ui-next/src/locales/modules/en_US.ts
+++ b/dolphinscheduler-ui-next/src/locales/modules/en_US.ts
@@ -597,6 +597,12 @@ const project = {
     description: 'Description',
     tenant: 'Tenant',
     timeout_alert: 'Timeout Alert',
+    process_execute_type: 'Process execute type',
+    parallel: 'parallel',
+    serial_wait: 'Serial wait',
+    serial_discard: 'Serial discard',
+    serial_priority: 'Serial priority',
+    recover_serial_wait: 'Recover serial wait',
     global_variables: 'Global Variables',
     basic_info: 'Basic Information',
     minute: 'Minute',
diff --git a/dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts b/dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
index ad1bbd7..b399b9c 100644
--- a/dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
+++ b/dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
@@ -593,6 +593,12 @@ const project = {
     description: '描述',
     tenant: '租户',
     timeout_alert: '超时告警',
+    process_execute_type: '执行策略',
+    parallel: '并行',
+    serial_wait: '串行等待',
+    serial_discard: '串行抛弃',
+    serial_priority: '串行优先',
+    recover_serial_wait: '串行恢复',
     global_variables: '全局变量',
     basic_info: '基本信息',
     minute: '分',
diff --git a/dolphinscheduler-ui-next/src/service/modules/process-definition/types.ts b/dolphinscheduler-ui-next/src/service/modules/process-definition/types.ts
index 17cb4bc..7f5b6ae 100644
--- a/dolphinscheduler-ui-next/src/service/modules/process-definition/types.ts
+++ b/dolphinscheduler-ui-next/src/service/modules/process-definition/types.ts
@@ -59,6 +59,7 @@ interface ProcessDefinitionReq {
   taskDefinitionJson: string
   taskRelationJson: string
   tenantCode: string
+  executionType: string
   description?: string
   globalParams?: string
   timeout?: number
diff --git a/dolphinscheduler-ui-next/src/utils/common.ts b/dolphinscheduler-ui-next/src/utils/common.ts
index b4f8a1b..074bbfa 100644
--- a/dolphinscheduler-ui-next/src/utils/common.ts
+++ b/dolphinscheduler-ui-next/src/utils/common.ts
@@ -24,7 +24,7 @@ import {
   EditOutlined,
   MinusCircleOutlined,
   CheckCircleFilled,
-  LoadingOutlined,
+  Loading3QuartersOutlined,
   PauseCircleFilled,
   ClockCircleOutlined,
   StopFilled,
@@ -319,8 +319,8 @@ export const tasksState = (t: any): ITaskStateConfig => ({
     id: 14,
     desc: `${t('project.workflow.serial_wait')}`,
     color: '#5102ce',
-    icon: LoadingOutlined,
-    isSpin: false,
+    icon: Loading3QuartersOutlined,
+    isSpin: true,
     classNames: 'serial_wait'
   }
 })
diff --git a/dolphinscheduler-ui-next/src/views/projects/task/instance/use-table.ts b/dolphinscheduler-ui-next/src/views/projects/task/instance/use-table.ts
index 88e9cb1..baaaef8 100644
--- a/dolphinscheduler-ui-next/src/views/projects/task/instance/use-table.ts
+++ b/dolphinscheduler-ui-next/src/views/projects/task/instance/use-table.ts
@@ -333,7 +333,6 @@ export function renderStateCell(state: ITaskState, t: Function) {
     NIcon,
     {
       color: stateOption.color,
-      size: 18,
       class: stateOption.classNames,
       style: {
         display: 'flex'
@@ -344,7 +343,7 @@ export function renderStateCell(state: ITaskState, t: Function) {
   return h(NTooltip, null, {
     trigger: () => {
       if (!stateOption.isSpin) return Icon
-      return h(NSpin, { size: 'small' }, { icon: () => Icon })
+      return h(NSpin, { size: 18 }, { icon: () => Icon })
     },
     default: () => stateOption.desc
   })
diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx
index 2782cae..c4ab2b0 100644
--- a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx
+++ b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx
@@ -87,6 +87,7 @@ export default defineComponent({
       name: '',
       description: '',
       tenantCode: 'default',
+      executionType: 'PARALLEL',
       timeoutFlag: false,
       timeout: 0,
       globalParams: [],
@@ -94,6 +95,12 @@ export default defineComponent({
       sync: false
     })
     const formRef = ref()
+    const executeTypeOptions = [
+      { value: 'PARALLEL', label: 'parallel' },
+      { value: 'SERIAL_WAIT', label: 'Serial wait' },
+      { value: 'SERIAL_DISCARD', label: 'Serial discard' },
+      { value: 'SERIAL_PRIORITY', label: 'Serial priority' }
+    ]
     const rule = {
       name: {
         required: true,
@@ -155,6 +162,7 @@ export default defineComponent({
         formValue.value.name = process.name
         formValue.value.description = process.description
         formValue.value.tenantCode = process.tenantCode || 'default'
+        formValue.value.executionType = process.executionType || 'PARALLEL'
         if (process.timeout && process.timeout > 0) {
           formValue.value.timeoutFlag = true
           formValue.value.timeout = process.timeout
@@ -214,6 +222,17 @@ export default defineComponent({
               />
             </NFormItem>
           )}
+          {!props.instance && (
+            <NFormItem
+              label={t('project.dag.process_execute_type')}
+              path='executionType'
+            >
+              <NSelect
+                options={executeTypeOptions}
+                v-model:value={formValue.value.executionType}
+              />
+            </NFormItem>
+          )}
           <NFormItem
             label={t('project.dag.global_variables')}
             path='globalParams'
diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/types.ts b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/types.ts
index 6dbabd6..7eba74c 100644
--- a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/types.ts
+++ b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/types.ts
@@ -40,6 +40,7 @@ export interface ProcessDefinition {
   timeout: number
   tenantId: number
   tenantCode: string
+  executionType: string
   modifyBy?: any
   warningGroupId: number
 }
@@ -142,6 +143,7 @@ export interface SaveForm {
   name: string
   description: string
   tenantCode: string
+  executionType: string
   timeoutFlag: boolean
   timeout: number
   globalParams: GlobalParam[]
diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/start-modal.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/start-modal.tsx
index 519b89d..b7b91df 100644
--- a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/start-modal.tsx
+++ b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/start-modal.tsx
@@ -226,7 +226,7 @@ export default defineComponent({
           >
             <div class={styles.formItem} title={this.row.name}>
               {this.row.name}
-            </div> 
+            </div>
           </NFormItem>
           <NFormItem
             label={t('project.workflow.failure_strategy')}
diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx
index 6474bf7..fe7b9f3 100644
--- a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx
+++ b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/create/index.tsx
@@ -70,6 +70,7 @@ export default defineComponent({
           locations: JSON.stringify(locations),
           name: saveForm.name,
           tenantCode: saveForm.tenantCode,
+          executionType: saveForm.executionType,
           description: saveForm.description,
           globalParams: JSON.stringify(globalParams),
           timeout: saveForm.timeoutFlag ? saveForm.timeout : 0
diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx
index c5547df..1da1c34 100644
--- a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx
+++ b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/detail/index.tsx
@@ -87,6 +87,7 @@ export default defineComponent({
           locations: JSON.stringify(locations),
           name: saveForm.name,
           tenantCode: saveForm.tenantCode,
+          executionType: saveForm.executionType,
           description: saveForm.description,
           globalParams: JSON.stringify(globalParams),
           timeout: saveForm.timeoutFlag ? saveForm.timeout : 0,