Files
FabledSteward/steward/templates/dashboard/_grid_item.html
T
bvandeusenandClaude Opus 5.5 5492336f1e
CI / lint (push) Successful in 2s
CI / integration (push) Successful in 50s
CI / unit (push) Failing after 1m16s
CI / publish (push) Skipped
feat(dashboard): a curated default layout, merged duplicate widgets, a labelled Overview (#5213)
- New installs start from widgets.RECOMMENDED, packed row by row for the
  enabled plugins; the edit drawer can reset a dashboard to it.
- Host Agent — Resources folds into Hosts — Overview (which gains load 1m),
  UniFi — Devices into UniFi — Overview; migration 0032 moves existing
  dashboards onto the survivors.
- The Overview labels what it counts (hosts, monitors up/down/pending,
  alerts firing) and lists firing alerts and down monitors with since-times.
- Uptime polls every 5 minutes (poll_seconds) instead of every cycle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 00:42:04 -04:00

29 lines
1.6 KiB
HTML

{# One dashboard widget as a Gridstack item — shared by index.html (initial render)
and the add-widget endpoint (single-item insert). Edit chrome (drag handle +
remove) is in the DOM only for editors and shown via body.dash-editing CSS. #}
<div class="grid-stack-item" gs-id="{{ item.db.id }}"
gs-x="{{ item.db.grid_x }}" gs-y="{{ item.db.grid_y }}"
gs-w="{{ item.db.grid_w }}" gs-h="{{ item.db.grid_h }}">
<div class="grid-stack-item-content">
<div class="widget-header">
<span style="display:flex;align-items:center;gap:0.4rem;min-width:0;">
{% if can_edit %}<span class="panel-chrome panel-drag" title="Drag to move">⠿</span>{% endif %}
<span class="widget-title" title="{{ item.title }}">{{ item.title }}</span>
</span>
<span style="display:flex;align-items:center;gap:0.5rem;flex-shrink:0;">
<span class="widget-asof" aria-live="polite"></span>
<a href="{{ item.defn.detail_url }}" class="widget-link">Details →</a>
{% if can_edit %}<button type="button" class="panel-chrome btn btn-danger btn-sm"
data-remove="{{ item.db.id }}" title="Remove widget"
style="padding:0.05rem 0.4rem;line-height:1.3;">✕</button>{% endif %}
</span>
</div>
<div class="dash-cell-body" id="widget-{{ item.db.id }}"
hx-get="{{ item.hx_url }}"
hx-trigger="load, retry{% if item.defn.poll %}, every {{ item.defn.get('poll_seconds') or poll_interval }}s{% endif %}"
hx-request='{"timeout": 20000}'
data-poll="{{ '1' if item.defn.poll else '0' }}"
hx-swap="innerHTML"><div class="cell-state">Loading…</div></div>
</div>
</div>