Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: '周一',
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: '周一',
Expand Down
6 changes: 2 additions & 4 deletions frontend/src/views/cronjob/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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} * * * *`;
Expand Down Expand Up @@ -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] !== '*') {
Expand Down
Loading