Jelajahi Sumber

Merge branch 'refactor-worker' of github.com:Technoboy-/incubator-dolphinscheduler into refactor-worker

Technoboy- 5 tahun lalu
induk
melakukan
932fc72794

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

@@ -40,8 +40,8 @@
     mixins: [disabledState],
     props: {
       value: {
-        type: Number,
-        default: -1
+        type: String,
+        default: 'default'
       }
     },
     model: {

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

@@ -90,7 +90,7 @@
               <m-priority v-model="taskInstancePriority"></m-priority>
             </span>
             <span class="text-b">{{$t('Worker group')}}</span>
-            <m-worker-groups v-model="workerGroupId"></m-worker-groups>
+            <m-worker-groups v-model="workerGroup"></m-worker-groups>
           </div>
         </div>
 
@@ -271,7 +271,7 @@
         // Task priority
         taskInstancePriority: 'MEDIUM',
         // worker group id
-        workerGroupId: -1
+        workerGroup: 'default'
       }
     },
     /**
@@ -378,7 +378,7 @@
             retryInterval: this.retryInterval,
             timeout: this.timeout,
             taskInstancePriority: this.taskInstancePriority,
-            workerGroupId: this.workerGroupId
+            workerGroup: this.workerGroup
           },
           fromThis: this
         })
@@ -433,7 +433,7 @@
             retryInterval: this.retryInterval,
             timeout: this.timeout,
             taskInstancePriority: this.taskInstancePriority,
-            workerGroupId: this.workerGroupId
+            workerGroup: this.workerGroup
           },
           fromThis: this
         })
@@ -522,17 +522,17 @@
           // If the workergroup has been deleted, set the default workergroup
           var hasMatch = false;
           for (let i = 0; i < this.store.state.security.workerGroupsListAll.length; i++) {
-            var workerGroupId = this.store.state.security.workerGroupsListAll[i].id
-            if (o.workerGroupId == workerGroupId) {
+            var workerGroup = this.store.state.security.workerGroupsListAll[i].id
+            if (o.workerGroup == workerGroup) {
               hasMatch = true;
               break;
             }
           }
 
           if(!hasMatch){
-            this.workerGroupId = -1
+            this.workerGroup = 'default'
           }else{
-            this.workerGroupId = o.workerGroupId
+            this.workerGroup = o.workerGroup
           }
 
         this.params = o.params || {}
@@ -572,7 +572,7 @@
           retryInterval: this.retryInterval,
           timeout: this.timeout,
           taskInstancePriority: this.taskInstancePriority,
-          workerGroupId: this.workerGroupId
+          workerGroup: this.workerGroup
         }
       }
     },

+ 1 - 1
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/startingParam/index.vue

@@ -24,7 +24,7 @@
            <li><span class="tab">{{$t('Complement range')}}:</span><span class="content" v-if="startupParam.commandParam && startupParam.commandParam.complementStartDate">{{startupParam.commandParam.complementStartDate}}-{{startupParam.commandParam.complementEndDate}}</span><span class="content" v-else>-</span></li>
            <li><span class="tab">{{$t('Failure Strategy')}}:</span><span class="content">{{startupParam.failureStrategy === 'END' ? $t('End') : $t('Continue')}}</span></li>
            <li><span class="tab">{{$t('Process priority')}}:</span><span class="content">{{startupParam.processInstancePriority}}</span></li>
-           <li><span class="tab">{{$t('Worker group')}}:</span><span class="content" v-if="workerGroupList.length">{{_rtWorkerGroupName(startupParam.workerGroupId)}}</span></li>
+           <li><span class="tab">{{$t('Worker group')}}:</span><span class="content" v-if="workerGroupList.length">{{_rtWorkerGroupName(startupParam.workerGroup)}}</span></li>
            <li><span class="tab">{{$t('Notification strategy')}}:</span><span class="content">{{_rtWarningType(startupParam.warningType)}}</span></li>
            <li><span class="tab">{{$t('Notification group')}}:</span><span class="content" v-if="notifyGroupList.length">{{_rtNotifyGroupName(startupParam.warningGroupId)}}</span></li>
            <li><span class="tab">{{$t('Recipient')}}:</span><span class="content">{{startupParam.receivers || '-'}}</span></li>

+ 3 - 3
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/_source/selectTenant.vue

@@ -40,8 +40,8 @@
     mixins: [disabledState],
     props: {
       value: {
-        type: Number,
-        default: -1
+        type: String,
+        default: 'default'
       }
     },
     model: {
@@ -55,7 +55,7 @@
         }
 			})
       if(!result) {
-        this.value = -1
+        this.value = 'default'
       }
     },
     methods: {

+ 3 - 3
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue

@@ -76,7 +76,7 @@
         {{$t('Worker group')}}
       </div>
       <div class="cont">
-        <m-worker-groups v-model="workerGroupId"></m-worker-groups>
+        <m-worker-groups v-model="workerGroup"></m-worker-groups>
       </div>
     </div>
     <div class="clearfix list">
@@ -192,7 +192,7 @@
         receiversCc: [],
         runMode: 'RUN_MODE_SERIAL',
         processInstancePriority: 'MEDIUM',
-        workerGroupId: -1
+        workerGroup: 'default'
       }
     },
     props: {
@@ -222,7 +222,7 @@
           processInstancePriority: this.processInstancePriority,
           receivers: this.receivers.join(',') || '',
           receiversCc: this.receiversCc.join(',') || '',
-          workerGroupId: this.workerGroupId
+          workerGroup: this.workerGroup
         }
         // Executed from the specified node
         if (this.sourceType === 'contextmenu') {

+ 4 - 4
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue

@@ -109,7 +109,7 @@
         {{$t('Worker group')}}
       </div>
       <div class="cont">
-        <m-worker-groups v-model="workerGroupId"></m-worker-groups>
+        <m-worker-groups v-model="workerGroup"></m-worker-groups>
       </div>
     </div>
     <div class="clearfix list">
@@ -186,7 +186,7 @@
         receiversCc: [],
         i18n: i18n.globalScope.LOCALE,
         processInstancePriority: 'MEDIUM',
-        workerGroupId: -1,
+        workerGroup: 'default',
         previewTimes: []
       }
     },
@@ -232,7 +232,7 @@
             warningGroupId: this.warningGroupId =='' ? 0 : this.warningGroupId,
             receivers: this.receivers.join(',') || '',
             receiversCc: this.receiversCc.join(',') || '',
-            workerGroupId: this.workerGroupId
+            workerGroup: this.workerGroup
           }
           let msg = ''
 
@@ -344,7 +344,7 @@
         this.failureStrategy = item.failureStrategy
         this.warningType = item.warningType
         this.processInstancePriority = item.processInstancePriority
-        this.workerGroupId = item.workerGroupId || -1
+        this.workerGroup = item.workerGroup || 'default'
         this._getNotifyGroupList().then(() => {
           this.$nextTick(() => {
             // let list = _.filter(this.notifyGroupList, v => v.id === item.warningGroupId)

+ 0 - 8
dolphinscheduler-ui/src/js/conf/home/router/index.js

@@ -318,14 +318,6 @@ const router = new Router({
             title: `${i18n.$t('Queue manage')}`
           }
         },
-        {
-          path: '/security/worker-groups',
-          name: 'worker-groups-manage',
-          component: resolve => require(['../pages/security/pages/workerGroups/index'], resolve),
-          meta: {
-            title: `${i18n.$t('Worker group manage')}`
-          }
-        },
         {
           path: '/security/token',
           name: 'token-manage',

+ 1 - 1
dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js

@@ -160,7 +160,7 @@ export default {
         state.tenantId = processInstanceJson.tenantId
 
         //startup parameters
-        state.startup = _.assign(state.startup, _.pick(res.data, ['commandType', 'failureStrategy', 'processInstancePriority', 'workerGroupId', 'warningType', 'warningGroupId', 'receivers', 'receiversCc']))
+        state.startup = _.assign(state.startup, _.pick(res.data, ['commandType', 'failureStrategy', 'processInstancePriority', 'workerGroup', 'warningType', 'warningGroupId', 'receivers', 'receiversCc']))
         state.startup.commandParam = JSON.parse(res.data.commandParam)
 
         resolve(res.data)

+ 1 - 1
dolphinscheduler-ui/src/js/conf/home/store/security/actions.js

@@ -452,7 +452,7 @@ export default {
       io.get(`worker-group/all-groups`, payload, res => {
         let list = res.data
         list.unshift({
-          id: -1,
+          id: 'default',
           name: 'Default'
         })
         state.workerGroupsListAll = list

+ 0 - 9
dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js

@@ -109,15 +109,6 @@ let menu = {
       icon: 'ans-icon-recycle',
       children: []
     },
-    {
-      name: `${i18n.$t('Worker group manage')}`,
-      id: 4,
-      path: 'worker-groups-manage',
-      isOpen: true,
-      disabled: true,
-      icon: 'ans-icon-diary',
-      children: []
-    },
     {
       name: `${i18n.$t('Token manage')}`,
       id: 2,