feat: The Other Dude v9.0.1 — full-featured email system
ci: add GitHub Pages deployment workflow for docs site Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
66
backend/app/templates/reports/alert_history.html
Normal file
66
backend/app/templates/reports/alert_history.html
Normal file
@@ -0,0 +1,66 @@
|
||||
{% extends "reports/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="date-range">
|
||||
Report period: {{ date_from }} to {{ date_to }}
|
||||
</div>
|
||||
|
||||
<div class="summary-box">
|
||||
<div class="summary-stat">
|
||||
<div class="value">{{ total_alerts }}</div>
|
||||
<div class="label">Total Alerts</div>
|
||||
</div>
|
||||
<div class="summary-stat">
|
||||
<div class="value" style="color: #991B1B;">{{ critical_count }}</div>
|
||||
<div class="label">Critical</div>
|
||||
</div>
|
||||
<div class="summary-stat">
|
||||
<div class="value" style="color: #92400E;">{{ warning_count }}</div>
|
||||
<div class="label">Warning</div>
|
||||
</div>
|
||||
<div class="summary-stat">
|
||||
<div class="value" style="color: #1E40AF;">{{ info_count }}</div>
|
||||
<div class="label">Info</div>
|
||||
</div>
|
||||
{% if mttr_minutes is not none %}
|
||||
<div class="summary-stat">
|
||||
<div class="value">{{ mttr_display }}</div>
|
||||
<div class="label">Avg MTTR</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if alerts %}
|
||||
<h2 class="section-title">Alert Events</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Timestamp</th>
|
||||
<th>Device</th>
|
||||
<th>Severity</th>
|
||||
<th>Message</th>
|
||||
<th>Status</th>
|
||||
<th>Duration</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for alert in alerts %}
|
||||
<tr>
|
||||
<td>{{ alert.fired_at }}</td>
|
||||
<td style="font-weight: 600;">{{ alert.hostname or '-' }}</td>
|
||||
<td>
|
||||
<span class="badge badge-{{ alert.severity }}">{{ alert.severity | upper }}</span>
|
||||
</td>
|
||||
<td>{{ alert.message or '-' }}</td>
|
||||
<td>
|
||||
<span class="badge badge-{{ alert.status }}">{{ alert.status | upper }}</span>
|
||||
</td>
|
||||
<td>{{ alert.duration or '-' }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="no-data">No alerts found for the selected date range.</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
208
backend/app/templates/reports/base.html
Normal file
208
backend/app/templates/reports/base.html
Normal file
@@ -0,0 +1,208 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>{{ report_title }} - TOD</title>
|
||||
<style>
|
||||
@page {
|
||||
size: {% block page_size %}A4 portrait{% endblock %};
|
||||
margin: 20mm 15mm 25mm 15mm;
|
||||
@bottom-center {
|
||||
content: "Page " counter(page) " of " counter(pages);
|
||||
font-size: 9px;
|
||||
color: #64748B;
|
||||
}
|
||||
@bottom-right {
|
||||
content: "Generated by TOD";
|
||||
font-size: 9px;
|
||||
color: #64748B;
|
||||
}
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
||||
font-size: 11px;
|
||||
color: #1E293B;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.report-header {
|
||||
background: #1E293B;
|
||||
color: #FFFFFF;
|
||||
padding: 16px 20px;
|
||||
margin: -20mm -15mm 20px -15mm;
|
||||
padding-left: 15mm;
|
||||
padding-right: 15mm;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.report-header .brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.report-header .brand .logo {
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
background: #38BDF8;
|
||||
border-radius: 6px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 700;
|
||||
font-size: 16px;
|
||||
color: #0F172A;
|
||||
}
|
||||
|
||||
.report-header .brand .name {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.report-header .meta {
|
||||
text-align: right;
|
||||
font-size: 10px;
|
||||
color: #94A3B8;
|
||||
}
|
||||
|
||||
.report-header .meta .title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #FFFFFF;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.report-body {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: #0F172A;
|
||||
border-bottom: 2px solid #38BDF8;
|
||||
padding-bottom: 6px;
|
||||
margin-bottom: 12px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.section-title:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin-bottom: 16px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
thead th {
|
||||
background: #F1F5F9;
|
||||
color: #475569;
|
||||
font-weight: 600;
|
||||
text-align: left;
|
||||
padding: 8px 10px;
|
||||
border-bottom: 2px solid #E2E8F0;
|
||||
font-size: 9px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
tbody td {
|
||||
padding: 7px 10px;
|
||||
border-bottom: 1px solid #F1F5F9;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
tbody tr:nth-child(even) {
|
||||
background: #FAFBFC;
|
||||
}
|
||||
|
||||
.summary-box {
|
||||
background: #F8FAFC;
|
||||
border: 1px solid #E2E8F0;
|
||||
border-radius: 6px;
|
||||
padding: 12px 16px;
|
||||
margin-bottom: 16px;
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.summary-stat {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.summary-stat .value {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: #0F172A;
|
||||
}
|
||||
|
||||
.summary-stat .label {
|
||||
font-size: 9px;
|
||||
color: #64748B;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.badge {
|
||||
display: inline-block;
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
font-size: 9px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.badge-online { background: #DCFCE7; color: #166534; }
|
||||
.badge-offline { background: #FEE2E2; color: #991B1B; }
|
||||
.badge-unknown { background: #F1F5F9; color: #475569; }
|
||||
.badge-critical { background: #FEE2E2; color: #991B1B; }
|
||||
.badge-warning { background: #FEF3C7; color: #92400E; }
|
||||
.badge-info { background: #DBEAFE; color: #1E40AF; }
|
||||
.badge-firing { background: #FEE2E2; color: #991B1B; }
|
||||
.badge-resolved { background: #DCFCE7; color: #166534; }
|
||||
.badge-acknowledged { background: #DBEAFE; color: #1E40AF; }
|
||||
|
||||
.date-range {
|
||||
font-size: 11px;
|
||||
color: #64748B;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.no-data {
|
||||
text-align: center;
|
||||
padding: 40px 20px;
|
||||
color: #94A3B8;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
{% block extra_styles %}{% endblock %}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="report-header">
|
||||
<div class="brand">
|
||||
<div class="logo">M</div>
|
||||
<div class="name">TOD - The Other Dude</div>
|
||||
</div>
|
||||
<div class="meta">
|
||||
<div class="title">{{ report_title }}</div>
|
||||
<div>{{ tenant_name }} • Generated {{ generated_at }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="report-body">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
46
backend/app/templates/reports/change_log.html
Normal file
46
backend/app/templates/reports/change_log.html
Normal file
@@ -0,0 +1,46 @@
|
||||
{% extends "reports/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="date-range">
|
||||
Report period: {{ date_from }} to {{ date_to }}
|
||||
</div>
|
||||
|
||||
<div class="summary-box">
|
||||
<div class="summary-stat">
|
||||
<div class="value">{{ total_entries }}</div>
|
||||
<div class="label">Total Changes</div>
|
||||
</div>
|
||||
<div class="summary-stat">
|
||||
<div class="value">{{ data_source }}</div>
|
||||
<div class="label">Data Source</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if entries %}
|
||||
<h2 class="section-title">Change Log</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Timestamp</th>
|
||||
<th>User</th>
|
||||
<th>Action</th>
|
||||
<th>Device</th>
|
||||
<th>Details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in entries %}
|
||||
<tr>
|
||||
<td>{{ entry.timestamp }}</td>
|
||||
<td>{{ entry.user or '-' }}</td>
|
||||
<td>{{ entry.action }}</td>
|
||||
<td style="font-weight: 600;">{{ entry.device or '-' }}</td>
|
||||
<td>{{ entry.details or '-' }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="no-data">No changes found for the selected date range.</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
59
backend/app/templates/reports/device_inventory.html
Normal file
59
backend/app/templates/reports/device_inventory.html
Normal file
@@ -0,0 +1,59 @@
|
||||
{% extends "reports/base.html" %}
|
||||
|
||||
{% block page_size %}A4 landscape{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="summary-box">
|
||||
<div class="summary-stat">
|
||||
<div class="value">{{ total_devices }}</div>
|
||||
<div class="label">Total Devices</div>
|
||||
</div>
|
||||
<div class="summary-stat">
|
||||
<div class="value" style="color: #166534;">{{ online_count }}</div>
|
||||
<div class="label">Online</div>
|
||||
</div>
|
||||
<div class="summary-stat">
|
||||
<div class="value" style="color: #991B1B;">{{ offline_count }}</div>
|
||||
<div class="label">Offline</div>
|
||||
</div>
|
||||
<div class="summary-stat">
|
||||
<div class="value" style="color: #475569;">{{ unknown_count }}</div>
|
||||
<div class="label">Unknown</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if devices %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Hostname</th>
|
||||
<th>IP Address</th>
|
||||
<th>Model</th>
|
||||
<th>RouterOS</th>
|
||||
<th>Status</th>
|
||||
<th>Last Seen</th>
|
||||
<th>Uptime</th>
|
||||
<th>Groups</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for device in devices %}
|
||||
<tr>
|
||||
<td style="font-weight: 600;">{{ device.hostname }}</td>
|
||||
<td>{{ device.ip_address }}</td>
|
||||
<td>{{ device.model or '-' }}</td>
|
||||
<td>{{ device.routeros_version or '-' }}</td>
|
||||
<td>
|
||||
<span class="badge badge-{{ device.status }}">{{ device.status | upper }}</span>
|
||||
</td>
|
||||
<td>{{ device.last_seen or '-' }}</td>
|
||||
<td>{{ device.uptime or '-' }}</td>
|
||||
<td>{{ device.groups or '-' }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="no-data">No devices found for this tenant.</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
45
backend/app/templates/reports/metrics_summary.html
Normal file
45
backend/app/templates/reports/metrics_summary.html
Normal file
@@ -0,0 +1,45 @@
|
||||
{% extends "reports/base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div class="date-range">
|
||||
Report period: {{ date_from }} to {{ date_to }}
|
||||
</div>
|
||||
|
||||
{% if devices %}
|
||||
<h2 class="section-title">Resource Usage by Device</h2>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Hostname</th>
|
||||
<th>Avg CPU %</th>
|
||||
<th>Peak CPU %</th>
|
||||
<th>Avg Memory %</th>
|
||||
<th>Peak Memory %</th>
|
||||
<th>Avg Disk %</th>
|
||||
<th>Avg Temp</th>
|
||||
<th>Data Points</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for device in devices %}
|
||||
<tr>
|
||||
<td style="font-weight: 600;">{{ device.hostname }}</td>
|
||||
<td{% if device.avg_cpu and device.avg_cpu > 80 %} style="color: #991B1B; font-weight: 600;"{% elif device.avg_cpu and device.avg_cpu > 50 %} style="color: #92400E;"{% endif %}>
|
||||
{{ '%.1f' | format(device.avg_cpu) if device.avg_cpu is not none else '-' }}
|
||||
</td>
|
||||
<td>{{ '%.1f' | format(device.peak_cpu) if device.peak_cpu is not none else '-' }}</td>
|
||||
<td{% if device.avg_mem and device.avg_mem > 80 %} style="color: #991B1B; font-weight: 600;"{% elif device.avg_mem and device.avg_mem > 50 %} style="color: #92400E;"{% endif %}>
|
||||
{{ '%.1f' | format(device.avg_mem) if device.avg_mem is not none else '-' }}
|
||||
</td>
|
||||
<td>{{ '%.1f' | format(device.peak_mem) if device.peak_mem is not none else '-' }}</td>
|
||||
<td>{{ '%.1f' | format(device.avg_disk) if device.avg_disk is not none else '-' }}</td>
|
||||
<td>{{ '%.1f' | format(device.avg_temp) if device.avg_temp is not none else '-' }}</td>
|
||||
<td>{{ device.data_points }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="no-data">No metrics data found for the selected date range.</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user