230b542015
- Rename package fablednetmon → fabledscryer throughout - Multi-dashboard: ownership, per-user defaults, HTMX edit (add/remove/reorder) - Read-only share tokens scoped to individual dashboards - Dashboard edit is HTMX-driven (no page reloads) - Plugin management system: remote catalog, download/install, hot-reload, in-app restart - plugin_index.py: fetch/cache remote index.yaml; default URL → bvandeusen/fabledscryer-plugins - plugin_manager.py: download_and_install_plugin, hot_reload_plugin, restart_app - ZIP extraction handles GitHub archive formats (name-v1.0.0/, name-main/) - Settings split into tabbed sections: General, Notifications, Ansible, Plugins - Plugins tab: catalog browser (HTMX), install/activate/update/restart actions - UI/branding: dark palette (#07071a), crystal ball SVG logo, animated star field, Libertinus Serif applied to headings, nav, labels, and section titles - Widget registry (core/widgets.py) for dashboard plugin integration - UPS widget.html (dashboard card) and settings/_tabs.html include - Migrations 0005–0008: dashboards, is_default, ownership, share tokens - docs/plugins/: writing-a-plugin.md updated with publishing guide, index.yaml.example template for fabledscryer-plugins repo Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
71 lines
3.4 KiB
HTML
71 lines
3.4 KiB
HTML
{# dashboard/_edit_panels.html — returned by all mutation routes and included by edit.html #}
|
|
<div id="edit-panels" style="display:grid;grid-template-columns:1fr 320px;gap:1.5rem;align-items:start;">
|
|
|
|
{# ── Current layout ───────────────────────────────────────────────────── #}
|
|
<div>
|
|
<div class="section-title" style="margin-bottom:0.75rem;">Current Layout</div>
|
|
{% if widgets %}
|
|
<div style="display:grid;gap:0.5rem;">
|
|
{% for item in widgets %}
|
|
<div class="card" style="margin-bottom:0;display:flex;align-items:center;gap:0.75rem;padding:0.85rem 1rem;">
|
|
|
|
<div style="display:flex;flex-direction:column;gap:2px;flex-shrink:0;">
|
|
<button hx-post="/d/{{ dashboard.id }}/edit/move/{{ item.db.id }}/up"
|
|
hx-target="#edit-panels" hx-swap="outerHTML"
|
|
class="btn btn-ghost btn-sm"
|
|
style="padding:0.1rem 0.4rem;font-size:0.7rem;line-height:1;"
|
|
{% if loop.first %}disabled{% endif %}>▲</button>
|
|
<button hx-post="/d/{{ dashboard.id }}/edit/move/{{ item.db.id }}/down"
|
|
hx-target="#edit-panels" hx-swap="outerHTML"
|
|
class="btn btn-ghost btn-sm"
|
|
style="padding:0.1rem 0.4rem;font-size:0.7rem;line-height:1;"
|
|
{% if loop.last %}disabled{% endif %}>▼</button>
|
|
</div>
|
|
|
|
<div style="flex:1;min-width:0;">
|
|
<div style="font-weight:600;font-size:0.9rem;">{{ item.defn.label }}</div>
|
|
<div style="font-size:0.78rem;color:var(--text-muted);margin-top:0.1rem;">{{ item.defn.description }}</div>
|
|
</div>
|
|
|
|
<button hx-post="/d/{{ dashboard.id }}/edit/remove/{{ item.db.id }}"
|
|
hx-target="#edit-panels" hx-swap="outerHTML"
|
|
class="btn btn-danger btn-sm" style="flex-shrink:0;">Remove</button>
|
|
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div class="card" style="color:var(--text-muted);text-align:center;padding:2rem;font-size:0.9rem;">
|
|
No widgets yet — add some from the panel on the right.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{# ── Available widgets ────────────────────────────────────────────────── #}
|
|
<div>
|
|
<div class="section-title" style="margin-bottom:0.75rem;">Available Widgets</div>
|
|
{% if addable %}
|
|
<div style="display:grid;gap:0.5rem;">
|
|
{% for w in addable %}
|
|
<div class="card" style="margin-bottom:0;padding:0.85rem 1rem;">
|
|
<div style="display:flex;align-items:center;justify-content:space-between;gap:0.75rem;">
|
|
<div>
|
|
<div style="font-weight:600;font-size:0.875rem;">{{ w.label }}</div>
|
|
<div style="font-size:0.77rem;color:var(--text-muted);margin-top:0.1rem;">{{ w.description }}</div>
|
|
</div>
|
|
<button hx-post="/d/{{ dashboard.id }}/edit/add/{{ w.key }}"
|
|
hx-target="#edit-panels" hx-swap="outerHTML"
|
|
class="btn btn-sm" style="flex-shrink:0;">Add</button>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div style="color:var(--text-muted);font-size:0.85rem;padding:1rem 0;">
|
|
All available widgets are on this dashboard.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
</div>
|