diff --git a/models/job.go b/models/job.go index 602e40f..b2e412a 100644 --- a/models/job.go +++ b/models/job.go @@ -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 diff --git a/web/ui/src/components/JobEdit.vue b/web/ui/src/components/JobEdit.vue index 07058e3..e6af17c 100644 --- a/web/ui/src/components/JobEdit.vue +++ b/web/ui/src/components/JobEdit.vue @@ -20,9 +20,15 @@ -
- - +
+
+ + +
+
+ + +
当前任务没有定时器,点击下面按钮来添加定时器 @@ -54,6 +60,7 @@ export default { id: '', name: '', group: 'default', + user: '', cmd: '', pause: false, rules: [] diff --git a/web/ui/src/components/Log.vue b/web/ui/src/components/Log.vue index 0739aca..daf8a16 100644 --- a/web/ui/src/components/Log.vue +++ b/web/ui/src/components/Log.vue @@ -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){