feat: add warmup schedule (cron) field to config UI

The backend already supports warmup_schedule for periodic cache warmup,
but the field was missing from the web config editor.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
grabbit 2026-02-20 01:39:21 +08:00
parent d2b9f46b1a
commit 86766cc004

View File

@ -21,6 +21,7 @@ function configEditorFn() {
} }
if (config.smb_auth.username == null) config.smb_auth.username = ''; if (config.smb_auth.username == null) config.smb_auth.username = '';
if (config.smb_auth.smb_pass == null) config.smb_auth.smb_pass = ''; if (config.smb_auth.smb_pass == null) config.smb_auth.smb_pass = '';
if (config.warmup.warmup_schedule == null) config.warmup.warmup_schedule = '';
for (const rule of config.warmup.rules) { for (const rule of config.warmup.rules) {
if (rule.newer_than == null) rule.newer_than = ''; if (rule.newer_than == null) rule.newer_than = '';
} }
@ -693,6 +694,13 @@ if (window.Alpine) {
Auto-warmup on Startup Auto-warmup on Startup
</label> </label>
</div> </div>
<div class="field-row" style="margin-top:12px">
<label>Schedule (cron)</label>
<input type="text" x-model="config.warmup.warmup_schedule" placeholder='empty = disabled, e.g. "0 2 * * *" = daily 2am' style="max-width:360px">
</div>
<p style="font-size:0.82em;color:var(--text-muted);margin-top:4px;margin-bottom:8px">
Standard 5-field cron expression. When set, warmup rules run periodically in addition to startup.
</p>
<div style="margin-top:16px"> <div style="margin-top:16px">
<label style="font-size:0.85em;color:var(--text-muted);display:block;margin-bottom:8px">Warmup Rules</label> <label style="font-size:0.85em;color:var(--text-muted);display:block;margin-bottom:8px">Warmup Rules</label>
<template x-for="(rule, i) in config.warmup.rules" :key="i"> <template x-for="(rule, i) in config.warmup.rules" :key="i">