From ccc6c742ee666aebb8aa4d9e5106f8e541575a69 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sun, 2 Aug 2026 00:51:41 -0400 Subject: [PATCH] Add structured headers to the PHP pages layer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Documents each tab's purpose, what it renders, and which endpoints it polls. Pages that start with markup get the header in a block so it never reaches the browser. Also corrects the layer diagram in README-unraid.md: eight of eleven pages hold no PHP logic and poll api/ for everything — only auth, monitor and scheduler require an include/ file directly. --- Plugin/unraid/README-unraid.md | 15 +++++--- Plugin/unraid/pages/arrs.php | 28 ++++++++++++++ Plugin/unraid/pages/auth.php | 44 +++++++++++++++++++++ Plugin/unraid/pages/docker.php | 28 ++++++++++++++ Plugin/unraid/pages/fallback.php | 32 ++++++++++++++++ Plugin/unraid/pages/monitor.php | 46 ++++++++++++++++++++++ Plugin/unraid/pages/partnership.php | 38 +++++++++++++++++++ Plugin/unraid/pages/rsync.php | 39 +++++++++++++++++++ Plugin/unraid/pages/scheduler.php | 59 +++++++++++++++++++++++++++++ Plugin/unraid/pages/settings.php | 29 ++++++++++++++ Plugin/unraid/pages/setup.php | 33 ++++++++++++++++ Plugin/unraid/pages/watchdog.php | 28 ++++++++++++++ 12 files changed, 414 insertions(+), 5 deletions(-) diff --git a/Plugin/unraid/README-unraid.md b/Plugin/unraid/README-unraid.md index 052fef1..b6a484b 100644 --- a/Plugin/unraid/README-unraid.md +++ b/Plugin/unraid/README-unraid.md @@ -85,14 +85,19 @@ templates, and the WebGUI install path. ## ━━━ THE WEB UI — THREE LAYERS ━━━ ``` - pages/*.php what you look at ── requires ──► include/ + pages/*.php what you look at ── polls ─────► api/ api/*.php what the page fetches ── requires ──► include/ - include/*.php the actual logic — vv_*() functions, shared by both + include/*.php the actual logic — vv_*() functions ``` -The split matters: a page and its API endpoint call **the same** `vv_*()` builders, so a -cached response and a live one cannot disagree in shape. Adding a metric means adding it in -`include/` once, and both the page and the endpoint get it. +**Most pages hold no logic at all.** Eight of the eleven are pure view — markup, CSS and a +poll loop, with every value arriving as JSON from `api/`. Only `auth.php`, `monitor.php` and +`scheduler.php` require an `include/` file directly, and then only to server-render their +initial state; their mutations still go through endpoints. + +That is why the layer split holds: a page and its endpoint cannot disagree about what a value +means, because the page does not compute it. Adding a metric means adding it in `include/` +once, and the endpoint, the cache writer, and the page all pick it up together. | Layer | Files | Role | |-------|-------|------| diff --git a/Plugin/unraid/pages/arrs.php b/Plugin/unraid/pages/arrs.php index 9272796..00d8556 100644 --- a/Plugin/unraid/pages/arrs.php +++ b/Plugin/unraid/pages/arrs.php @@ -1,3 +1,31 @@ +