Browse Source

超时告警

pull/2/head
gongzijian 6 years ago
parent
commit
1b5bec660b
  1. 2
      escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue
  2. 45
      escheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue
  3. 13
      escheduler-ui/src/js/conf/home/store/dag/actions.js
  4. 7
      escheduler-ui/src/js/conf/home/store/dag/mutations.js
  5. 2
      escheduler-ui/src/js/conf/home/store/dag/state.js

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

@ -33,7 +33,7 @@
</div> </div>
<div class="cont-box"> <div class="cont-box">
<label class="label-box"> <label class="label-box">
<x-input v-model="interval" style="width: 128px;" :disabled="isDetails"> <x-input v-model="interval" style="width: 128px;" :disabled="isDetails" maxlength="9">
<span slot="append">{{$t('Minute')}}</span> <span slot="append">{{$t('Minute')}}</span>
</x-input> </x-input>
</label> </label>

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

@ -4,6 +4,7 @@
<div class="title"> <div class="title">
<span>{{$t('Set the DAG diagram name')}}</span> <span>{{$t('Set the DAG diagram name')}}</span>
</div> </div>
<div> <div>
<x-input <x-input
type="text" type="text"
@ -12,6 +13,7 @@
:placeholder="$t('Please enter name(required)')"> :placeholder="$t('Please enter name(required)')">
</x-input> </x-input>
</div> </div>
<template v-if="router.history.current.name !== 'projects-instance-details'"> <template v-if="router.history.current.name !== 'projects-instance-details'">
<div style="padding-top: 12px;"> <div style="padding-top: 12px;">
<x-input <x-input
@ -23,6 +25,21 @@
</x-input> </x-input>
</div> </div>
</template> </template>
<div class="title" style="padding-top: 6px;">
<span>超时告警</span>
<span style="padding-left: 6px;">
<x-switch v-model="checkedTimeout"></x-switch>
</span>
</div>
<div class="content" style="padding-bottom: 10px;" v-if="checkedTimeout">
<span>
<x-input v-model="timeout" style="width: 128px;" maxlength="9">
<span slot="append">{{$t('Minute')}}</span>
</x-input>
</span>
</div>
<div class="title" style="padding-top: 6px;"> <div class="title" style="padding-top: 6px;">
<span>{{$t('Set global')}}</span> <span>{{$t('Set global')}}</span>
</div> </div>
@ -68,7 +85,11 @@
// Global custom parameters // Global custom parameters
udpList: [], udpList: [],
// Whether to update the process definition // Whether to update the process definition
syncDefine: true syncDefine: true,
// Timeout alarm
timeout: 0,
// checked Timeout alarm
checkedTimeout: true
} }
}, },
mixins: [disabledState], mixins: [disabledState],
@ -81,6 +102,14 @@
_onLocalParams (a) { _onLocalParams (a) {
this.udpList = a this.udpList = a
}, },
_verifTimeout () {
const reg = /^[1-9]\d*$/
if (!reg.test(this.timeout)) {
alert(1)
return false
}
return true
},
/** /**
* submit * submit
*/ */
@ -95,9 +124,15 @@
if (!this.$refs.refLocalParams._verifProp()) { if (!this.$refs.refLocalParams._verifProp()) {
return return
} }
// verification timeout
if (!this._verifTimeout()) {
return
}
// Storage global globalParams // Storage global globalParams
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/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)
Affirm.setIsPop(false) Affirm.setIsPop(false)
@ -124,12 +159,20 @@
} }
}, },
watch: { watch: {
checkedTimeout (val) {
if (!val) {
this.timeout = 0
this.store.commit('dag/setTimeout', _.cloneDeep(this.timeout))
}
}
}, },
created () { created () {
this.udpList = this.store.state.dag.globalParams this.udpList = this.store.state.dag.globalParams
this.name = this.store.state.dag.name this.name = this.store.state.dag.name
this.desc = this.store.state.dag.desc this.desc = this.store.state.dag.desc
this.syncDefine = this.store.state.dag.syncDefine this.syncDefine = this.store.state.dag.syncDefine
this.timeout = this.store.state.dag.timeout || 0
this.checkedTimeout = this.timeout !== 0
}, },
mounted () {}, mounted () {},
components: { mLocalParams } components: { mLocalParams }

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

@ -112,6 +112,8 @@ export default {
state.tasks = processDefinitionJson.tasks state.tasks = processDefinitionJson.tasks
// global params // global params
state.globalParams = processDefinitionJson.globalParams state.globalParams = processDefinitionJson.globalParams
// timeout
state.timeout = processDefinitionJson.timeout
resolve(res.data) resolve(res.data)
}).catch(res => { }).catch(res => {
@ -141,6 +143,8 @@ export default {
state.tasks = processInstanceJson.tasks state.tasks = processInstanceJson.tasks
// global params // global params
state.globalParams = processInstanceJson.globalParams state.globalParams = processInstanceJson.globalParams
// timeout
state.timeout = processInstanceJson.timeout
resolve(res.data) resolve(res.data)
}).catch(res => { }).catch(res => {
@ -155,7 +159,8 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let data = { let data = {
globalParams: state.globalParams, globalParams: state.globalParams,
tasks: state.tasks tasks: state.tasks,
timeout: state.timeout
} }
io.post(`projects/${state.projectName}/process/save`, { io.post(`projects/${state.projectName}/process/save`, {
processDefinitionJson: JSON.stringify(data), processDefinitionJson: JSON.stringify(data),
@ -177,7 +182,8 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let data = { let data = {
globalParams: state.globalParams, globalParams: state.globalParams,
tasks: state.tasks tasks: state.tasks,
timeout: state.timeout
} }
io.post(`projects/${state.projectName}/process/update`, { io.post(`projects/${state.projectName}/process/update`, {
processDefinitionJson: JSON.stringify(data), processDefinitionJson: JSON.stringify(data),
@ -200,7 +206,8 @@ export default {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let data = { let data = {
globalParams: state.globalParams, globalParams: state.globalParams,
tasks: state.tasks tasks: state.tasks,
timeout: state.timeout
} }
io.post(`projects/${state.projectName}/instance/update`, { io.post(`projects/${state.projectName}/instance/update`, {
processInstanceJson: JSON.stringify(data), processInstanceJson: JSON.stringify(data),

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

@ -52,6 +52,12 @@ export default {
setName (state, payload) { setName (state, payload) {
state.name = payload state.name = payload
}, },
/**
* set timeout
*/
setTimeout (state, payload) {
state.timeout = payload
},
/** /**
* set global params * set global params
*/ */
@ -93,6 +99,7 @@ export default {
state.tasks = payload && payload.tasks || [] state.tasks = payload && payload.tasks || []
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.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

@ -29,6 +29,8 @@ export default {
globalParams: [], globalParams: [],
// Node information // Node information
tasks: [], tasks: [],
// Timeout alarm
timeout: 0,
// Node location information // Node location information
locations: {}, locations: {},
// Node-to-node connection // Node-to-node connection

Loading…
Cancel
Save