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