88091936c5
The page-top chrome was inconsistent: most nested views used the breadcrumb
kicker + page-title pattern, but plugin sub-pages used ad-hoc "← back" links,
~11 pages stacked a breadcrumb AND a redundant ancestor back button, and two
(monitors/edit, hosts/uptime) had a back button but no breadcrumb. The
settings/plugin_detail page stacked all of it at once.
Unify on the breadcrumb-led model:
- settings/_tabs.html: drop the hardcoded "Settings" h1; the breadcrumb
("Settings › …") plus the tab strip is the header.
- settings/plugin_detail: drop the "← Plugins" back button.
- docker container_detail/swarm/disk + snmp/device: replace ad-hoc back links
with the standard crumbs() breadcrumb.
- host_agent, ansible/*, alerts/maintenance: remove redundant ancestor back
buttons (the breadcrumb's parent crumbs already link there); keep lateral
shortcuts (Inventory/Schedules/Browse/Targets/Groups/New).
- monitors/edit, hosts/uptime: add the missing breadcrumb, drop the back link.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Jg27rgypiW2efULXJDtMC
50 lines
2.3 KiB
HTML
50 lines
2.3 KiB
HTML
{% extends "base.html" %}
|
|
{% from "_macros.html" import crumbs %}
|
|
{% from "monitors/_fields.html" import type_fields, toggle_script %}
|
|
{% block title %}Edit Monitor — Steward{% endblock %}
|
|
{% block breadcrumb %}{{ crumbs([("Monitors", "/monitors/"), ("Edit monitor", "")]) }}{% endblock %}
|
|
{% block content %}
|
|
<div style="margin-bottom:1.25rem;">
|
|
<h1 class="page-title" style="margin-bottom:0;">Edit Monitor</h1>
|
|
</div>
|
|
|
|
{% set inp = "width:100%;padding:0.4rem 0.65rem;background:var(--bg);border:1px solid var(--border-mid);border-radius:4px;color:var(--text);font-size:0.88rem;" %}
|
|
{% set lbl = "font-size:0.75rem;color:var(--text-muted);display:block;margin-bottom:0.2rem;" %}
|
|
|
|
<div class="card" style="max-width:760px;">
|
|
<form method="post" action="/monitors/{{ monitor.id }}/edit" style="display:grid;gap:0.6rem;">
|
|
<div style="display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:0.6rem;align-items:end;">
|
|
<div>
|
|
<label style="{{ lbl }}">Type</label>
|
|
<input type="text" value="{{ monitor.type | upper }}" disabled style="{{ inp }}opacity:0.7;">
|
|
</div>
|
|
<div>
|
|
<label style="{{ lbl }}">Name</label>
|
|
<input type="text" name="name" value="{{ monitor.name }}" autocomplete="off" style="{{ inp }}">
|
|
</div>
|
|
<div>
|
|
<label style="{{ lbl }}">Target <span style="color:var(--red);">*</span></label>
|
|
<input type="text" name="target" value="{{ monitor.target }}" autocomplete="off" required style="{{ inp }}">
|
|
</div>
|
|
<div>
|
|
<label style="{{ lbl }}">Interval (s, 0=global)</label>
|
|
<input type="number" name="check_interval_seconds" value="{{ monitor.check_interval_seconds }}" min="0" style="{{ inp }}">
|
|
</div>
|
|
{{ type_fields(config) }}
|
|
</div>
|
|
{% if monitor.host_id %}
|
|
<p style="font-size:0.78rem;color:var(--text-dim);margin:0;">
|
|
Linked to <a href="/hosts/{{ monitor.host_id }}" style="color:var(--accent);">its host</a>.
|
|
</p>
|
|
{% endif %}
|
|
<div style="display:flex;gap:0.5rem;">
|
|
<button type="submit" class="btn btn-sm">Save</button>
|
|
<a href="/monitors/" class="btn btn-sm" style="background:transparent;border:1px solid var(--border-mid);">Cancel</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
{{ toggle_script() }}
|
|
<script>mtoggle({{ monitor.type | tojson }});</script>
|
|
{% endblock %}
|