Browse Source

[Fix-11366][UI] Workflow instance should not support right-click running (#11367)

Co-authored-by: sheldonliu <sheldonliu>
Sheldon 2 years ago
parent
commit
82e9c40df8

+ 13 - 7
dolphinscheduler-ui/src/views/projects/workflow/components/dag/dag-context-menu.tsx

@@ -26,6 +26,10 @@ import { IWorkflowTaskInstance } from './types'
 import { NButton } from 'naive-ui'
 
 const props = {
+  startButtonDisplay: {
+    type: Boolean as PropType<boolean>,
+    default: true
+  },
   startReadonly: {
     type: Boolean as PropType<boolean>,
     default: false
@@ -127,13 +131,15 @@ export default defineComponent({
           class={styles['dag-context-menu']}
           style={{ left: `${this.left}px`, top: `${this.top}px` }}
         >
-          <NButton
-            class={`${styles['menu-item']}`}
-            disabled={this.startReadonly}
-            onClick={this.startRunning}
-          >
-            {t('project.node.start')}
-          </NButton>
+          {this.startButtonDisplay && (
+            <NButton
+              class={`${styles['menu-item']}`}
+              disabled={this.startReadonly}
+              onClick={this.startRunning}
+            >
+              {t('project.node.start')}
+            </NButton>)
+          }
           <NButton
             class={`${styles['menu-item']}`}
             disabled={this.menuReadonly}

+ 1 - 0
dolphinscheduler-ui/src/views/projects/workflow/components/dag/index.tsx

@@ -362,6 +362,7 @@ export default defineComponent({
           onCancel={taskCancel}
         />
         <ContextMenuItem
+          startButtonDisplay={!props.instance}
           startReadonly={startReadonly.value}
           menuReadonly={menuReadonly.value}
           taskInstance={taskInstance.value}