Browse Source

worker分组

pull/2/head
gongzijian 6 years ago
parent
commit
a5c5f8a33f
  1. 2
      escheduler-ui/.env
  2. 17
      escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/workerGroups.vue
  3. 2
      escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
  4. 14
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue
  5. 61
      escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue
  6. 21
      escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue
  7. 18
      escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue
  8. 9
      escheduler-ui/src/js/conf/home/store/security/actions.js
  9. 36
      escheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js

2
escheduler-ui/.env

@ -1,6 +1,6 @@
# 后端接口地址 # 后端接口地址
API_BASE = http://192.168.220.247:12345 API_BASE = http://192.168.220.154:12345
# 本地开发如需ip访问项目把"#"号去掉 # 本地开发如需ip访问项目把"#"号去掉
#DEV_HOST = 192.168.xx.xx #DEV_HOST = 192.168.xx.xx

17
escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/workerGroups.vue

@ -22,7 +22,10 @@
}, },
mixins: [disabledState], mixins: [disabledState],
props: { props: {
value: Number value: {
type: Number,
default: -1
}
}, },
model: { model: {
prop: 'value', prop: 'value',
@ -37,9 +40,15 @@
watch: { watch: {
}, },
created () { created () {
this.workerGroupsList = this.store.state.security.workerGroupsListAll || [] let stateWorkerGroupsList = this.store.state.security.workerGroupsListAll || []
if (!this.value) { if (stateWorkerGroupsList.length) {
this.$emit('workerGroupsEvent', this.workerGroupsList[0].id) this.workerGroupsList = stateWorkerGroupsList
} else {
this.store.dispatch('security/getWorkerGroupsAll').then(res => {
this.$nextTick(() => {
this.workerGroupsList = res
})
})
} }
} }
} }

2
escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue

