From c4ced4316eb379630134c99e93b1592e8992332d Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Mon, 17 Jun 2019 13:14:51 +0800 Subject: [PATCH] updated crontab --- frontend/src/views/schedule/ScheduleList.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/schedule/ScheduleList.vue b/frontend/src/views/schedule/ScheduleList.vue index 377fe6b7..19b300a3 100644 --- a/frontend/src/views/schedule/ScheduleList.vue +++ b/frontend/src/views/schedule/ScheduleList.vue @@ -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 () {