Add structured headers to the PHP pages layer
Documents each tab's purpose, what it renders, and which endpoints it polls. Pages that start with markup get the header in a <?php ?> 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.
This commit is contained in:
@@ -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 |
|
||||
|-------|-------|------|
|
||||
|
||||
Reference in New Issue
Block a user