mirror of https://github.com/shunfei/cronsun
添加执行用户
parent
5661cce065
commit
24e3a46d75
|
@ -221,6 +221,8 @@ func (j *Job) Check() error {
|
|||
return ErrIllegalJobGroupName
|
||||
}
|
||||
|
||||
j.User = strings.TrimSpace(j.User)
|
||||
|
||||
// 不修改 Command 的内容,简单判断是否为空
|
||||
if len(strings.TrimSpace(j.Command)) == 0 {
|
||||
return ErrEmptyJobCommand
|
||||
|
|
|
@ -20,10 +20,16 @@
|
|||
<Dropdown title="选择分组" allowAdditions=true v-bind:items="groups" v-bind:selected="job.group" v-on:change="changeGroup"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="fields">
|
||||
<div class="twelve wide field">
|
||||
<label>任务脚本</label>
|
||||
<input type="text" v-model="job.cmd" placeholder="任务脚本">
|
||||
</div>
|
||||
<div class="four wide field">
|
||||
<label>用户(可选)</label>
|
||||
<input type="text" v-model="job.user" placeholder="指定执行脚本的用户">
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<span v-if="!job.rules || job.rules.length == 0"><i class="warning circle icon"></i>当前任务没有定时器,点击下面按钮来添加定时器</span>
|
||||
</div>
|
||||
|
@ -54,6 +60,7 @@ export default {
|
|||
id: '',
|
||||
name: '',
|
||||
group: 'default',
|
||||
user: '',
|
||||
cmd: '',
|
||||
pause: false,
|
||||
rules: []
|
||||
|
|
|
@ -135,7 +135,13 @@ export default {
|
|||
},
|
||||
|
||||
submit: function(){
|
||||
this.$router.push('/log?'+this.buildQuery());
|
||||
var query = this.buildQuery()
|
||||
var url = '/log?'+query;
|
||||
if (this.$router.fullPath == url) {
|
||||
this.fetchList(query);
|
||||
return;
|
||||
}
|
||||
this.$router.push(url);
|
||||
},
|
||||
|
||||
durationAttention: function(beginTime, endTime){
|
||||
|
|
Loading…
Reference in New Issue