Browse Source

add tenant id in process definition

pull/2/head
lenboo 5 years ago
parent
commit
a67bc60872
  1. 11
      escheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue
  2. 5
      escheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue
  3. 7
      escheduler-ui/src/js/conf/home/pages/dag/index.vue
  4. 7
      escheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue
  5. 6
      escheduler-ui/src/js/conf/home/store/dag/actions.js
  6. 7
      escheduler-ui/src/js/conf/home/store/dag/mutations.js
  7. 2
      escheduler-ui/src/js/conf/home/store/dag/state.js
  8. 8
      escheduler-ui/src/js/conf/home/store/security/actions.js
  9. 3
      escheduler-ui/src/js/conf/home/store/security/state.js
  10. 1
      escheduler-ui/src/js/module/i18n/locale/en_US.js
  11. 1
      escheduler-ui/src/js/module/i18n/locale/zh_CN.js

11
escheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue

@ -26,6 +26,10 @@
</div> </div>
</template> </template>
<div class="title" style="padding-top: 6px;">
<span class="text-b">{{$t('select tenant')}}</span>
<form-tenant v-model="tenantId"></form-tenant>
</div>
<div class="title" style="padding-top: 6px;"> <div class="title" style="padding-top: 6px;">
<span>超时告警</span> <span>超时告警</span>
<span style="padding-left: 6px;"> <span style="padding-left: 6px;">
@ -73,6 +77,7 @@
import mLocalParams from '../formModel/tasks/_source/localParams' import mLocalParams from '../formModel/tasks/_source/localParams'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
import Affirm from '../jumpAffirm' import Affirm from '../jumpAffirm'
import FormTenant from "./_source/selectTenant";
export default { export default {
name: 'udp', name: 'udp',
@ -90,6 +95,8 @@
syncDefine: true, syncDefine: true,
// Timeout alarm // Timeout alarm
timeout: 0, timeout: 0,
tenantId: -1,
// checked Timeout alarm // checked Timeout alarm
checkedTimeout: true checkedTimeout: true
} }
@ -116,6 +123,7 @@
this.store.commit('dag/setGlobalParams', _.cloneDeep(this.udpList)) this.store.commit('dag/setGlobalParams', _.cloneDeep(this.udpList))
this.store.commit('dag/setName', _.cloneDeep(this.name)) this.store.commit('dag/setName', _.cloneDeep(this.name))
this.store.commit('dag/setTimeout', _.cloneDeep(this.timeout)) this.store.commit('dag/setTimeout', _.cloneDeep(this.timeout))
this.store.commit('dag/setTenantId', _.cloneDeep(this.tenantId))
this.store.commit('dag/setDesc', _.cloneDeep(this.desc)) this.store.commit('dag/setDesc', _.cloneDeep(this.desc))
this.store.commit('dag/setSyncDefine', this.syncDefine) this.store.commit('dag/setSyncDefine', this.syncDefine)
}, },
@ -181,9 +189,10 @@
this.syncDefine = dag.syncDefine this.syncDefine = dag.syncDefine
this.timeout = dag.timeout || 0 this.timeout = dag.timeout || 0
this.checkedTimeout = this.timeout !== 0 this.checkedTimeout = this.timeout !== 0
this.tenantId = dag.tenantId || -1
}, },
mounted () {}, mounted () {},
components: { mLocalParams } components: {FormTenant, mLocalParams }
} }
</script> </script>

5
escheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue

@ -26,7 +26,7 @@
methods: { methods: {
...mapMutations('dag', ['resetParams', 'setIsDetails']), ...mapMutations('dag', ['resetParams', 'setIsDetails']),
...mapActions('dag', ['getProcessList', 'getResourcesList', 'getProcessDetails']), ...mapActions('dag', ['getProcessList', 'getResourcesList', 'getProcessDetails']),
...mapActions('security', ['getWorkerGroupsAll']), ...mapActions('security', ['getTenantList','getWorkerGroupsAll']),
/** /**
* init * init
*/ */
@ -43,7 +43,8 @@
// get resource // get resource
this.getResourcesList(), this.getResourcesList(),
// get worker group list // get worker group list
this.getWorkerGroupsAll() this.getWorkerGroupsAll(),
this.getTenantList()
]).then((data) => { ]).then((data) => {
let item = data[0] let item = data[0]
this.setIsDetails(item.releaseState === 'ONLINE') this.setIsDetails(item.releaseState === 'ONLINE')

7
escheduler-ui/src/js/conf/home/pages/dag/index.vue

@ -25,7 +25,7 @@
methods: { methods: {
...mapMutations('dag', ['resetParams']), ...mapMutations('dag', ['resetParams']),
...mapActions('dag', ['getProcessList', 'getResourcesList']), ...mapActions('dag', ['getProcessList', 'getResourcesList']),
...mapActions('security', ['getWorkerGroupsAll']), ...mapActions('security', ['getTenantList','getWorkerGroupsAll']),
/** /**
* init * init
*/ */
@ -40,7 +40,8 @@
// get resource // get resource
this.getResourcesList(), this.getResourcesList(),
// get worker group list // get worker group list
this.getWorkerGroupsAll() this.getWorkerGroupsAll(),
this.getTenantList()
]).then((data) => { ]).then((data) => {
this.isLoading = false this.isLoading = false
// Whether to pop up the box? // Whether to pop up the box?
@ -65,4 +66,4 @@
}, },
components: { mDag, mSpin } components: { mDag, mSpin }
} }
</script> </script>

7
escheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue

