From f0be15d432ac881edc5455102e36bd281b922b5b Mon Sep 17 00:00:00 2001 From: Manus Date: Sun, 5 Jul 2026 06:51:43 -0400 Subject: [PATCH] =?UTF-8?q?Checkpoint:=20R=C3=A9tablissement=20des=20modes?= =?UTF-8?q?=20Quotidienne,=20Hebdomadaire=20(choix=20du=20jour),=20Mensuel?= =?UTF-8?q?le=20(choix=20du=20jour=20du=20mois)=20et=20Intervalle=20dans?= =?UTF-8?q?=20la=20section=20Planification=20des=20Param=C3=A8tres.=20Ajou?= =?UTF-8?q?t=20de=20fetch=5Fday=5Fof=5Fweek=20et=20fetch=5Fday=5Fof=5Fmont?= =?UTF-8?q?h=20dans=20le=20sch=C3=A9ma=20Zod=20du=20backend.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/public/__manus__/version.json | 4 +- client/src/pages/Settings.tsx | 85 ++++++++++++++++++++-------- server/routers.ts | 6 +- 3 files changed, 68 insertions(+), 27 deletions(-) diff --git a/client/public/__manus__/version.json b/client/public/__manus__/version.json index 31dc1f9..aedf76b 100644 --- a/client/public/__manus__/version.json +++ b/client/public/__manus__/version.json @@ -1,4 +1,4 @@ { - "version": "413ddf45", - "timestamp": 1783072421404 + "version": "af33c6e1", + "timestamp": 1783248703843 } \ No newline at end of file diff --git a/client/src/pages/Settings.tsx b/client/src/pages/Settings.tsx index e436f35..a0508f1 100644 --- a/client/src/pages/Settings.tsx +++ b/client/src/pages/Settings.tsx @@ -222,6 +222,8 @@ export default function SettingsPage() { import_time: "06:00", fetch_mode: "scheduled", fetch_interval_minutes: "1440", + fetch_day_of_week: "1", + fetch_day_of_month: "1", }); useEffect(() => { @@ -467,55 +469,95 @@ export default function SettingsPage() { {/* Mode */}
- -
- {(["scheduled", "interval"] as const).map((mode) => ( + +
+ {([ + { value: "scheduled", label: "Quotidienne", desc: "Chaque jour à une heure précise" }, + { value: "weekly", label: "Hebdomadaire", desc: "Un jour précis de la semaine" }, + { value: "monthly", label: "Mensuelle", desc: "Un jour précis du mois" }, + { value: "interval", label: "Intervalle", desc: "Toutes les N heures" }, + ] as const).map((mode) => ( ))}
- {/* Heure fixe */} - {(form.fetch_mode || "scheduled") === "scheduled" && ( + {/* Heure (quotidien, hebdo, mensuel) */} + {["scheduled", "weekly", "monthly"].includes(form.fetch_mode || "scheduled") && (
- + set("import_time", e.target.value)} /> -

- Prochain import : demain à {form.import_time || "06:00"} -

+
+ )} + + {/* Jour de la semaine (hebdo) */} + {(form.fetch_mode || "scheduled") === "weekly" && ( +
+ +
+ {["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"].map((day, i) => ( + + ))} +
+
+ )} + + {/* Jour du mois (mensuel) */} + {(form.fetch_mode || "scheduled") === "monthly" && ( +
+ + set("fetch_day_of_month", e.target.value)} + />
)} {/* Intervalle */} {(form.fetch_mode || "scheduled") === "interval" && (
- +
{[ - { label: "1h", value: "60" }, - { label: "2h", value: "120" }, - { label: "4h", value: "240" }, - { label: "6h", value: "360" }, + { label: "1h", value: "60" }, + { label: "2h", value: "120" }, + { label: "4h", value: "240" }, + { label: "6h", value: "360" }, { label: "12h", value: "720" }, { label: "24h", value: "1440" }, ].map((opt) => ( @@ -534,9 +576,6 @@ export default function SettingsPage() { ))}
-

- Import toutes les {(form.fetch_interval_minutes || "1440") === "60" ? "heure" : `${parseInt(form.fetch_interval_minutes || "1440") / 60} heures`} -

)} diff --git a/server/routers.ts b/server/routers.ts index 01a84c2..585beb7 100644 --- a/server/routers.ts +++ b/server/routers.ts @@ -372,8 +372,10 @@ export const appRouter = router({ sharepoint_token: z.string().optional(), auth_mode: z.enum(["local", "free"]).optional(), import_time: z.string().optional(), - fetch_mode: z.enum(["scheduled", "interval"]).optional(), + fetch_mode: z.enum(["scheduled", "weekly", "monthly", "interval"]).optional(), fetch_interval_minutes: z.string().optional(), + fetch_day_of_week: z.string().optional(), + fetch_day_of_month: z.string().optional(), }) ) .mutation(async ({ input }) => { @@ -383,7 +385,7 @@ export const appRouter = router({ } await setSettings(toSave); // Recharger le cron si la planification a changé - if (toSave.import_time || toSave.fetch_mode || toSave.fetch_interval_minutes) { + if (toSave.import_time || toSave.fetch_mode || toSave.fetch_interval_minutes || toSave.fetch_day_of_week || toSave.fetch_day_of_month) { await scheduleDailyImport(); } return { success: true };