'use strict'; 'require baseclass'; 'require dom'; 'require network'; 'require fs-fit as fit'; 'require menu-footstrap-common as common'; /* Overview layout only: renders nothing of its own, it re-arranges the STOCK System / Memory / * Storage sections into a grid. Content, data and styling stay luci-mod-status's — rendering a * custom tree every poll instead (the old 05_footstrap_dashboard.js) flickered and reset mobile * scroll. The stock poll fills each section in place via dom.content() and never rebuilds the * .cbi-section wrapper, so the wrappers stay inside our grid across polls. * * This must NOT be filed in LuCI's global include dir (view/status/include/): luci-mod-status * evaluates every *.js there, so the file would be fetched and run on routers using another theme, * with an `L.env.media` gate only silencing it after the fact. As a chrome module it is * unreachable except through this theme's footer partial, which is why nothing below re-checks * `L.env.media`. That location also supplied two timing guarantees for free, by evaluating inside * index.load(); both are paid for explicitly here — patchOverview() below, and * ensureOverviewHelpers() in menu-footstrap-common.js. */ /* section title -> grid role. _() with no msgctxt on purpose: these must resolve to exactly what * luci-mod-status resolves to, or the titles stop matching. Built once, not per poll tick. */ const ROLES = { [_('System')]: 'sys', [_('Memory')]: 'mem', [_('Storage')]: 'sto' }; /* the data-page value four call sites compare against; a string literal is not mangled, so a * repeat is paid in full on flash every time (measured: 24 B x4 -> 37 B, 59 B saved) */ function headerEl(sec) { /* two title markups, one per release: 25.12 wraps the heading (`.cbi-title > h3`), 24.10 emits * a bare `