@ -26,7 +26,7 @@
methods: { methods: {
...mapMutations('dag', ['setIsDetails', 'resetParams']), ...mapMutations('dag', ['setIsDetails', 'resetParams']),
...mapActions('dag', ['getProcessList', 'getResourcesList', 'getInstancedetail']), ...mapActions('dag', ['getProcessList', 'getResourcesList', 'getInstancedetail']),
...mapActions('security', ['getWorkerGroupsAll']), ...mapActions('security', ['getTenantList','getWorkerGroupsAll']),
/** /**
* init * init
*/ */
@ -43,7 +43,8 @@
// get resources // get resources
this.getResourcesList(), this.getResourcesList(),
// get worker group list // get worker group list
this.getWorkerGroupsAll() this.getWorkerGroupsAll(),
this.getTenantList()
]).then((data) => { ]).then((data) => {
let item = data[0] let item = data[0]
let flag = false let flag = false
@ -92,4 +93,4 @@
}, },
components: { mDag, mSpin, mVariable } components: { mDag, mSpin, mVariable }
} }
</script> </script>

6
escheduler-ui/src/js/conf/home/store/dag/actions.js

@ -115,6 +115,7 @@ export default {
// timeout // timeout
state.timeout = processDefinitionJson.timeout state.timeout = processDefinitionJson.timeout
state.tenantId = processDefinitionJson.tenantId
resolve(res.data) resolve(res.data)
}).catch(res => { }).catch(res => {
reject(res) reject(res)
@ -146,6 +147,8 @@ export default {
// timeout // timeout
state.timeout = processInstanceJson.timeout state.timeout = processInstanceJson.timeout
state.tenantId = processInstanceJson.tenantId
resolve(res.data) resolve(res.data)
}).catch(res => { }).catch(res => {
reject(res) reject(res)
@ -160,6 +163,7 @@ export default {
let data = { let data = {
globalParams: state.globalParams, globalParams: state.globalParams,
tasks: state.tasks, tasks: state.tasks,
tenantId: state.tenantId,
timeout: state.timeout timeout: state.timeout
} }
io.post(`projects/${state.projectName}/process/save`, { io.post(`projects/${state.projectName}/process/save`, {
@ -183,6 +187,7 @@ export default {
let data = { let data = {
globalParams: state.globalParams, globalParams: state.globalParams,
tasks: state.tasks, tasks: state.tasks,
tenantId: state.tenantId,
timeout: state.timeout timeout: state.timeout
} }
io.post(`projects/${state.projectName}/process/update`, { io.post(`projects/${state.projectName}/process/update`, {
@ -207,6 +212,7 @@ export default {
let data = { let data = {
globalParams: state.globalParams, globalParams: state.globalParams,
tasks: state.tasks, tasks: state.tasks,
tenantId: state.tenantId,
timeout: state.timeout timeout: state.timeout
} }
io.post(`projects/${state.projectName}/instance/update`, { io.post(`projects/${state.projectName}/instance/update`, {

7
escheduler-ui/src/js/conf/home/store/dag/mutations.js

@ -58,6 +58,12 @@ export default {
setTimeout (state, payload) { setTimeout (state, payload) {
state.timeout = payload state.timeout = payload
}, },
/**
* set tenantId
*/
setTenantId (state, payload) {
state.tenantId = payload
},
/** /**
* set global params * set global params
*/ */
@ -100,6 +106,7 @@ export default {
state.name = payload && payload.name || '' state.name = payload && payload.name || ''
state.desc = payload && payload.desc || '' state.desc = payload && payload.desc || ''
state.timeout = payload && payload.timeout || 0 state.timeout = payload && payload.timeout || 0
state.tenantId = payload && payload.tenantId || -1
state.processListS = payload && payload.processListS || [] state.processListS = payload && payload.processListS || []
state.resourcesListS = payload && payload.resourcesListS || [] state.resourcesListS = payload && payload.resourcesListS || []
state.isDetails = payload && payload.isDetails || false state.isDetails = payload && payload.isDetails || false

2
escheduler-ui/src/js/conf/home/store/dag/state.js

@ -31,6 +31,8 @@ export default {
tasks: [], tasks: [],
// Timeout alarm // Timeout alarm
timeout: 0, timeout: 0,
// tenant id
tenantId:-1,
// Node location information // Node location information
locations: {}, locations: {},
// Node-to-node connection // Node-to-node connection

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

@ -240,7 +240,13 @@ export default {
getTenantList ({ state }, payload) { getTenantList ({ state }, payload) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
io.get(`tenant/list`, payload, res => { io.get(`tenant/list`, payload, res => {
resolve(res.data) let list=res.data
list.unshift({
id: -1,
tenantName: 'Default'
})
state.tenantAllList = list
resolve(list)
}).catch(e => { }).catch(e => {
reject(e) reject(e)
}) })

3
escheduler-ui/src/js/conf/home/store/security/state.js

@ -15,5 +15,6 @@
* limitations under the License. * limitations under the License.
*/ */
export default { export default {
workerGroupsListAll: [] workerGroupsListAll: [],
tenantAllList : []
} }

1
escheduler-ui/src/js/module/i18n/locale/en_US.js

@ -465,4 +465,5 @@ export default {
'task number of ready to kill': '待杀死任务数', 'task number of ready to kill': '待杀死任务数',
'Statistics manage': 'Statistics manage', 'Statistics manage': 'Statistics manage',
'statistics': 'statistics', 'statistics': 'statistics',
'select tenant':'select tenant',
} }

1
escheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -466,4 +466,5 @@ export default {
'task number of ready to kill': '待杀死任务数', 'task number of ready to kill': '待杀死任务数',
'Statistics manage': '统计管理', 'Statistics manage': '统计管理',
'statistics': '统计', 'statistics': '统计',
'select tenant':'选择租户',
} }

Loading…
Cancel
Save