提交 a5c5f8a3 编写于 作者: G gongzijian

worker分组

上级 ef76a868
# 后端接口地址 # 后端接口地址
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
...@@ -22,7 +22,10 @@ ...@@ -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 @@ ...@@ -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
})
})
} }
} }
} }
......
...@@ -221,7 +221,7 @@ ...@@ -221,7 +221,7 @@
// Task priority // Task priority
taskInstancePriority: 'MEDIUM', taskInstancePriority: 'MEDIUM',
// worker group id // worker group id
workerGroupId: null workerGroupId: -1
} }
}, },
/** /**
......
<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>
......
<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>
...@@ -14,11 +14,11 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -251,7 +262,7 @@
}) })
}, },
computed: {}, computed: {},
components: { mEmail, mPriority } components: { mEmail, mPriority, mWorkerGroups }
} }
</script> </script>
......
...@@ -79,6 +79,14 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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>
......
...@@ -432,8 +432,13 @@ export default { ...@@ -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)
}) })
......
...@@ -202,30 +202,30 @@ let menu = { ...@@ -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',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册