feat: v0.1.4 — device intelligence dashboard
Add tabbed dashboard at /dashboard/ with three D3.js visualizations: - Vendor treemap (devices grouped by type and vendor) - SSID social graph (force-directed, shared probed SSIDs as edges) - Fingerprint clusters (packed circles by device behavior) Intelligence API endpoints at /api/v1/intelligence/ with param validation. Dashboard built on htmx + Pico CSS dark theme + D3 v7, all vendored locally (make vendor). 13 new tests (59 total).
This commit is contained in:
149
static/css/main.css
Normal file
149
static/css/main.css
Normal file
@@ -0,0 +1,149 @@
|
||||
/* ESP32-Web Dashboard — dark theme overrides for Pico CSS */
|
||||
:root {
|
||||
--pico-font-family: system-ui, -apple-system, sans-serif;
|
||||
}
|
||||
|
||||
/* Tab navigation */
|
||||
.tab-nav {
|
||||
display: flex;
|
||||
gap: 0;
|
||||
border-bottom: 2px solid var(--pico-muted-border-color);
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.tab-nav a {
|
||||
padding: 0.6rem 1.2rem;
|
||||
text-decoration: none;
|
||||
color: var(--pico-muted-color);
|
||||
border-bottom: 2px solid transparent;
|
||||
margin-bottom: -2px;
|
||||
transition: color 0.2s, border-color 0.2s;
|
||||
}
|
||||
|
||||
.tab-nav a:hover {
|
||||
color: var(--pico-primary);
|
||||
}
|
||||
|
||||
.tab-nav a.active {
|
||||
color: var(--pico-primary);
|
||||
border-bottom-color: var(--pico-primary);
|
||||
}
|
||||
|
||||
/* Viz containers */
|
||||
.viz-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
.viz-container svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* Loading state */
|
||||
.viz-loading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 400px;
|
||||
color: var(--pico-muted-color);
|
||||
}
|
||||
|
||||
/* Treemap */
|
||||
.treemap-cell {
|
||||
stroke: var(--pico-background-color);
|
||||
stroke-width: 1px;
|
||||
}
|
||||
|
||||
.treemap-label {
|
||||
fill: #fff;
|
||||
font-size: 11px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Force graph */
|
||||
.graph-node {
|
||||
stroke: var(--pico-background-color);
|
||||
stroke-width: 1.5px;
|
||||
cursor: grab;
|
||||
}
|
||||
|
||||
.graph-node:active {
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.graph-link {
|
||||
stroke: var(--pico-muted-border-color);
|
||||
stroke-opacity: 0.5;
|
||||
}
|
||||
|
||||
.graph-label {
|
||||
font-size: 10px;
|
||||
fill: var(--pico-muted-color);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Pack layout */
|
||||
.cluster-circle {
|
||||
stroke: var(--pico-muted-border-color);
|
||||
stroke-width: 1px;
|
||||
fill-opacity: 0.7;
|
||||
}
|
||||
|
||||
.cluster-label {
|
||||
font-size: 11px;
|
||||
fill: #fff;
|
||||
pointer-events: none;
|
||||
text-anchor: middle;
|
||||
}
|
||||
|
||||
/* D3 tooltip */
|
||||
.d3-tooltip {
|
||||
position: absolute;
|
||||
padding: 0.5rem 0.75rem;
|
||||
background: var(--pico-card-background-color, #1a1a2e);
|
||||
border: 1px solid var(--pico-muted-border-color);
|
||||
border-radius: 4px;
|
||||
font-size: 0.8rem;
|
||||
color: var(--pico-color);
|
||||
pointer-events: none;
|
||||
z-index: 10;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
/* Stats row */
|
||||
.stats-row {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
flex: 1;
|
||||
min-width: 120px;
|
||||
text-align: center;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.stat-card .stat-value {
|
||||
font-size: 2rem;
|
||||
font-weight: 700;
|
||||
color: var(--pico-primary);
|
||||
}
|
||||
|
||||
.stat-card .stat-label {
|
||||
font-size: 0.85rem;
|
||||
color: var(--pico-muted-color);
|
||||
}
|
||||
|
||||
/* Empty state */
|
||||
.viz-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 300px;
|
||||
color: var(--pico-muted-color);
|
||||
font-style: italic;
|
||||
}
|
||||
4
static/css/vendor/pico.min.css
vendored
Normal file
4
static/css/vendor/pico.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user