add: 添加每月最后一天调度

This commit is contained in:
2026-06-20 11:46:50 +08:00
parent bce0c6188e
commit 161f266829
9 changed files with 49 additions and 23 deletions
+2 -2
View File
@@ -1,8 +1,8 @@
// views/browser.js — file/folder listing with breadcrumbs, mkdir, upload, delete, rename.
import { post, uploadFile, downloadURL } from "../rc.js";
import { toast, formatBytes, formatTime } from "../state.js?v=recurring-jobs-5";
import { t } from "../i18n.js?v=recurring-jobs-5";
import { toast, formatBytes, formatTime } from "../state.js?v=monthly-last-day-1";
import { t } from "../i18n.js?v=monthly-last-day-1";
export async function renderBrowse({ remote, path }) {
const app = document.getElementById("app");
+2 -2
View File
@@ -10,8 +10,8 @@
// and disabled submit — user must run `rclone config` in a terminal.
import { post } from "../rc.js";
import { getState, setState, toast } from "../state.js?v=recurring-jobs-5";
import { t } from "../i18n.js?v=recurring-jobs-5";
import { getState, setState, toast } from "../state.js?v=monthly-last-day-1";
import { t } from "../i18n.js?v=monthly-last-day-1";
// --- Route entrypoints ---
+10 -5
View File
@@ -6,8 +6,8 @@ import {
formatBytes,
formatSpeed,
formatDuration,
} from "../state.js?v=recurring-jobs-5";
import { t } from "../i18n.js?v=recurring-jobs-5";
} from "../state.js?v=monthly-last-day-1";
import { t } from "../i18n.js?v=monthly-last-day-1";
import {
createRecurringJob,
deleteRecurringJob,
@@ -15,7 +15,7 @@ import {
listRecurringJobs,
runRecurringJobNow,
stopRecurringJob,
} from "../jobs_api.js?v=recurring-jobs-5";
} from "../jobs_api.js?v=monthly-last-day-1";
let pollTimer = null;
const WEBGUI_JOB_GROUP_PREFIX = "webgui/transfer";
@@ -276,10 +276,12 @@ function renderWeekdayOptions() {
}
function renderMonthdayOptions() {
return Array.from({ length: 31 }, (_, index) => {
const lastDay = `<option value="0">${t("jobs.monthday_last")}</option>`;
const numberedDays = Array.from({ length: 31 }, (_, index) => {
const day = index + 1;
return `<option value="${day}">${t("jobs.monthday", day)}</option>`;
}).join("");
return lastDay + numberedDays;
}
function buildTransferBody(action, src, dst) {
@@ -322,7 +324,7 @@ function readRecurringSchedule(form) {
}
if (scheduleKind === "monthly") {
schedule.scheduleMonthday = Number(form.elements.scheduleMonthday.value);
if (!Number.isInteger(schedule.scheduleMonthday) || schedule.scheduleMonthday < 1 || schedule.scheduleMonthday > 31) {
if (!Number.isInteger(schedule.scheduleMonthday) || schedule.scheduleMonthday < 0 || schedule.scheduleMonthday > 31) {
throw new Error(t("error.no_schedule_selected"));
}
}
@@ -764,6 +766,9 @@ function formatSchedule(job) {
case "weekly":
return t("jobs.schedule_label_weekly", weekdayName(job.scheduleWeekday), time);
case "monthly":
if (Number(job.scheduleMonthday) === 0) {
return t("jobs.schedule_label_monthly_last", time);
}
return t("jobs.schedule_label_monthly", job.scheduleMonthday, time);
default:
return "";
+2 -2
View File
@@ -1,8 +1,8 @@
// views/remotes.js — connector-tile grid of configured remotes with CRUD.
import { post } from "../rc.js";
import { getState, setState, toast } from "../state.js?v=recurring-jobs-5";
import { t } from "../i18n.js?v=recurring-jobs-5";
import { getState, setState, toast } from "../state.js?v=monthly-last-day-1";
import { t } from "../i18n.js?v=monthly-last-day-1";
export async function renderRemotes() {
const app = document.getElementById("app");