mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-28 17:50:56 +01:00
优化配置Cron
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.cron-wrapper {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.el-tabs {
|
||||
box-shadow: none;
|
||||
}
|
||||
@@ -41,7 +45,14 @@
|
||||
</style>
|
||||
<template>
|
||||
<div id="change-crontab">
|
||||
<!-- <el-button class="language" type="text" @click="i18n=(i18n==='en'?'cn':'en')">{{i18n}}</el-button>-->
|
||||
<div class="cron-wrapper">
|
||||
<label>
|
||||
{{$t('Cron Expression')}}:
|
||||
</label>
|
||||
<el-tag type="success" size="small">
|
||||
{{cron}}
|
||||
</el-tag>
|
||||
</div>
|
||||
<el-tabs type="border-card">
|
||||
<el-tab-pane>
|
||||
<span slot="label"><i class="el-icon-date"></i> {{text.Minutes.name}}</span>
|
||||
@@ -388,9 +399,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getValue () {
|
||||
return this.cron
|
||||
},
|
||||
change () {
|
||||
this.$emit('change', this.cron)
|
||||
this.close()
|
||||
@@ -398,6 +406,22 @@ export default {
|
||||
close () {
|
||||
this.$emit('close')
|
||||
},
|
||||
submit () {
|
||||
if (!this.validate()) {
|
||||
this.$message.error(this.$t('Cron expression is invalid'))
|
||||
return false
|
||||
}
|
||||
this.$emit('submit', this.cron)
|
||||
return true
|
||||
},
|
||||
validate () {
|
||||
if (!this.minutesText) return false
|
||||
if (!this.hoursText) return false
|
||||
if (!this.daysText) return false
|
||||
if (!this.monthsText) return false
|
||||
if (!this.weeksText) return false
|
||||
return true
|
||||
},
|
||||
updateCronItem (key, value) {
|
||||
if (value === undefined) {
|
||||
this[key].cronEvery = '0'
|
||||
|
||||
Reference in New Issue
Block a user