Skip to content

Real-time network monitor + outbound firewall — see & block every connection. Privacy-first, local-first, Rust fleet agent, SIEM exports, 8 languages. / Moniteur réseau temps réel + pare-feu sortant, agent de flotte Rust, exports SIEM. 100 % local.

ui: add 'Alertes/Alerts' filter chip — shows only warned/critical nodes

MoneyLisa4e47be72a117
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index 5266e51..9c6b958 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -78,11 +78,11 @@ export default function App() {
if (id === 'local') { out[id] = node; continue }
const procs = node.processes ? Object.keys(node.processes) : []
if (procs.length > 0 && procs.every(p => excludedProcesses.includes(p))) continue
- if (!matchesFilter(node, filter)) continue
+ if (!matchesFilter(node, filter, alertedNodes)) continue
out[id] = node
}
return out
- }, [nodes, excludedProcesses, filter])
+ }, [nodes, excludedProcesses, filter, alertedNodes])
// EN: LAN devices obey the same filter in the graph — picking "Tracking"
// hides the local devices too; the sidebar keeps its own filtering.
@@ -93,10 +93,10 @@ export default function App() {
if (!filter || (filter.category === 'all' && !filter.text)) return lanDevices
const out = {}
for (const [id, d] of Object.entries(lanDevices)) {
- if (matchesFilter({ ...d, label: d.hostname }, filter)) out[id] = d
+ if (matchesFilter({ ...d, label: d.hostname }, filter, alertedNodes)) out[id] = d
}
return out
- }, [lanDevices, filter])
+ }, [lanDevices, filter, alertedNodes])
const filteredEdges = useMemo(() => {
const visibleIds = new Set([...Object.keys(filteredNodes), ...Object.keys(filteredLanDevices)])
@@ -164,6 +164,7 @@ export default function App() {
filter={filter}
onFilterChange={setFilter}
onWhitelist={handleWhitelist}
+ alertedNodes={alertedNodes}
/>
<div style={{ flex: 1, display: 'flex', flexDirection: 'column', overflow: 'hidden' }}>
diff --git a/frontend/src/components/SearchBar.jsx b/frontend/src/components/SearchBar.jsx
index 7f8738e..519ac76 100644
--- a/frontend/src/components/SearchBar.jsx
+++ b/frontend/src/components/SearchBar.jsx
@@ -22,6 +22,7 @@ const CATEGORY_IDS = [
{ id: 'cdn', label: 'CDN', color: '#6366f1' },
{ id: 'dns', label: 'DNS', color: '#38bdf8' },
{ id: 'unknown', color: '#94a3b8' },
+ { id: 'alerted', color: '#ef4444' },
]
export default function SearchBar({ filter, onChange }) {
@@ -30,7 +31,9 @@ export default function SearchBar({ filter, onChange }) {
const categories = CATEGORY_IDS.map(c => ({
...c,
- label: c.label ?? (c.id === 'all' ? t('cat_all') : t('cat_unknown')),
+ label: c.label ?? (c.id === 'all' ? t('cat_all')
+ : c.id === 'alerted' ? t('cat_alerted')
+ : t('cat_unknown')),
}))
return (
diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx
index 9938528..55957b3 100644
--- a/frontend/src/components/Sidebar.jsx
+++ b/frontend/src/components/Sidebar.jsx
@@ -61,13 +61,19 @@ function fmt(bytes) {
/**
* EN: Does a node match the active search filter? The "local" node and any
- * node matching the category always pass unless the text fails.
+ * node matching the category always pass unless the text fails. The
+ * special "alerted" category keeps only nodes present in `alertedIds`
+ * (warning/critical alert map), regardless of their traffic category.
* FR: Un nœud correspond-il au filtre de recherche actif ? Le nœud « local »
* et tout nœud de la bonne catégorie passent sauf si le texte échoue.
+ * La catégorie spéciale « alerted » ne garde que les nœuds présents dans
+ * `alertedIds` (alertes warning/critique), quelle que soit la catégorie.
*/
-export function matchesFilter(node, filter) {
+export function matchesFilter(node, filter, alertedIds) {
if (!filter || (filter.category === 'all' && !filter.text)) return true
- if (filter.category !== 'all' && node.category !== filter.category) return false
+ if (filter.category === 'alerted') {
+ if (!alertedIds || !alertedIds.has(node.id)) return false
+ } else if (filter.category !== 'all' && node.category !== filter.category) return false
if (filter.text) {
const t = filter.text.toLowerCase()
return (node.label || '').toLowerCase().includes(t)
@@ -78,13 +84,19 @@ export function matchesFilter(node, filter) {
return true
}
-export default function Sidebar({ nodes, lanDevices, packets, selected, onClose, privacyScore, bandwidth, filter, onFilterChange, onWhitelist }) {
+export default function Sidebar({ nodes, lanDevices, packets, selected, onClose, privacyScore, bandwidth, filter, onFilterChange, onWhitelist, alertedNodes }) {
const { t } = useT()
const extNodes = Object.values(nodes).filter(n => n.id !== 'local')
+ // EN: the "Alerts" chip narrows the LAN list to flagged devices too —
+ // other categories keep the full device list (they're local, not hosts).
+ // FR: la puce « Alertes » réduit aussi la liste LAN aux appareils
+ // signalés — les autres catégories gardent la liste complète (ce sont
+ // des appareils locaux, pas des hôtes).
const devList = Object.values(lanDevices)
+ .filter(d => filter?.category !== 'alerted' || (alertedNodes && alertedNodes.has(d.id)))
const totalBytes = extNodes.reduce((a, n) => a + (n.bytes || 0), 0)
- const filteredNodes = extNodes.filter(n => matchesFilter(n, filter))
+ const filteredNodes = extNodes.filter(n => matchesFilter(n, filter, alertedNodes))
const hiddenCount = filteredNodes.length < extNodes.length ? extNodes.length : null
return (
diff --git a/frontend/src/i18n.jsx b/frontend/src/i18n.jsx
index 41298b9..613b12e 100644
--- a/frontend/src/i18n.jsx
+++ b/frontend/src/i18n.jsx
@@ -69,6 +69,7 @@ const en = {
search_placeholder: 'Search host, IP, country…',
cat_all: 'All',
cat_unknown: 'Unknown',
+ cat_alerted: 'Alerts',
cat_safe: 'Safe',
cat_tracking: 'Tracking',
cat_cdn: 'CDN',
@@ -305,6 +306,7 @@ const fr = {
search_placeholder: 'Rechercher hôte, IP, pays…',
cat_all: 'Tout',
cat_unknown: 'Inconnu',
+ cat_alerted: 'Alertes',
cat_safe: 'Sûr',
cat_tracking: 'Pistage',
cat_cdn: 'CDN',