mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
updated crontab
This commit is contained in:
@@ -119,7 +119,7 @@ export default {
|
||||
for (let i = 0; i < 6; i++) {
|
||||
patArr.push('[/*,0-9-]+')
|
||||
}
|
||||
const pat = '^' + patArr.join(' ') + '$'
|
||||
const pat = '^' + patArr.join(' ') + '( [/*,0-9-]+)?' + '$'
|
||||
if (!value) {
|
||||
callback(new Error('cron cannot be empty'))
|
||||
} else if (!value.match(pat)) {
|
||||
@@ -217,11 +217,18 @@ export default {
|
||||
onCrawl () {
|
||||
},
|
||||
onCrontabFill (value) {
|
||||
value = value.replace(/[?]/g, '*')
|
||||
this.$set(this.scheduleForm, 'cron', value)
|
||||
},
|
||||
onShowCronDialog () {
|
||||
this.showCron = true
|
||||
this.expression = this.scheduleForm.cron
|
||||
if (this.expression.split(' ').length < 7) {
|
||||
// this.expression = (this.scheduleForm.cron + ' ').replace(/[?]/g, '*')
|
||||
this.expression = this.scheduleForm.cron + ' '
|
||||
} else {
|
||||
// this.expression = this.scheduleForm.cron.replace(/[?]/g, '*')
|
||||
this.expression = this.scheduleForm.cron
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
|
||||
Reference in New Issue
Block a user