Files
FabledSteward/fablednetmon/templates/alerts/rules_form.html
T
bvandeusen 165a202ba4 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>
2026-03-18 23:37:46 -04:00

50 lines
2.2 KiB
HTML

{% extends "base.html" %}
{% block title %}New Alert Rule — FabledNetMon{% endblock %}
{% block content %}
<div style="max-width:560px;margin:2rem auto;">
<h1 class="page-title">New Alert Rule</h1>
<div class="card">
<form method="post" action="/alerts/rules">
<div class="form-group">
<label>Rule Name</label>
<input type="text" name="name" required autofocus placeholder="e.g. Home server down">
</div>
<div class="form-group">
<label>Source Module</label>
<input type="text" name="source_module" required placeholder="ping, dns, traefik, ...">
</div>
<div class="form-group">
<label>Resource Name</label>
<input type="text" name="resource_name" required placeholder="host name, router name, ...">
</div>
<div class="form-group">
<label>Metric Name</label>
<input type="text" name="metric_name" required placeholder="up, response_time_ms, ...">
</div>
<div style="display:grid;grid-template-columns:1fr 1fr;gap:1rem;">
<div class="form-group">
<label>Operator</label>
<select name="operator">
{% for val, label in operators %}
<option value="{{ val }}">{{ label }}</option>
{% endfor %}
</select>
</div>
<div class="form-group">
<label>Threshold</label>
<input type="number" name="threshold" step="any" required placeholder="0.5">
</div>
</div>
<div class="form-group">
<label>Consecutive failures required before FIRING (default: 1)</label>
<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" class="btn">Create Rule</button>
<a href="/alerts/" class="btn btn-ghost">Cancel</a>
</div>
</form>
</div>
</div>
{% endblock %}