diff --git a/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue b/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue index f2658d4c6e..389396e397 100644 --- a/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue +++ b/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue @@ -33,7 +33,7 @@
diff --git a/escheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue b/escheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue index a46999ec20..761c2cbb8a 100644 --- a/escheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue +++ b/escheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue @@ -4,6 +4,7 @@
{{$t('Set the DAG diagram name')}}
+
+ + +
+ 超时告警 + + + +
+
+ + + {{$t('Minute')}} + + +
+
{{$t('Set global')}}
@@ -68,7 +85,11 @@ // Global custom parameters udpList: [], // Whether to update the process definition - syncDefine: true + syncDefine: true, + // Timeout alarm + timeout: 0, + // checked Timeout alarm + checkedTimeout: true } }, mixins: [disabledState], @@ -81,6 +102,14 @@ _onLocalParams (a) { this.udpList = a }, + _verifTimeout () { + const reg = /^[1-9]\d*$/ + if (!reg.test(this.timeout)) { + alert(1) + return false + } + return true + }, /** * submit */ @@ -95,9 +124,15 @@ if (!this.$refs.refLocalParams._verifProp()) { return } + // verification timeout + if (!this._verifTimeout()) { + return + } + // Storage global globalParams this.store.commit('dag/setGlobalParams', _.cloneDeep(this.udpList)) this.store.commit('dag/setName', _.cloneDeep(this.name)) + this.store.commit('dag/setTimeout', _.cloneDeep(this.timeout)) this.store.commit('dag/setDesc', _.cloneDeep(this.desc)) this.store.commit('dag/setSyncDefine', this.syncDefine) Affirm.setIsPop(false) @@ -124,12 +159,20 @@ } }, watch: { + checkedTimeout (val) { + if (!val) { + this.timeout = 0 + this.store.commit('dag/setTimeout', _.cloneDeep(this.timeout)) + } + } }, created () { this.udpList = this.store.state.dag.globalParams this.name = this.store.state.dag.name this.desc = this.store.state.dag.desc this.syncDefine = this.store.state.dag.syncDefine + this.timeout = this.store.state.dag.timeout || 0 + this.checkedTimeout = this.timeout !== 0 }, mounted () {}, components: { mLocalParams } diff --git a/escheduler-ui/src/js/conf/home/store/dag/actions.js b/escheduler-ui/src/js/conf/home/store/dag/actions.js index 48610c26f9..0872249d9c 100644 --- a/escheduler-ui/src/js/conf/home/store/dag/actions.js +++ b/escheduler-ui/src/js/conf/home/store/dag/actions.js @@ -112,6 +112,8 @@ export default { state.tasks = processDefinitionJson.tasks // global params state.globalParams = processDefinitionJson.globalParams + // timeout + state.timeout = processDefinitionJson.timeout resolve(res.data) }).catch(res => { @@ -141,6 +143,8 @@ export default { state.tasks = processInstanceJson.tasks // global params state.globalParams = processInstanceJson.globalParams + // timeout + state.timeout = processInstanceJson.timeout resolve(res.data) }).catch(res => { @@ -155,7 +159,8 @@ export default { return new Promise((resolve, reject) => { let data = { globalParams: state.globalParams, - tasks: state.tasks + tasks: state.tasks, + timeout: state.timeout } io.post(`projects/${state.projectName}/process/save`, { processDefinitionJson: JSON.stringify(data), @@ -177,7 +182,8 @@ export default { return new Promise((resolve, reject) => { let data = { globalParams: state.globalParams, - tasks: state.tasks + tasks: state.tasks, + timeout: state.timeout } io.post(`projects/${state.projectName}/process/update`, { processDefinitionJson: JSON.stringify(data), @@ -200,7 +206,8 @@ export default { return new Promise((resolve, reject) => { let data = { globalParams: state.globalParams, - tasks: state.tasks + tasks: state.tasks, + timeout: state.timeout } io.post(`projects/${state.projectName}/instance/update`, { processInstanceJson: JSON.stringify(data), diff --git a/escheduler-ui/src/js/conf/home/store/dag/mutations.js b/escheduler-ui/src/js/conf/home/store/dag/mutations.js index 76816b0521..f15f773327 100644 --- a/escheduler-ui/src/js/conf/home/store/dag/mutations.js +++ b/escheduler-ui/src/js/conf/home/store/dag/mutations.js @@ -52,6 +52,12 @@ export default { setName (state, payload) { state.name = payload }, + /** + * set timeout + */ + setTimeout (state, payload) { + state.timeout = payload + }, /** * set global params */ @@ -93,6 +99,7 @@ export default { state.tasks = payload && payload.tasks || [] state.name = payload && payload.name || '' state.desc = payload && payload.desc || '' + state.timeout = payload && payload.timeout || 0 state.processListS = payload && payload.processListS || [] state.resourcesListS = payload && payload.resourcesListS || [] state.isDetails = payload && payload.isDetails || false diff --git a/escheduler-ui/src/js/conf/home/store/dag/state.js b/escheduler-ui/src/js/conf/home/store/dag/state.js index 6ac387abef..9679893e60 100644 --- a/escheduler-ui/src/js/conf/home/store/dag/state.js +++ b/escheduler-ui/src/js/conf/home/store/dag/state.js @@ -29,6 +29,8 @@ export default { globalParams: [], // Node information tasks: [], + // Timeout alarm + timeout: 0, // Node location information locations: {}, // Node-to-node connection