mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 14:25:23 +00:00
fix: Job create cannot be saved without setting interval
This commit is contained in:
@@ -4,10 +4,12 @@ import InputWithUnit from '@/components/Form/FormFields/InputWithUnit.vue'
|
|||||||
import store from '@/store'
|
import store from '@/store'
|
||||||
|
|
||||||
const validatorInterval = (rule, value, callback) => {
|
const validatorInterval = (rule, value, callback) => {
|
||||||
if (isNaN(parseInt(value, 10)) || parseInt(value) < 1) {
|
// value只能是 null 或者 >=1
|
||||||
return callback(new Error(i18n.t('EnsureThisValueIsGreaterThanOrEqualTo1')))
|
if (value === null || (!isNaN(value) && Number(value) >= 1)) {
|
||||||
|
callback()
|
||||||
|
} else {
|
||||||
|
callback(new Error(i18n.t('EnsureThisValueIsGreaterThanOrEqualTo1')))
|
||||||
}
|
}
|
||||||
callback()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const crontab = {
|
export const crontab = {
|
||||||
|
Reference in New Issue
Block a user