@ -221,7 +221,7 @@
// Task priority // Task priority
taskInstancePriority: 'MEDIUM', taskInstancePriority: 'MEDIUM',
// worker group id // worker group id
workerGroupId: null workerGroupId: -1
} }
}, },
/** /**

14
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue

@ -1,13 +1,13 @@
<template> <template>
<m-list-construction :title="$t('Service-Master')"> <m-list-construction :title="$t('Service-Master')">
<template slot="content"> <template slot="content">
<template v-if="masterList.length"> <div class="servers-wrapper">
<m-list :list="masterList"></m-list> <div class="row">
</template> <div class="col-md-4">.col-md-8</div>
<template v-if="!masterList.length"> <div class="col-md-4">.col-md-4</div>
<m-no-data></m-no-data> <div class="col-md-4">.col-md-4</div>
</template> </div>
<m-spin :is-spin="isLoading" ></m-spin> </div>
</template> </template>
</m-list-construction> </m-list-construction>
</template> </template>

61
escheduler-ui/src/js/conf/home/pages/monitor/pages/servers/zookeeper.vue

@ -1,40 +1,49 @@
<template> <template>
<div class="zookeeper-model"> <m-list-construction :title="$t('Service-Master')">
zookeeper <template slot="content">
</div> <template v-if="masterList.length">
<m-list :list="masterList"></m-list>
</template>
<template v-if="!masterList.length">
<m-no-data></m-no-data>
</template>
<m-spin :is-spin="isLoading" ></m-spin>
</template>
</m-list-construction>
</template> </template>
<script> <script>
import { mapActions } from 'vuex'
import mList from './_source/list'
import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
name: 'zookeeper', name: 'servers-zookeeper',
data () { data () {
return {} return {
pageSize: 10,
pageNo: 1,
totalPage: null,
searchVal: '',
isLoading: false,
masterList: []
}
}, },
props: {}, props: {},
methods: {}, methods: {
watch: {}, ...mapActions('security', ['getProcessMasterList'])
beforeCreate () {
}, },
watch: {},
created () { created () {
}, this.isLoading = true
beforeMount () { this.getProcessMasterList().then(res => {
this.masterList = res.data
this.isLoading = false
})
}, },
mounted () { mounted () {
}, },
beforeUpdate () { components: { mList, mListConstruction, mSpin, mNoData }
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: {}
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss">
.zookeeper-model {
}
</style>

21
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue

@ -14,11 +14,11 @@
</x-radio-group> </x-radio-group>
</div> </div>
</div> </div>
<div class="clearfix list" v-if="sourceType === 'contextmenu'"> <div class="clearfix list" v-if="sourceType === 'contextmenu'" style="margin-top: -8px;">
<div class="text"> <div class="text">
{{$t('Node execution')}} {{$t('Node execution')}}
</div> </div>
<div class="cont"> <div class="cont" style="padding-top: 6px;">
<x-radio-group v-model="taskDependType"> <x-radio-group v-model="taskDependType">
<x-radio :label="'TASK_POST'">{{$t('Backward execution')}}</x-radio> <x-radio :label="'TASK_POST'">{{$t('Backward execution')}}</x-radio>
<x-radio :label="'TASK_PRE'">{{$t('Forward execution')}}</x-radio> <x-radio :label="'TASK_PRE'">{{$t('Forward execution')}}</x-radio>
@ -49,6 +49,14 @@
<m-priority v-model="processInstancePriority"></m-priority> <m-priority v-model="processInstancePriority"></m-priority>
</div> </div>
</div> </div>
<div class="clearfix list">
<div class="text">
Worker分组
</div>
<div class="cont">
<m-worker-groups v-model="workerGroupId"></m-worker-groups>
</div>
</div>
<div class="clearfix list"> <div class="clearfix list">
<div class="text"> <div class="text">
{{$t('Notification group')}} {{$t('Notification group')}}
@ -140,6 +148,7 @@
import store from '@/conf/home/store' import store from '@/conf/home/store'
import { warningTypeList } from './util' import { warningTypeList } from './util'
import mPriority from '@/module/components/priority/priority' import mPriority from '@/module/components/priority/priority'
import mWorkerGroups from '@/conf/home/pages/dag/_source/formModel/_source/workerGroups'
export default { export default {
name: 'start-process', name: 'start-process',
@ -159,7 +168,8 @@
receivers: [], receivers: [],
receiversCc: [], receiversCc: [],
runMode: 'RUN_MODE_SERIAL', runMode: 'RUN_MODE_SERIAL',
processInstancePriority: 'MEDIUM' processInstancePriority: 'MEDIUM',
workerGroupId: -1
} }
}, },
props: { props: {
@ -188,7 +198,8 @@
runMode: this.runMode, runMode: this.runMode,
processInstancePriority: this.processInstancePriority, processInstancePriority: this.processInstancePriority,
receivers: this.receivers.join(',') || '', receivers: this.receivers.join(',') || '',
receiversCc: this.receiversCc.join(',') || '' receiversCc: this.receiversCc.join(',') || '',
workerGroupId: this.workerGroupId
} }
// Executed from the specified node // Executed from the specified node
if (this.sourceType === 'contextmenu') { if (this.sourceType === 'contextmenu') {
@ -251,7 +262,7 @@
}) })
}, },
computed: {}, computed: {},
components: { mEmail, mPriority } components: { mEmail, mPriority, mWorkerGroups }
} }
</script> </script>

18
escheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue

@ -79,6 +79,14 @@
<m-priority v-model="processInstancePriority"></m-priority> <m-priority v-model="processInstancePriority"></m-priority>
</div> </div>
</div> </div>
<div class="clearfix list">
<div class="text">
Worker分组
</div>
<div class="cont">
<m-worker-groups v-model="workerGroupId"></m-worker-groups>
</div>
</div>
<div class="clearfix list"> <div class="clearfix list">
<div class="text"> <div class="text">
{{$t('Notification group')}} {{$t('Notification group')}}
@ -133,6 +141,7 @@
import { vCrontab } from '~/@vue/crontab/dist' import { vCrontab } from '~/@vue/crontab/dist'
import { formatDate } from '@/module/filter/filter' import { formatDate } from '@/module/filter/filter'
import mPriority from '@/module/components/priority/priority' import mPriority from '@/module/components/priority/priority'
import mWorkerGroups from '@/conf/home/pages/dag/_source/formModel/_source/workerGroups'
export default { export default {
name: 'timing-process', name: 'timing-process',
@ -152,7 +161,8 @@
receivers: [], receivers: [],
receiversCc: [], receiversCc: [],
i18n: i18n.globalScope.LOCALE, i18n: i18n.globalScope.LOCALE,
processInstancePriority: 'MEDIUM' processInstancePriority: 'MEDIUM',
workerGroupId: -1
} }
}, },
props: { props: {
@ -190,7 +200,8 @@
processInstancePriority: this.processInstancePriority, processInstancePriority: this.processInstancePriority,
warningGroupId: _.isEmpty(this.warningGroupId) ? 0 : this.warningGroupId.id, warningGroupId: _.isEmpty(this.warningGroupId) ? 0 : this.warningGroupId.id,
receivers: this.receivers.join(',') || '', receivers: this.receivers.join(',') || '',
receiversCc: this.receiversCc.join(',') || '' receiversCc: this.receiversCc.join(',') || '',
workerGroupId: this.workerGroupId
} }
let msg = '' let msg = ''
@ -255,6 +266,7 @@
this.failureStrategy = item.failureStrategy this.failureStrategy = item.failureStrategy
this.warningType = item.warningType this.warningType = item.warningType
this.processInstancePriority = item.processInstancePriority this.processInstancePriority = item.processInstancePriority
this.workerGroupId = item.workerGroupId || -1
this._getNotifyGroupList().then(() => { this._getNotifyGroupList().then(() => {
this.$nextTick(() => { this.$nextTick(() => {
let list = _.filter(this.notifyGroupList, v => v.id === item.warningGroupId) let list = _.filter(this.notifyGroupList, v => v.id === item.warningGroupId)
@ -269,7 +281,7 @@
}).catch(() => this.warningGroupId = { id: 0 }) }).catch(() => this.warningGroupId = { id: 0 })
} }
}, },
components: { vCrontab, mEmail, mPriority } components: { vCrontab, mEmail, mPriority, mWorkerGroups }
} }
</script> </script>

9
escheduler-ui/src/js/conf/home/store/security/actions.js

@ -432,8 +432,13 @@ export default {
getWorkerGroupsAll ({ state }, payload) { getWorkerGroupsAll ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get(`worker-group/all-groups`, payload, res => { io.get(`worker-group/all-groups`, payload, res => {
state.workerGroupsListAll = res.data let list = res.data
resolve(res.data) list.unshift({
id: -1,
name: 'All'
})
state.workerGroupsListAll = list
resolve(list)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
}) })

36
escheduler-ui/src/js/module/components/secondaryMenu/_source/menu.js

@ -202,30 +202,30 @@ let menu = {
id: 1, id: 1,
disabled: true disabled: true
}, },
{ // {
name: 'Alert', // name: 'Alert',
path: 'servers-alert', // path: 'servers-alert',
id: 2, // id: 2,
disabled: true // disabled: true
}, // },
{ // {
name: 'RpcServer', // name: 'RpcServer',
path: 'servers-rpcserver', // path: 'servers-rpcserver',
id: 3, // id: 3,
disabled: true // disabled: true
}, // },
{ {
name: 'Zookeeper', name: 'Zookeeper',
path: 'servers-zookeeper', path: 'servers-zookeeper',
id: 4, id: 4,
disabled: true disabled: true
}, },
{ // {
name: 'ApiServer', // name: 'ApiServer',
path: 'servers-apiserver', // path: 'servers-apiserver',
id: 5, // id: 5,
disabled: true // disabled: true
}, // },
{ {
name: 'Mysql', name: 'Mysql',
path: 'servers-mysql', path: 'servers-mysql',

Loading…
Cancel
Save