Browse Source

Merge pull request #24 from apache/refactor-worker

Refactor worker
pull/2/head
Tboy 5 years ago committed by GitHub
parent
commit
645529e4cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/workerGroups.vue
  2. 18
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
  3. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/startingParam/index.vue
  4. 6
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/_source/selectTenant.vue
  5. 6
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue
  6. 8
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue
  7. 8
      dolphinscheduler-ui/src/js/conf/home/router/index.js
  8. 2
      dolphinscheduler-ui/src/js/conf/home/store/dag/actions.js
  9. 2
      dolphinscheduler-ui/src/js/conf/home/store/security/actions.js
  10. 9
      dolphinscheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js

4
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: {

18
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
}
}
},

2
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>

6
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: {

6
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') {

8
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)

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',

2
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)

2
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

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,

Loading…
Cancel
Save