mirror of
https://github.com/jumpserver/lina.git
synced 2025-05-12 18:16:24 +00:00
perf: update crontab update
This commit is contained in:
parent
c0ff9a8502
commit
a31e2295ee
src/components
@ -361,9 +361,10 @@ export default {
|
||||
},
|
||||
// 填充表达式
|
||||
submitFill() {
|
||||
const minMinutes = 60
|
||||
const crontabDiffMin = this.crontabDiff / 1000 / 60
|
||||
if (crontabDiffMin > 0 && crontabDiffMin < 10) {
|
||||
const msg = this.$tc('CrontabDiffError')
|
||||
if (crontabDiffMin > 0 && crontabDiffMin < minMinutes) {
|
||||
const msg = this.$t('CrontabDiffError', { minutes: minMinutes })
|
||||
this.$message.error(msg)
|
||||
return
|
||||
}
|
||||
|
@ -39,6 +39,13 @@ export default {
|
||||
showCron: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(val) {
|
||||
this.crontabFill(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
crontabFill(value) {
|
||||
// 确定后回传的值
|
||||
|
@ -38,10 +38,20 @@ export const crontab = {
|
||||
return formValue.is_periodic === false
|
||||
},
|
||||
helpText: i18n.t('CrontabHelpText'),
|
||||
helpTip: i18n.t('CrontabHelpTip')
|
||||
helpTip: i18n.t('CrontabHelpTip'),
|
||||
on: {
|
||||
change: (val, updateForm) => {
|
||||
updateForm({
|
||||
interval: ''
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const validatorInterval = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
return callback()
|
||||
}
|
||||
if (parseInt(value) < 1) {
|
||||
return callback(new Error(i18n.t('EnsureThisValueIsGreaterThanOrEqualTo1')))
|
||||
}
|
||||
@ -59,7 +69,15 @@ export const interval = {
|
||||
},
|
||||
rules: [
|
||||
{ validator: validatorInterval }
|
||||
]
|
||||
],
|
||||
on: {
|
||||
input: (val, updateForm) => {
|
||||
console.log('interval input', val)
|
||||
updateForm({
|
||||
crontab: ''
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const is_periodic = {
|
||||
|
Loading…
Reference in New Issue
Block a user