fix: rename cron phrases to be mare accurate

This commit is contained in:
2026-07-19 14:49:19 +02:00
parent 5032906d91
commit dd7f0b5df7
5 changed files with 16 additions and 16 deletions
+7 -7
View File
@@ -10,7 +10,7 @@ const rawCron = ref<string>(DEFAULT_CRON);
const valid = ref<boolean>(true);
const props = defineProps<{ editMode: boolean }>();
const cronType = ref<CronType>(CronType.ONE_TIME);
const cronType = ref<CronType>(CronType.MANUAL);
const cronValue = ref<number>(0);
function onCronChanged() {
@@ -34,7 +34,7 @@ function onChangeCronType() {
case CronType.EVERY_YEAR:
cronValue.value = 1;
break;
case CronType.SPECIFIC:
case CronType.CUSTOM:
cron.value ??= DEFAULT_CRON;
break;
}
@@ -64,8 +64,8 @@ watch(cron, () => {
<template>
<div class="flex gap-2">
<select v-model="cronType" class="select flex-1" @change="onChangeCronType">
<option :value="CronType.ONE_TIME">
{{ $t("cron.type.one_time") }}
<option :value="CronType.MANUAL">
{{ $t("cron.type.manual") }}
</option>
<option :value="CronType.EVERY_DAY">
{{ $t("cron.type.every_day") }}
@@ -79,8 +79,8 @@ watch(cron, () => {
<option :value="CronType.EVERY_YEAR">
{{ $t("cron.type.every_year") }}
</option>
<option :value="CronType.SPECIFIC">
{{ $t("cron.type.specific") }}
<option :value="CronType.CUSTOM">
{{ $t("cron.type.custom") }}
</option>
</select>
<select
@@ -149,7 +149,7 @@ watch(cron, () => {
</option>
</select>
<input
v-if="cronType === CronType.SPECIFIC"
v-if="cronType === CronType.CUSTOM"
v-model="rawCron"
type="text"
class="input font-mono flex-1"
+2 -2
View File
@@ -1,10 +1,10 @@
export enum CronType {
ONE_TIME,
MANUAL,
EVERY_DAY,
EVERY_WEEK,
EVERY_MONTH,
EVERY_YEAR,
SPECIFIC,
CUSTOM,
}
export enum SortType {
+3 -3
View File
@@ -8,7 +8,7 @@ export function parseCron(cron: string | null): {
let value: RegExpMatchArray | null;
if (cron === null) {
return {
type: CronType.ONE_TIME,
type: CronType.MANUAL,
value: 0,
};
} else if ((value = /^0 (\d+) \* \* \*$/i.exec(cron)) !== null) {
@@ -33,7 +33,7 @@ export function parseCron(cron: string | null): {
};
} else {
return {
type: CronType.SPECIFIC,
type: CronType.CUSTOM,
value: 0,
};
}
@@ -53,7 +53,7 @@ export function getCron(
return `0 0 ${value.toFixed(0)} * *`;
case CronType.EVERY_YEAR:
return `0 0 1 ${value.toFixed(0)} *`;
case CronType.SPECIFIC:
case CronType.CUSTOM:
if (validCron(fallback)) {
return fallback;
}