1
0
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:
ibuler 2025-03-24 19:03:44 +08:00 committed by 老广
parent c0ff9a8502
commit a31e2295ee
3 changed files with 30 additions and 4 deletions
src/components
Form/FormFields/CronTab
const.js

View File

@ -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
}

View File

@ -39,6 +39,13 @@ export default {
showCron: false
}
},
watch: {
value: {
handler(val) {
this.crontabFill(val)
}
}
},
methods: {
crontabFill(value) {
//

View File

@ -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 = {