Browse Source

Worker group adds check (#2787)

* Worker group adds check

* fix
break60 4 years ago
parent
commit
05a0d3892a

+ 15 - 2
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue

@@ -484,6 +484,16 @@
         }
         return true
       },
+      _verifWorkGroup() {
+        let item = this.store.state.security.workerGroupsListAll.find(item => {
+          return item.id == this.workerGroup;
+        });
+        if(item==undefined) {
+          this.$message.warning(`${i18n.$t('The Worker group no longer exists, please select the correct Worker group!')}`)
+          return false;
+        }
+        return true
+      },
       /**
        * Global verification procedure
        */
@@ -492,6 +502,10 @@
         if (!this._verifName()) {
           return
         }
+        // verif workGroup
+        if(!this._verifWorkGroup()) {
+          return
+        }
         // Verify task alarm parameters
         if (!this.$refs['timeout']._verification()) {
           return
@@ -619,8 +633,7 @@
             break;
           }
         }
-
-        if(!hasMatch){
+        if(!hasMatch && o.workerGroupId!=undefined){
           this.workerGroup = 'default'
         } else {
           this.workerGroup = o.workerGroup

+ 2 - 1
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js

@@ -592,5 +592,6 @@ export default {
   'Cannot select the same node for successful branch flow and failed branch flow': 'Cannot select the same node for successful branch flow and failed branch flow',
   'Successful branch flow and failed branch flow are required': 'conditions node Successful and failed branch flow are required',
   'Unauthorized or deleted resources': 'Unauthorized or deleted resources',
-  'Please delete all non-existent resources': 'Please delete all non-existent resources'
+  'Please delete all non-existent resources': 'Please delete all non-existent resources',
+  'The Worker group no longer exists, please select the correct Worker group!': 'The Worker group no longer exists, please select the correct Worker group!'
 }

+ 2 - 1
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

@@ -592,5 +592,6 @@ export default {
   'Cannot select the same node for successful branch flow and failed branch flow': '成功分支流转和失败分支流转不能选择同一个节点',
   'Successful branch flow and failed branch flow are required': 'conditions节点成功和失败分支流转必填',
   'Unauthorized or deleted resources': '未授权或已删除资源',
-  'Please delete all non-existent resources': '请删除所有未授权或已删除资源'
+  'Please delete all non-existent resources': '请删除所有未授权或已删除资源',
+  'The Worker group no longer exists, please select the correct Worker group!': '该Worker分组已经不存在,请选择正确的Worker分组!'
 }