Round out the editor: head widgets, undo, group/split-column, site settings
- Head widgets are now first-class in dashboard edit mode: they get drag/edit/delete handles, their own SortableJS group (so they can't cross into columns), and the layout endpoint accepts a headWidgets[] sequence alongside columns[]. - New POST /edit/api/restore swaps glance.yml ↔ glance.yml.bak — effectively undo (and click again to redo). Surfaced as a "Restore previous version" button on /edit. - group and split-column are now editable inline via a new list-of-widgets schema type. Each item picks a widget type from a dropdown (excluding group/split-column to honor the backend's no-nesting rule) and renders that type's schema-driven sub-form. Switching the type re-renders the body. - New /edit/site-settings page with a form for branding (app name, logo, favicon, footer, app icon/background). POST applies via the same surgical yaml.Node update used for widgets. Theme/server intentionally still YAML for now. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
7f36f30dad
commit
e108feb74b
@@ -5,7 +5,12 @@
|
||||
{{- define "document-body" }}
|
||||
<div class="flex flex-column body-content">
|
||||
<main class="content-bounds" style="padding-block: 2rem;">
|
||||
<h1 class="size-h1 margin-bottom-15">Edit</h1>
|
||||
<div class="flex items-center gap-10">
|
||||
<h1 class="size-h1 grow">Edit</h1>
|
||||
<a href="{{ .App.Config.Server.BaseURL }}/edit/site-settings">
|
||||
<button type="button">Site settings</button>
|
||||
</a>
|
||||
</div>
|
||||
<p class="color-subdue margin-bottom-25">
|
||||
Editing <code>{{ .App.ConfigPath }}</code>. Changes take effect via hot-reload.
|
||||
</p>
|
||||
@@ -43,6 +48,17 @@
|
||||
<input type="text" name="title" required placeholder="Page title" class="input grow">
|
||||
<button type="submit">Add page</button>
|
||||
</form>
|
||||
|
||||
<hr style="margin-block: 2rem; border: none; border-top: 1px solid var(--color-widget-content-border);">
|
||||
<h3 class="size-h3 margin-bottom-10">Undo last save</h3>
|
||||
<p class="color-subdue margin-bottom-10">
|
||||
Restores the previous contents of <code>{{ .App.ConfigPath }}</code> from the
|
||||
<code>.bak</code> file written on each save. Click again to redo.
|
||||
</p>
|
||||
<form method="post" action="{{ .App.Config.Server.BaseURL }}/edit/api/restore"
|
||||
onsubmit="return confirm('Restore the previous version of your config?');">
|
||||
<button type="submit">Restore previous version</button>
|
||||
</form>
|
||||
</main>
|
||||
{{ template "footer.html" . }}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user