diff --git a/zddc/internal/handler/zddceditor.go b/zddc/internal/handler/zddceditor.go index 6206a44..b040893 100644 --- a/zddc/internal/handler/zddceditor.go +++ b/zddc/internal/handler/zddceditor.go @@ -6,6 +6,7 @@ import ( "os" "path/filepath" + "codeberg.org/VARASYS/ZDDC/zddc/internal/apps" "codeberg.org/VARASYS/ZDDC/zddc/internal/config" "codeberg.org/VARASYS/ZDDC/zddc/internal/zddc" ) @@ -21,10 +22,20 @@ type editorView struct { HasCustomCSS bool File zddc.ZddcFile EffectiveChain []chainEntry + AppsRows []appsRow ProfilePathPrefix string // /.profile AssetsPathPrefix string // /.profile/zddc/assets } +// appsRow renders one line of the Apps section: the apps key (default or +// app name), its current value at THIS level (may be empty), and the +// preview of how it resolves once the cascade is applied. +type appsRow struct { + Key string // "default" or canonical app name + Value string // current spec at this .zddc level (empty = inherits) + ResolvesTo string // human-readable preview line +} + // serveZddcEditor renders the form-based .zddc editor at // GET /.profile/zddc/edit?path=
+ Override which build of each tool the server serves at this directory and below.
+ Spec is one of: stable / beta / alpha,
+ v0.0.4 / v0.0 / v0 (canonical upstream),
+ https://my-mirror/releases (URL prefix — composes with channel from default),
+ https://my-mirror/releases:beta (URL prefix + channel),
+ :beta (channel-only override of default's URL),
+ https://my-fork/archive.html (terminal full URL),
+ ./local.html or /abs/path.html (terminal local file).
+ Leave any row blank to inherit from a parent .zddc file.
+ The default row provides the baseline URL prefix and channel for any app not overridden per-name.
+
+ Per-request override: any user can append ?v=<spec> to a tool URL (e.g. ?v=beta, ?v=v0.0.4, ?v=:alpha) to ask for a different build for one request. Security: ?v= serves only versions already in the cache (<ZDDC_ROOT>/_app/); cache misses return 404 so users can't trigger arbitrary upstream fetches. Local-path specs are also rejected from ?v=.
+
| Key | Value | Resolves to |
|---|---|---|
{{ .Key }} |
+ + | {{ .ResolvesTo }} | +
The Resolves to column reflects the saved state of the cascade — save and reload to see how edits compose.
+