任务添加超时和并行允许数量

pull/1/head
Doflatango 8 years ago committed by miraclesu
parent fe3dfd4429
commit c78714081e

@ -32,6 +32,8 @@ type Job struct {
User string `json:"user"`
Rules []*JobRule `json:"rules"`
Pause bool `json:"pause"` // 可手工控制的状态
Timeout int64 `json:"timeout"` // 任务执行时间超时设置,大于 0 时有效
Parallels int `json:"parallels"` // 设置任务在单个节点上可以同时允许多少个,针对两次任务执行间隔比任务执行时间要长的任务启用
// 执行任务的结点,用于记录 job log
runOn string

@ -31,6 +31,19 @@
<input v-else type="text" v-model="job.user" placeholder="指定执行用户">
</div>
</div>
<div class="two fields">
<div class="field">
<label>超时设置单位0 表示不限制</label>
<input type="number" ref="timeout" v-model:value="job.timeout" placeholder="任务执行超时时间">
</div>
<div class="field">
<label>并行数设置0 表示不限制</label>
<div class="ui icon input">
<input type="number" ref="parallels" v-model:value="job.parallels" placeholder="任务执行超时时间">
<i ref="parallelstip" class="large help circle link icon" data-position="top right" data-content="" data-variation="wide"></i>
</div>
</div>
</div>
<div class="field">
<span v-if="!job.rules || job.rules.length == 0"><i class="warning circle icon"></i></span>
</div>
@ -66,6 +79,8 @@ export default {
user: '',
cmd: '',
pause: false,
parallels: 0,
timeout: 0,
rules: []
},
error: ''
@ -157,6 +172,8 @@ export default {
vm.job.pause = !vm.job.pause;
}
});
$(this.$refs.parallelstip).popup();
},
components: {

Loading…
Cancel
Save