feat: add stats polling interval + correct health polling default to Settings
CI / Test & Lint (push) Canceled after 0s
CI / Security audit (push) Canceled after 0s

- Add 'Stats Polling Interval' (default 30s) field to Health -> Configure ->
  Global Settings, alongside the existing 'Polling Interval' which is now
  relabeled 'Health Check Polling Interval' with the correct default of 60s.
- Persist/load statsPollingInterval via the health-settings localStorage key
  (same mechanism as the other settings).
- Wire the persisted statsPollingInterval into DC.POLL.STATS so the resource
  monitor / monitoring widgets honor the configured cadence (seconds -> ms).
- Update the setup wizard disk-safety 'Recommended after setup' list to
  mention both polling intervals.
- Rebuild dist bundles (core.js, features.js) and bump service-worker cache.
This commit is contained in:
Hermes
2026-08-13 11:03:57 -07:00
parent 234df5038c
commit 7f97ff4a7f
6 changed files with 272 additions and 239 deletions
+19 -1
View File
@@ -1,10 +1,28 @@
// ===== DASHBOARD CONSTANTS =====
// Honor persisted health retention settings for polling cadences so the
// Settings → Health → Global Settings panel actually takes effect. The
// STATS interval (resource/container stat sampling) is driven from the
// user-configurable statsPollingInterval. HEALTH is the lightweight card
// badge refresh and stays at its fast default unless overridden.
(function applyHealthPollingSettings() {
try {
var raw = (typeof localStorage !== 'undefined' && localStorage.getItem('dashcaddy-health-settings')) || null;
if (raw) {
var s = JSON.parse(raw);
// values are stored in seconds; DC.POLL expects milliseconds
if (s.statsPollingInterval && s.statsPollingInterval >= 5 && s.statsPollingInterval <= 3600) {
window.__DC_STATS_OVERRIDE = s.statsPollingInterval * 1000;
}
}
} catch (_) { /* ignore — fall back to defaults below */ }
})();
const DC = {
NAME: 'DashCaddy',
POLL: {
DASHBOARD: 10000, // 10s — main refreshAll interval
LOGS: 3000, // 3s — log viewer updates
STATS: 5000, // 5s — resource monitor refresh
STATS: (typeof window !== 'undefined' && window.__DC_STATS_OVERRIDE) || 5000, // 5s default — resource monitor refresh (overridable via Settings → Health)
WEATHER: 600000, // 10m — weather widget refresh
HEALTH: 1000, // 1s — card health badge refresh
DEPLOY_SSL: 5000, // 5s — SSL cert check during deploy