Browse Source

fix: 解决计划任务执行周期错误的问题 (#5412)

Refs #5404
pull/5425/head
ssongliu 5 months ago committed by GitHub
parent
commit
05e62a6f94
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      frontend/src/lang/modules/tw.ts
  2. 10
      frontend/src/lang/modules/zh.ts
  3. 6
      frontend/src/views/cronjob/helper.ts

10
frontend/src/lang/modules/tw.ts

@ -827,12 +827,12 @@ const message = {
perMonth: '每月',
perWeek: '每周',
perHour: '每小時',
perNDay: ' N ',
perNDay: ' N ',
perDay: '每天',
perNHour: ' N ',
perNMinute: ' N 分鐘',
perNSecond: ' N ',
per: '每隔',
perNHour: ' N ',
perNMinute: ' N 分鐘',
perNSecond: ' N ',
per: '每',
handle: '執行',
day: '日',
monday: '周一',

10
frontend/src/lang/modules/zh.ts

@ -828,12 +828,12 @@ const message = {
perMonth: '每月',
perWeek: '每周',
perHour: '每小时',
perNDay: ' N ',
perNDay: ' N ',
perDay: '每天',
perNHour: ' N ',
perNMinute: ' N 分钟',
perNSecond: ' N ',
per: '每隔',
perNHour: ' N ',
perNMinute: ' N 分钟',
perNSecond: ' N ',
per: '每',
handle: '执行',
day: '日',
monday: '周一',

6
frontend/src/views/cronjob/helper.ts

@ -92,12 +92,10 @@ export function transObjToSpec(specType: string, week, day, hour, minute, second
case 'perWeek':
return `${minute} ${hour} * * ${week}`;
case 'perNDay':
day = Number(day) + 1 + '';
return `${minute} ${hour} */${day} * *`;
case 'perDay':
return `${minute} ${hour} * * *`;
case 'perNHour':
hour = Number(hour) + 1 + '';
return `${minute} */${hour} * * *`;
case 'perHour':
return `${minute} * * * *`;
@ -141,13 +139,13 @@ export function transSpecToObj(spec: string) {
}
if (specs[1].indexOf('*/') !== -1) {
specItem.specType = 'perNHour';
specItem.hour = Number(specs[1].replaceAll('*/', '')) - 1;
specItem.hour = Number(specs[1].replaceAll('*/', ''));
return specItem;
}
specItem.hour = Number(specs[1]);
if (specs[2].indexOf('*/') !== -1) {
specItem.specType = 'perNDay';
specItem.day = Number(specs[2].replaceAll('*/', '')) - 1;
specItem.day = Number(specs[2].replaceAll('*/', ''));
return specItem;
}
if (specs[2] !== '*') {

Loading…
Cancel
Save