v0.315.0: one app page with four tabs; the guide the catalog can carry; no Raspberry Pi badge
gates / gates (push) Failing after 47s
gates / gates (push) Failing after 47s
An app was six pages — details, install/settings, logs, export, the per-app backup panel and a
details card for moving data — and every "Vissza" on them went to the app LIST, so there was no way
back to the app you were looking at. It is now ONE page with four tab URLs under /apps/{slug}/,
one shared header and one set of banners.
settings Mukodes (Start/Restart/Stop, Stop confirms) + the cards that want something from the
household + the install-time and optional settings. The default for an installed app,
RENDERED at the bare URL and never redirected to.
data the data folders, move to another drive, the nightly copy, the 2nd-copy setting, export
guide tagline, screenshots, use cases, first steps, the catalog's guide, the FAQ, the docs
link — and the WHOLE page for an app that is not installed
logs the log, and the only tab whose poller runs
The tabs are links, not panels: a link in an alert has to land ON a tab, and the log poller must not
run on the other three. Start/Restart/Stop left the page header, where they read as menu buttons.
The old /stacks/{name}/{deploy,logs,export,backup} GETs answer 302 — never 301, which a browser
caches beyond anyone's reach — to the tab that now holds them, query string carried through, with
name->slug resolved through the stack list rather than assumed equal. Every POST on those paths is
untouched: the backup form, the app-email toggle and the reveal endpoints keep their URLs.
A value asked AFTER the app starts is now generic (D2). The catalog marks a field `after_start: true`
and supplies its label; the ACTION is Go, in a registry keyed by slug + env var. The catalog can
never declare what runs — a declared field with no registered action renders nothing, POSTs 404 and
logs one WARN with the env var KEY, never the value. A red-proof found the second half of that guard
unpinned: deleting the "the catalog must have DECLARED this field" check left the suite green, and a
POST for an undeclared field then reached Plex and opened the setup gate.
TestAfterStart_RegistryAloneIsNotAnInvitation pins it.
New catalog block app_info.guide (sections + faq + checked_version), parsed, localised field by
field and rendered with the household's own address filled in. It renders only when checked_version
names the image tag its author clicked through. No template carries one yet.
The Pi and "csak x86" badges are gone; PiCompatible and the catalog key stay this release, or a box
on 0.314.0 would read "csak x86" on every app (R-1067).
template_id_gate.py now follows {{template}} includes, with a scope decoy proving the walk did not
become vacuous.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117kRTSgs3rJWUFGxyoWN6Y
This commit is contained in:
@@ -13,41 +13,14 @@ import (
|
||||
// drive or turn Tier 2 off. It is ALWAYS shown — even when only the internal SSD qualifies, or the
|
||||
// app's data lives on the rootfs (already in PBS) — with honest context rather than a hidden control.
|
||||
//
|
||||
// v0.315.0: this panel is no longer a page. Its content is the app page's „Adatok es mentes" tab
|
||||
// (renderAppDataTab assembles the same Tier2Info), and the form below still POSTs to the URL it
|
||||
// always did — only the GET that used to render it is now a 302 to that tab.
|
||||
//
|
||||
// Routes (wired in server.go, behind RequireAuth + CsrfProtect):
|
||||
// GET /stacks/{name}/backup → tier2ConfigPageHandler
|
||||
// GET /stacks/{name}/backup → 302 /apps/{slug}/data
|
||||
// POST /stacks/{name}/backup → tier2ConfigSaveHandler
|
||||
|
||||
func (s *Server) tier2ConfigPageHandler(w http.ResponseWriter, r *http.Request, name string) {
|
||||
stack, ok := s.stackMgr.GetStack(name)
|
||||
if !ok {
|
||||
http.NotFound(w, r)
|
||||
return
|
||||
}
|
||||
if s.backupMgr == nil {
|
||||
http.Error(w, "A mentés nincs beállítva ezen a szerveren.", http.StatusServiceUnavailable)
|
||||
return
|
||||
}
|
||||
|
||||
info := s.backupMgr.Tier2Info(name)
|
||||
|
||||
data := s.baseData("backups", "2. mentés beállítása — "+stack.Meta.DisplayName)
|
||||
data["StackName"] = name
|
||||
data["DisplayName"] = stack.Meta.DisplayName
|
||||
data["Tier2"] = info
|
||||
if !info.IsHDDApp {
|
||||
// R-499: the sentence about a system-disk app must say where THIS box's whole-system backup
|
||||
// goes. It used to promise „már szerepelnek a teljes rendszermentésben (PBS)" on every box.
|
||||
data["SystemBackup"] = systemBackupFact(s.resolveBackupTargetState(r.Context()))
|
||||
}
|
||||
if flash := s.flashFrom(r, "flash"); flash != "" {
|
||||
data["Flash"] = flash
|
||||
}
|
||||
if flashErr := s.flashFrom(r, "flash_error"); flashErr != "" {
|
||||
data["FlashError"] = flashErr
|
||||
}
|
||||
s.executeTemplate(w, r, "tier2_config", data)
|
||||
}
|
||||
|
||||
func (s *Server) tier2ConfigSaveHandler(w http.ResponseWriter, r *http.Request, name string) {
|
||||
if _, ok := s.stackMgr.GetStack(name); !ok {
|
||||
http.NotFound(w, r)
|
||||
@@ -109,7 +82,8 @@ func (s *Server) appEmailToggleHandler(w http.ResponseWriter, r *http.Request, n
|
||||
_ = r.ParseForm()
|
||||
enabled := r.FormValue("app_email_enabled") == "on" || r.FormValue("app_email_enabled") == "true"
|
||||
|
||||
dest := "/stacks/" + url.PathEscape(name) + "/deploy"
|
||||
// The e-mail toggle lives on the settings tab, so that is where its flash belongs.
|
||||
dest := s.appPageURLForName(name, appTabSettings)
|
||||
if err := s.stackMgr.SetAppEmailEnabled(name, enabled); err != nil {
|
||||
s.logger.Printf("[ERROR] [web] app-email toggle for %s: %v", name, err)
|
||||
http.Redirect(w, r, dest+"?flash_error="+url.QueryEscape(err.Error()), http.StatusSeeOther)
|
||||
@@ -123,9 +97,9 @@ func (s *Server) appEmailToggleHandler(w http.ResponseWriter, r *http.Request, n
|
||||
http.Redirect(w, r, dest+"?"+flashQuery("flash", msg), http.StatusSeeOther)
|
||||
}
|
||||
|
||||
// redirectTier2 sends the customer back to the panel with a flash message.
|
||||
// redirectTier2 sends the customer back to the tab that carries the form, with a flash message.
|
||||
func (s *Server) redirectTier2(w http.ResponseWriter, r *http.Request, name, flash, flashErr string) {
|
||||
dest := "/stacks/" + url.PathEscape(name) + "/backup"
|
||||
dest := s.appPageURLForName(name, appTabData)
|
||||
q := url.Values{}
|
||||
if flash != "" {
|
||||
q.Set("flash", flash)
|
||||
|
||||
Reference in New Issue
Block a user