Skip to content

Commit

Permalink
feat: Optimize the display of scheduled task execution cycles
Browse files Browse the repository at this point in the history
  • Loading branch information
ssongliu committed Dec 30, 2024
1 parent c13387b commit 03a797a
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 49 deletions.
13 changes: 10 additions & 3 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,14 @@ const message = {
retainCopiesHelper1: 'Number of copies to retain for backup files',
retainCopiesUnit: ' copies (View)',
cronSpecRule: 'The execution period format in line {0} is incorrect. Please check and try again!',
perMonthHelper: 'Execute on the {0} day of every month at {1}:{2}',
perWeekHelper: 'Execute every week on {0} at {1}:{2}',
perDayHelper: 'Execute every day at {0}:{1}',
perHourHelper: 'Execute every hour at {0} minutes',
perNDayHelper: 'Execute every {0} days at {1}:{2}',
perNHourHelper: 'Execute every {0} hours at {1}',
perNMinuteHelper: 'Execute every {0} minutes',
perNSecondHelper: 'Execute every {0} seconds',
perMonth: 'Every month',
perWeek: 'Every week',
perHour: 'Every hour',
Expand All @@ -931,8 +939,6 @@ const message = {
perNHour: 'Every N hour(s)',
perNMinute: 'Every N minute(s)',
perNSecond: 'Every N second(s)',
per: 'Every ',
handle: '',
day: 'day(s)',
dayUnit: 'd',
monday: 'Monday',
Expand Down Expand Up @@ -1693,7 +1699,8 @@ const message = {
backupRecoverMessage: 'Please enter the compression or decompression password (leave blank to not set)',
},
license: {
community: 'Free',
community: 'OSS',
oss: 'Open Source Software',
pro: 'Pro',
trial: 'Trial',
office: 'Official',
Expand Down
13 changes: 10 additions & 3 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,14 @@ const message = {
retainCopiesHelper1: 'Количество копий для сохранения файлов резервных копий',
retainCopiesUnit: ' копий (Просмотр)',
cronSpecRule: 'Формат периода выполнения в строке {0} неверен. Пожалуйста, проверьте и попробуйте снова!',
perMonthHelper: 'Выполнять {0} числа каждого месяца в {1}:{2}',
perWeekHelper: 'Выполнять каждую неделю в {0} в {1}:{2}',
perDayHelper: 'Выполнять каждый день в {0}:{1}',
perHourHelper: 'Выполнять каждый час в {0} минут',
perNDayHelper: 'Выполнять каждые {0} дней в {1}:{2}',
perNHourHelper: 'Выполнять каждые {0} часов в {1}',
perNMinuteHelper: 'Выполнять каждые {0} минут',
perNSecondHelper: 'Выполнять каждые {0} секунд',
perMonth: 'Каждый месяц',
perWeek: 'Каждую неделю',
perHour: 'Каждый час',
Expand All @@ -937,8 +945,6 @@ const message = {
perNHour: 'Каждые N часов',
perNMinute: 'Каждые N минут',
perNSecond: 'Каждые N секунд',
per: 'Каждые ',
handle: '',
day: 'дней',
dayUnit: 'д',
monday: 'Понедельник',
Expand Down Expand Up @@ -1706,7 +1712,8 @@ const message = {
ожалуйста, введите пароль для сжатия или распаковки (оставьте пустым, чтобы не устанавливать)',
},
license: {
community: 'Free',
community: 'OSS',
oss: 'Open Source Software',
pro: 'Pro',
trial: 'Trial',
office: 'Official',
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/lang/modules/tw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,14 @@ const message = {
retainCopiesHelper1: '備份文件保留份數',
retainCopiesUnit: ' (查看)',
cronSpecRule: '第 {0} 行中執行週期格式錯誤請檢查後重試!',
perMonthHelper: '每 {0} {1}:{2} 執行',
perWeekHelper: '每 {0} {1}:{2} 執行',
perDayHelper: '每 {0}:{1} 執行',
perHourHelper: '每小時 {0} 執行',
perNDayHelper: '每 {0} {1}:{2} 執行',
perNHourHelper: '每 {0}小時 {1} 執行',
perNMinuteHelper: '每 {0} 執行',
perNSecondHelper: '每 {0} 執行',
perMonth: '每',
perWeek: '每',
perHour: '每小時',
Expand All @@ -886,8 +894,6 @@ const message = {
perNHour: '每 N ',
perNMinute: '每 N 分鐘',
perNSecond: '每 N ',
per: '每',
handle: '執',
day: '日',
dayUnit: '日',
monday: '週',
Expand Down Expand Up @@ -1584,6 +1590,7 @@ const message = {
},
license: {
community: '社區版',
oss: '社區版',
pro: '專業版',
trial: '試用版',
office: '正式版',
Expand Down
11 changes: 9 additions & 2 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,14 @@ const message = {
retainCopiesHelper1: '备份文件保留份数',
retainCopiesUnit: ' (查看)',
cronSpecRule: '第 {0} 行中执行周期格式错误请检查后重试!',
perMonthHelper: '每 {0} {1}:{2} 执行',
perWeekHelper: '每 {0} {1}:{2} 执行',
perDayHelper: '每 {0}:{1} 执行',
perHourHelper: '每小时 {0} 执行',
perNDayHelper: '每 {0} {1}:{2} 执行',
perNHourHelper: '每 {0}小时 {1} 执行',
perNMinuteHelper: '每 {0} 执行',
perNSecondHelper: '每 {0} 执行',
perMonth: '每',
perWeek: '每',
perHour: '每小时',
Expand All @@ -886,8 +894,6 @@ const message = {
perNHour: '每 N ',
perNMinute: '每 N 分钟',
perNSecond: '每 N ',
per: '每',
handle: '执',
day: '日',
dayUnit: '日',
monday: '周',
Expand Down Expand Up @@ -1584,6 +1590,7 @@ const message = {
},
license: {
community: '社区版',
oss: '社区版',
pro: '专业版',
trial: '试用版',
office: '正式版',
Expand Down
50 changes: 13 additions & 37 deletions frontend/src/views/cronjob/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,50 +164,26 @@ export function transSpecToObj(spec: string) {

export function transSpecToStr(spec: string): string {
const specObj = transSpecToObj(spec);
let str = '';
if (specObj.specType.indexOf('N') === -1 || specObj.specType === 'perWeek') {
str += i18n.global.t('cronjob.' + specObj.specType) + ' ';
} else {
str += i18n.global.t('cronjob.per') + ' ';
}
switch (specObj.specType) {
case 'perMonth':
str +=
specObj.day +
i18n.global.t('cronjob.day') +
' ' +
loadZero(specObj.hour) +
':' +
loadZero(specObj.minute);
break;
return i18n.global.t('cronjob.perMonthHelper', [specObj.day, specObj.hour, loadZero(specObj.minute)]);
case 'perWeek':
str += loadWeek(specObj.week) + ' ' + loadZero(specObj.hour) + ':' + loadZero(specObj.minute);
break;
return i18n.global.t('cronjob.perWeekHelper', [
loadWeek(specObj.week),
specObj.hour,
loadZero(specObj.minute),
]);
case 'perDay':
str += loadZero(specObj.hour) + ':' + loadZero(specObj.minute);
break;
return i18n.global.t('cronjob.perDayHelper', [specObj.hour, loadZero(specObj.minute)]);
case 'perHour':
return i18n.global.t('cronjob.perHourHelper', [loadZero(specObj.minute)]);
case 'perNDay':
str +=
specObj.day +
i18n.global.t('commons.units.day') +
', ' +
loadZero(specObj.hour) +
':' +
loadZero(specObj.minute);
break;
return i18n.global.t('cronjob.perNDayHelper', [specObj.day, specObj.hour, loadZero(specObj.minute)]);
case 'perNHour':
str += specObj.hour + i18n.global.t('commons.units.hour') + ', ' + loadZero(specObj.minute);
break;
case 'perHour':
str += loadZero(specObj.minute);
break;
return i18n.global.t('cronjob.perNHourHelper', [specObj.hour, loadZero(specObj.minute)]);
case 'perNMinute':
str += loadZero(specObj.minute) + i18n.global.t('commons.units.minute');
break;
return i18n.global.t('cronjob.perNMinuteHelper', [loadZero(specObj.minute)]);
case 'perNSecond':
str += loadZero(specObj.second) + i18n.global.t('commons.units.second');
break;
return i18n.global.t('cronjob.perNSecondHelper', [loadZero(specObj.second)]);
}

return str + ' ' + i18n.global.t('cronjob.handle');
}
2 changes: 1 addition & 1 deletion frontend/src/views/cronjob/operate/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
:label="$t('cronjob.containerName')"
prop="containerName"
>
<el-select class="selectClass" v-model="dialogData.rowData!.containerName">
<el-select class="selectClass" filterable v-model="dialogData.rowData!.containerName">
<el-option v-for="item in containerOptions" :key="item" :value="item" :label="item" />
</el-select>
</el-form-item>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/setting/license/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<span>{{ $t('setting.license') }}</span>
</el-col>
<el-col :span="6">
<span>{{ $t('license.community') }}</span>
<span>{{ $t('license.oss') }}</span>
</el-col>
</el-row>
</div>
Expand Down

0 comments on commit 03a797a

Please sign in to comment.