feat: UI redesign (CSS system, DNS widget, Traefik dashboard widget)
- Replace base.html style block with full CSS design system using custom properties (dark theme, cards, tables, badges, dots, widgets) - Add DNS blueprint (fablednetmon/dns/) with /dns/ and /dns/rows routes + templates - Add Traefik /widget route and widget.html fragment for dashboard - Update dashboard: DNS + Traefik widgets, traefik_enabled config detection - Update all templates to use new CSS classes (page-title, section-title, card-flush, table, badge-*, dot-*, btn-*) - Register dns_bp in app.py Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,40 +1,40 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Alerts — FabledNetMon{% endblock %}
|
||||
{% block content %}
|
||||
<h1 style="color:#c0c0ff;margin-bottom:1.5rem;">Alerts</h1>
|
||||
<h1 class="page-title">Alerts</h1>
|
||||
|
||||
{% if active %}
|
||||
<h2 style="color:#8080ff;margin-bottom:1rem;font-size:1rem;">Active</h2>
|
||||
<div class="card" style="padding:0;margin-bottom:2rem;">
|
||||
<table style="width:100%;border-collapse:collapse;">
|
||||
<h2 class="section-title" style="margin-bottom:1rem;">Active</h2>
|
||||
<div class="card-flush" style="margin-bottom:2rem;">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr style="border-bottom:1px solid #2a2a4a;">
|
||||
<th style="text-align:left;padding:0.75rem 1rem;color:#8080a0;font-weight:normal;">State</th>
|
||||
<th style="text-align:left;padding:0.75rem 1rem;color:#8080a0;font-weight:normal;">Rule</th>
|
||||
<th style="text-align:left;padding:0.75rem 1rem;color:#8080a0;font-weight:normal;">Resource</th>
|
||||
<th style="text-align:left;padding:0.75rem 1rem;color:#8080a0;font-weight:normal;">Metric</th>
|
||||
<th style="padding:0.75rem 1rem;"></th>
|
||||
<tr>
|
||||
<th>State</th>
|
||||
<th>Rule</th>
|
||||
<th>Resource</th>
|
||||
<th>Metric</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for state, rule in active %}
|
||||
<tr style="border-bottom:1px solid #1a1a3a;">
|
||||
<td style="padding:0.75rem 1rem;">
|
||||
<tr>
|
||||
<td>
|
||||
{% if state.state.value == 'firing' %}
|
||||
<span style="color:#ff6060;font-weight:bold;">FIRING</span>
|
||||
<span class="badge badge-red">FIRING</span>
|
||||
{% elif state.state.value == 'acknowledged' %}
|
||||
<span style="color:#ffa040;">ACK</span>
|
||||
<span class="badge badge-yellow">ACK</span>
|
||||
{% else %}
|
||||
<span style="color:#a0a0a0;">PENDING</span>
|
||||
<span class="badge badge-dim">PENDING</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td style="padding:0.75rem 1rem;">{{ rule.name }}</td>
|
||||
<td style="padding:0.75rem 1rem;color:#a0a0c0;">{{ rule.resource_name }}</td>
|
||||
<td style="padding:0.75rem 1rem;color:#a0a0c0;">{{ rule.metric_name }} {{ rule.operator.value }} {{ rule.threshold }}</td>
|
||||
<td style="padding:0.75rem 1rem;text-align:right;">
|
||||
<td>{{ rule.name }}</td>
|
||||
<td style="color:var(--text-muted);">{{ rule.resource_name }}</td>
|
||||
<td style="color:var(--text-muted);">{{ rule.metric_name }} {{ rule.operator.value }} {{ rule.threshold }}</td>
|
||||
<td class="td-actions">
|
||||
{% if state.state.value == 'firing' %}
|
||||
<form method="post" action="/alerts/{{ rule.id }}/acknowledge" style="display:inline;">
|
||||
<button type="submit" class="btn" style="background:#605010;">Acknowledge</button>
|
||||
<button type="submit" class="btn btn-sm btn-warn">Acknowledge</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</td>
|
||||
@@ -44,40 +44,40 @@
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<p style="color:#606080;margin-bottom:2rem;">No active alerts.</p>
|
||||
<p style="color:var(--text-muted);margin-bottom:2rem;">No active alerts.</p>
|
||||
{% endif %}
|
||||
|
||||
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:1rem;">
|
||||
<h2 style="color:#8080ff;font-size:1rem;">Rules</h2>
|
||||
<h2 class="section-title">Rules</h2>
|
||||
<a class="btn" href="/alerts/rules/new">New Rule</a>
|
||||
</div>
|
||||
{% if rules %}
|
||||
<div class="card" style="padding:0;">
|
||||
<table style="width:100%;border-collapse:collapse;">
|
||||
<div class="card-flush">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr style="border-bottom:1px solid #2a2a4a;">
|
||||
<th style="text-align:left;padding:0.75rem 1rem;color:#8080a0;font-weight:normal;">Name</th>
|
||||
<th style="text-align:left;padding:0.75rem 1rem;color:#8080a0;font-weight:normal;">Condition</th>
|
||||
<th style="text-align:left;padding:0.75rem 1rem;color:#8080a0;font-weight:normal;">Consec.</th>
|
||||
<th style="text-align:left;padding:0.75rem 1rem;color:#8080a0;font-weight:normal;">Enabled</th>
|
||||
<th style="padding:0.75rem 1rem;"></th>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Condition</th>
|
||||
<th>Consec.</th>
|
||||
<th>Enabled</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for rule in rules %}
|
||||
<tr style="border-bottom:1px solid #1a1a3a;">
|
||||
<td style="padding:0.75rem 1rem;">{{ rule.name }}</td>
|
||||
<td style="padding:0.75rem 1rem;color:#a0a0c0;">
|
||||
<tr>
|
||||
<td>{{ rule.name }}</td>
|
||||
<td style="color:var(--text-muted);">
|
||||
{{ rule.source_module }}/{{ rule.resource_name }}:{{ rule.metric_name }}
|
||||
{{ rule.operator.value }} {{ rule.threshold }}
|
||||
</td>
|
||||
<td style="padding:0.75rem 1rem;color:#a0a0c0;">{{ rule.consecutive_failures_required }}</td>
|
||||
<td style="padding:0.75rem 1rem;">
|
||||
{% if rule.enabled %}<span style="color:#60c060;">yes</span>{% else %}<span style="color:#606060;">no</span>{% endif %}
|
||||
<td style="color:var(--text-muted);">{{ rule.consecutive_failures_required }}</td>
|
||||
<td>
|
||||
{% if rule.enabled %}<span class="badge badge-green">yes</span>{% else %}<span class="badge badge-dim">no</span>{% endif %}
|
||||
</td>
|
||||
<td style="padding:0.75rem 1rem;text-align:right;">
|
||||
<td class="td-actions">
|
||||
<form method="post" action="/alerts/rules/{{ rule.id }}/delete" style="display:inline;">
|
||||
<button type="submit" style="background:none;border:none;color:#ff6060;cursor:pointer;"
|
||||
<button type="submit" class="btn btn-sm btn-danger"
|
||||
onclick="return confirm('Delete rule {{ rule.name }}?')">Delete</button>
|
||||
</form>
|
||||
</td>
|
||||
@@ -87,6 +87,6 @@
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<p style="color:#606080;">No alert rules configured.</p>
|
||||
<p style="color:var(--text-muted);">No alert rules configured.</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% block title %}New Alert Rule — FabledNetMon{% endblock %}
|
||||
{% block content %}
|
||||
<div style="max-width:560px;margin:2rem auto;">
|
||||
<h1 style="color:#c0c0ff;margin-bottom:1.5rem;">New Alert Rule</h1>
|
||||
<h1 class="page-title">New Alert Rule</h1>
|
||||
<div class="card">
|
||||
<form method="post" action="/alerts/rules">
|
||||
<div class="form-group">
|
||||
@@ -24,7 +24,7 @@
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr;gap:1rem;">
|
||||
<div class="form-group">
|
||||
<label>Operator</label>
|
||||
<select name="operator" style="width:100%;padding:0.5rem 0.75rem;background:#0f0f1e;border:1px solid #3a3a5a;border-radius:4px;color:#e0e0e0;">
|
||||
<select name="operator">
|
||||
{% for val, label in operators %}
|
||||
<option value="{{ val }}">{{ label }}</option>
|
||||
{% endfor %}
|
||||
@@ -40,8 +40,8 @@
|
||||
<input type="number" name="consecutive_failures_required" value="1" min="1">
|
||||
</div>
|
||||
<div style="display:flex;gap:1rem;margin-top:1.5rem;">
|
||||
<button type="submit">Create Rule</button>
|
||||
<a href="/alerts/" style="padding:0.5rem 1rem;color:#a0a0c0;text-decoration:none;">Cancel</a>
|
||||
<button type="submit" class="btn">Create Rule</button>
|
||||
<a href="/alerts/" class="btn btn-ghost">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user