panel-redesign: Server pages and Help on the kit; the help drawer is gone
Stage 2, step 6. Written by Sonnet, reviewed by Opus.
- Six pages named after their mockups: system-log, backup, users,
user, user-delete, help, with typed page data (view/server.go,
help.go), fixtures and tests. The old templates of the six are gone
(user_form.html, encrypt_fields.html deleted, the others rewritten)
and their names are off legacy_pages.txt, which now holds mail_queue
alone.
- Help is six help_topic blocks (checks, certificate, rdns, dns, apps,
limits); a test renders every fixture page and fails on a Help link
without a topic. The help drawer (help_drawer.html and its includes
in layout_legacy.html) is removed; its rules in legacy.css go with
the next step.
- The user form sets the user's e-mail (plan, Account e-mail): create
and update, validated, and a changed address resyncs DMARC for a
user whose default is the account e-mail - through the helper the
Account profile now shares.
- Handlers pass typed data; routes, POST targets, field names,
validation and authorization are unchanged. A test loads the user
form for four reach combinations and for the only global user, posts
it back untouched and finds the user unchanged.
Fixed on the way
- The user delete confirmation said the domains were not affected. A
domain that follows the user's default report address is left with
none; the page names those domains now.
- A refused backup lost the encryption choice and printed a literal
<code> element in its message.
Differences from the mockups, for the owner:
- Help has no DMARC and no Inbound topic: its outline fixes two boxes
of three topics, although other mockups link to #dmarc and #inbound.
Until the owner decides, Account's Help link goes to #dns and the
inbound MX box has none;
- system log: newest line first, as drawn; "refreshes on its own" (5 s
active, 30 s idle); only status=, warning: and error: lines are
coloured;
- backup: the file field is a plain file input; the encryption box is
ticked, as drawn and as on the domain export, so a plain download
means unticking it first;
- users: an E-mail column; the flash does not name the user;
- user form: no lead; the domain lists are no longer hidden by script
when Global is chosen (the server ignores them for that role).
Evidence
- docs/assets/panel-redesign/evidence/system-log.png, backup.png,
users.png, user.png, user-delete.png, help.png: 1440 px wide,
headless Edge, real templates served locally with their fixtures -
NOT from the container (no Docker on this machine).
- panel/audit.js on the six pages at 1440 and 1280: 720 texts checked,
problems: [].
- The system log's polling swap was not exercised in a browser; it
uses the mechanism of Overview and Health.
- go test -count=1 ./internal/web/... ./cmd/panel
ok internal/web
ok internal/web/auth
ok internal/web/handlers
ok internal/web/validate
ok internal/web/view
ok cmd/panel
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+15
-10
@@ -32,9 +32,7 @@ type Engine struct {
|
||||
// from the component kit (kitPages); pages that embed a polling fragment
|
||||
// (architecture.md § Panel HTTP surface) list that fragment's file too, so the
|
||||
// same {{define}} block renders both the initial page and the fragment's own
|
||||
// refresh responses identically. Pages sharing a block of markup (the
|
||||
// encryption fields on the two secret downloads) list that partial the same
|
||||
// way.
|
||||
// refresh responses identically.
|
||||
var pageFiles = map[string][]string{
|
||||
"setup": {"templates/setup.html"},
|
||||
"login": {"templates/login.html"},
|
||||
@@ -42,10 +40,12 @@ var pageFiles = map[string][]string{
|
||||
"health": {"templates/health.html", "templates/health_body.html"},
|
||||
"account": {"templates/account.html"},
|
||||
"settings": {"templates/settings.html"},
|
||||
"system-log": {"templates/system_log.html", "templates/system_log_body.html"},
|
||||
"backup": {"templates/backup.html"},
|
||||
"users": {"templates/users.html"},
|
||||
"user_form": {"templates/user_form.html"},
|
||||
"user_delete": {"templates/user_delete.html"},
|
||||
"backup": {"templates/backup.html", "templates/encrypt_fields.html"},
|
||||
"user": {"templates/user.html"},
|
||||
"user-delete": {"templates/user_delete.html"},
|
||||
"help": {"templates/help.html"},
|
||||
"out-domains": {"templates/out_domains.html"},
|
||||
"out-domain": {"templates/out_domain.html"},
|
||||
"out-domain-settings": {"templates/out_domain_settings.html"},
|
||||
@@ -61,8 +61,6 @@ var pageFiles = map[string][]string{
|
||||
"dmarc-domain": {"templates/dmarc_domain.html"},
|
||||
"dmarc-report": {"templates/dmarc_report.html"},
|
||||
"mail_queue": {"templates/mail_queue.html", "templates/mail_queue_body.html"},
|
||||
"system_log": {"templates/system_log.html", "templates/system_log_body.html"},
|
||||
"help": {"templates/help.html"},
|
||||
"components": {"templates/kit.html"},
|
||||
}
|
||||
|
||||
@@ -97,6 +95,13 @@ var kitPages = map[string]bool{
|
||||
"dmarc": true,
|
||||
"dmarc-domain": true,
|
||||
"dmarc-report": true,
|
||||
|
||||
"system-log": true,
|
||||
"backup": true,
|
||||
"users": true,
|
||||
"user": true,
|
||||
"user-delete": true,
|
||||
"help": true,
|
||||
}
|
||||
|
||||
// fragmentFiles maps a fragment name (also its {{define}} block name) to its
|
||||
@@ -110,7 +115,7 @@ var fragmentFiles = map[string]string{
|
||||
}
|
||||
|
||||
// kitFragments are the fragments rendered with the component kit's partials.
|
||||
var kitFragments = map[string]bool{"health_body": true, "overview_poll": true, "out_log_rows": true}
|
||||
var kitFragments = map[string]bool{"health_body": true, "overview_poll": true, "out_log_rows": true, "system_log_body": true}
|
||||
|
||||
// New parses embedded templates. version is stamped into every page footer.
|
||||
func New(version string) (*Engine, error) {
|
||||
@@ -122,7 +127,7 @@ func New(version string) (*Engine, error) {
|
||||
for name, files := range pageFiles {
|
||||
// A page parses with the layout of its design. The template is named
|
||||
// after the layout file so that its content is the layout's.
|
||||
layout, shared := "layout_legacy.html", []string{"templates/help_drawer.html"}
|
||||
layout, shared := "layout_legacy.html", []string(nil)
|
||||
if kitPages[name] {
|
||||
layout, shared = "layout.html", []string{"templates/components.html"}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user