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

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


The following commit(s) were added to refs/heads/dev by this push:
     new df33d1a  Force success
     new a4c232c  Merge pull request #3861 from yinancx/fs-dev
df33d1a is described below

commit df33d1a28ee0055ae8b64335aa9234a55e65f651
Author: 曹聚阳 <[email protected]>
AuthorDate: Tue Sep 29 23:06:53 2020 +0800

    Force success
---
 .../src/js/conf/home/pages/dag/_source/config.js   |  7 +++++++
 .../pages/_source/instanceConditions/common.js     |  3 +++
 .../projects/pages/taskInstance/_source/list.vue   | 23 ++++++++++++++++++++++
 .../src/js/conf/home/store/dag/actions.js          | 12 +++++++++++
 .../src/js/module/i18n/locale/en_US.js             |  2 ++
 .../src/js/module/i18n/locale/zh_CN.js             |  1 +
 6 files changed, 48 insertions(+)

diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js 
b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js
index 2e60929..18fbd94 100755
--- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js
+++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js
@@ -236,6 +236,13 @@ const tasksState = {
     color: '#5102ce',
     icoUnicode: 'ans-icon-coin',
     isSpin: false
+  },
+  FORCED_SUCCESS: {
+    id: 13,
+    desc: `${i18n.$t('Forced success')}`,
+    color: '#5102ce',
+    icoUnicode: 'ans-icon-success-solid',
+    isSpin: false
   }
 }
 
diff --git 
a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/instanceConditions/common.js
 
b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/instanceConditions/common.js
index 8a13aea..e917cf3 100644
--- 
a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/instanceConditions/common.js
+++ 
b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/instanceConditions/common.js
@@ -63,6 +63,9 @@ const stateType = [
   }, {
     code: 'DELAY_EXECUTION',
     label: `${i18n.$t('Delay execution')}`
+  }, {
+    code: 'FORCED_SUCCESS',
+    label: `${i18n.$t('Forced success')}`
   }
 ]
 
diff --git 
a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/_source/list.vue
 
b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/_source/list.vue
index cdcf0b0..a6c7de1 100644
--- 
a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/_source/list.vue
+++ 
b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/_source/list.vue
@@ -92,6 +92,16 @@
           <td><span>{{item.retryTimes}}</span></td>
           <td>
             <x-button
+                    v-if="item.state === 'FAILURE' || item.state === 
'NEED_FAULT_TOLERANCE' || item.state === 'KILL'"
+                    type="error"
+                    shape="circle"
+                    size="xsmall"
+                    data-toggle="tooltip"
+                    :title="$t('Force success')"
+                    icon="ans-icon-success-solid"
+                    @click="_forceSuccess(item)">
+            </x-button>
+            <x-button
                     type="info"
                     shape="circle"
                     size="xsmall"
@@ -110,6 +120,7 @@
   import Permissions from '@/module/permissions'
   import mLog from '@/conf/home/pages/dag/_source/formModel/log'
   import { tasksState } from '@/conf/home/pages/dag/_source/config'
+  import { mapActions } from 'vuex'
 
   export default {
     name: 'list',
@@ -126,6 +137,7 @@
       pageSize: Number
     },
     methods: {
+      ...mapActions('dag', ['forceTaskSuccess']),
       _rtState (code) {
         let o = tasksState[code]
         return `<em class="${o.icoUnicode} ${o.isSpin ? 'as as-spin' : ''}" 
style="color:${o.color}" data-toggle="tooltip" data-container="body" 
title="${o.desc}"></em>`
@@ -156,6 +168,17 @@
           }
         })
       },
+      _forceSuccess (item) {
+        this.forceTaskSuccess({taskInstanceId: item.id}).then(res => {
+          if (res.code === 0) {
+            this.$message.success(res.msg)
+          } else {
+            this.$message.error(res.msg)
+          }
+        }).catch(e => {
+          this.$message.error(e.msg)
+        })
+      },
       _go (item) {
         this.$router.push({ path: 
`/projects/instance/list/${item.processInstanceId}` })
       },
diff --git a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js 
b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
index 93fab5a..b35d070 100644
--- a/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
+++ b/dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
@@ -735,6 +735,18 @@ export default {
     })
   },
   /**
+   * Force fail/kill/need_fault_tolerance task success
+   */
+  forceTaskSuccess ({ state }, payload) {
+    return new Promise((resolve, reject) => {
+      io.post(`projects/${state.projectName}/task-instance/force-success`, 
payload, res => {
+        resolve(res)
+      }).catch(e => {
+        reject(e)
+      })
+    })
+  },
+  /**
    * Query task record list
    */
   getTaskRecordList ({ state }, payload) {
diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js 
b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
index 5148849..0f59aec 100755
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
@@ -32,6 +32,7 @@ export default {
   'Current node settings': 'Current node settings',
   'View history': 'View history',
   'View log': 'View log',
+  'Force success': 'Force success',
   'Enter this child node': 'Enter this child node',
   'Node name': 'Node name',
   'Run flag': 'Run flag',
@@ -432,6 +433,7 @@ export default {
   'Timeout must be longer than check interval': 'Timeout must be longer than 
check interval',
   'Timeout strategy must be selected': 'Timeout strategy must be selected',
   'Timeout must be a positive integer': 'Timeout must be a positive integer',
+  'Forced success': 'Forced success',
   'Add dependency': 'Add dependency',
   and: 'and',
   or: 'or',
diff --git a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js 
b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
index 9341d4f..0481cd0 100755
--- a/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
+++ b/dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js
@@ -32,6 +32,7 @@ export default {
   'Current node settings': '当前节点设置',
   'View history': '查看历史',
   'View log': '查看日志',
+  'Force success': '强制成功',
   'Enter this child node': '进入该子节点',
   'Node name': '节点名称',
   'Please enter name (required)': '请输入名称(必填)',

Reply via email to