|
|
@@ -1,7 +1,7 @@
|
|
|
// demo_dataset.go — Dataset demo canónico COMPLETO (port literal de
|
|
|
// server/src/demo/dataset.js, SPEC §7.1): 4 routers, WAN, trafficByRange,
|
|
|
-// health score, AdGuard, WireGuard, alertas, los 47 dispositivos (10
|
|
|
-// canónicos + 37 adicionales, sparklines deterministas con el mismo LCG),
|
|
|
+// health score, AdGuard, WireGuard, alertas, los 66 dispositivos (canon +
|
|
|
+// adicionales + fixtures topología v5, sparklines deterministas con el LCG),
|
|
|
// routerExtras, perfSeries, WAN_LATENCY_24H, adguardSeries24h, wgPeerExtras
|
|
|
// y WG_TOTALS_30D. Cada llamada a los builders devuelve estructuras NUEVAS
|
|
|
// (el adapter muta su copia con el random walk; el canon no se toca).
|
|
|
@@ -23,18 +23,27 @@ func canonRouters() []Router {
|
|
|
{ID: "flint2", Name: "Gateway", Model: "GL.iNet Flint 2 (GL-MT6000)", ModelShort: "GL.iNet Flint 2",
|
|
|
Role: "Gateway principal", RoleBadge: "Principal", IP: "192.168.8.1", Status: "online",
|
|
|
Health: 98, CPU: iptr(23), RAM: iptr(41), Temp: iptr(54), Uptime: "32d 14h", Clients: 33,
|
|
|
+ Backhaul: "cable",
|
|
|
Sparkline: []float64{8, 6, 5, 5, 6, 9, 18, 32, 41, 38, 35, 44, 52, 48, 45, 55, 68, 84, 96, 120, 150, 110, 84, 40}},
|
|
|
{ID: "living", Name: "Salón", Model: "OpenWrt AP (Xiaomi AX3000T)", ModelShort: "Xiaomi AX3000T",
|
|
|
Role: "Punto de acceso", RoleBadge: "AP", IP: "192.168.8.2", Status: "online",
|
|
|
Health: 95, CPU: iptr(12), RAM: iptr(38), Temp: iptr(47), Uptime: "32d 14h", Clients: 22,
|
|
|
+ Backhaul: "cable",
|
|
|
+ // Uplink cableado al gateway identificado por LLDP (sufijo "· LLDP")
|
|
|
+ Lldp: &LldpInfo{Chassis: "Flint 2", Mgmt: "192.168.8.1", Caps: "Bridge, Router", PortDesc: "lan1"},
|
|
|
Sparkline: []float64{4, 3, 3, 2, 3, 5, 10, 22, 28, 26, 24, 30, 38, 35, 33, 42, 55, 72, 88, 105, 132, 92, 61, 28}},
|
|
|
{ID: "estudio", Name: "Estudio", Model: "OpenWrt (NanoPi R4S)", ModelShort: "NanoPi R4S",
|
|
|
Role: "AP + switch", RoleBadge: "AP", IP: "192.168.8.3", Status: "online",
|
|
|
Health: 92, CPU: iptr(18), RAM: iptr(44), Temp: iptr(51), Uptime: "11d 3h", Clients: 9,
|
|
|
+ Backhaul: "cable",
|
|
|
+ // Uplink cableado al gateway identificado por LLDP (sufijo "· LLDP")
|
|
|
+ Lldp: &LldpInfo{Chassis: "Flint 2", Mgmt: "192.168.8.1", Caps: "Bridge, Router", PortDesc: "lan2"},
|
|
|
Sparkline: []float64{2, 2, 1, 1, 2, 4, 8, 15, 22, 25, 24, 22, 26, 24, 21, 24, 28, 31, 29, 24, 18, 12, 8, 4}},
|
|
|
+ // Patio: único AP con uplink inalámbrico del dataset (backhaul "wifi").
|
|
|
{ID: "patio", Name: "Patio", Model: "OpenWrt (TP-Link EAP225)", ModelShort: "TP-Link EAP225",
|
|
|
Role: "AP exterior", RoleBadge: "AP", IP: "192.168.8.4", Status: "warn",
|
|
|
Health: 68, CPU: iptr(31), RAM: iptr(57), Temp: iptr(71), Uptime: "4d 2h", Clients: 6, HotMetric: "temp",
|
|
|
+ Backhaul: "wifi",
|
|
|
Sparkline: []float64{1, 1, 1, 1, 1, 2, 3, 5, 7, 8, 8, 9, 10, 9, 8, 9, 11, 12, 13, 12, 9, 6, 4, 2}},
|
|
|
}
|
|
|
}
|
|
|
@@ -269,12 +278,10 @@ func additionalDevices() []Device {
|
|
|
IP: "192.168.8.12", MAC: "DC:A6:32:4F:77:02", RouterID: "flint2", Band: "cable",
|
|
|
SignalDbm: nil, TrafficMbps: 0.8, Online: true, AttachTo: "dist-flint2-lan3"}, 14, 0),
|
|
|
"raspberrypi", "IP fija (reserva)", "hace 320 días", "3,4 GB", "890 MB", true, "red", ""),
|
|
|
- // Switch gestionado identificado por LLDP (topología v5: type switch + Salón lan3)
|
|
|
- withDetails(devExtra(Device{ID: "switch-netgear", Name: "Switch Netgear", Type: "switch", Manufacturer: "Netgear GS308E",
|
|
|
- IP: "192.168.8.13", MAC: "28:C6:8E:1D:90:44", RouterID: "living", Band: "cable",
|
|
|
- SignalDbm: nil, TrafficMbps: 0.02, Online: true, Port: "lan3",
|
|
|
- Lldp: &LldpInfo{Chassis: "GS308E", Mgmt: "192.168.8.13", Caps: "Bridge", PortDesc: "ge5"}}, 15, 0.04),
|
|
|
- "gs308e", "IP fija (reserva)", "hace 300 días", "64 MB", "12 MB", false, "red", "Network"),
|
|
|
+ // NOTA (Fase 5): el switch gestionado GS308E (Salón lan3) ya NO es un
|
|
|
+ // Device: se representa como DistributionNode "managed" (ver
|
|
|
+ // canonDistributionNodes), con xbox/apple-tv/denon en abanico — la
|
|
|
+ // historia del mockup "identificado por LLDP" sin duplicar el chip.
|
|
|
withDetails(devExtra(Device{ID: "timbre-nest", Name: "Timbre Nest", Type: "camara", Manufacturer: "Google",
|
|
|
IP: "192.168.8.72", MAC: "F4:F5:D8:66:01:B8", RouterID: "flint2", Band: "2.4 GHz",
|
|
|
SignalDbm: iptr(-58), TrafficMbps: 0.6, Online: true}, 16, 0),
|
|
|
@@ -407,9 +414,10 @@ func withDetails(d Device, hostname, lease, firstSeen, rx, tx string, adguard bo
|
|
|
return d
|
|
|
}
|
|
|
|
|
|
-// canonAllDevices: los 67 clientes (canon expandido + adicionales + fixtures
|
|
|
-// de topología v5: switch gestionado LLDP, hipervisor con CTs, switch
|
|
|
-// inferido FDB — espejo del mock front app/src/data/mock.ts).
|
|
|
+// canonAllDevices: los 66 clientes (canon expandido + adicionales + fixtures
|
|
|
+// de topología v5: hipervisor con CTs, clientes tras switch inferido FDB y
|
|
|
+// tras el switch gestionado — espejo del mock front app/src/data/mock.ts).
|
|
|
+// Fase 5: el GS308E deja de ser Device (es el DistributionNode managed).
|
|
|
func canonAllDevices() []Device {
|
|
|
out := canonDevices()
|
|
|
out = append(out, additionalDevices()...)
|
|
|
@@ -418,24 +426,26 @@ func canonAllDevices() []Device {
|
|
|
}
|
|
|
|
|
|
// topologyDevices: fixtures NUEVAS de topología v5 (mockup aprobado
|
|
|
-// 2-Ago-2026). Los 3 clientes preexistentes (switch-netgear, pc-sobremesa,
|
|
|
-// raspberry-pi) se enriquecen in situ en additionalDevices — no se duplican.
|
|
|
+// 2-Ago-2026). Los clientes preexistentes (pc-sobremesa, raspberry-pi) se
|
|
|
+// enriquecen in situ en additionalDevices — no se duplican. El GS308E NO
|
|
|
+// existe como Device: es el DistributionNode "managed" (Fase 5).
|
|
|
func topologyDevices() []Device {
|
|
|
out := []Device{
|
|
|
- // 3 clientes detrás del switch gestionado (Salón)
|
|
|
+ // 3 clientes detrás del switch gestionado identificado por LLDP
|
|
|
+ // (nodo managed dist-living-lan3, Salón)
|
|
|
withDetails(Device{ID: "xbox-series-s", Name: "Xbox Series S", Type: "consola", Manufacturer: "Microsoft",
|
|
|
IP: "192.168.8.35", MAC: "7C:ED:8D:4A:11:22", RouterID: "living", Band: "cable",
|
|
|
- SignalDbm: nil, TrafficMbps: 9.8, Online: true, AttachTo: "switch-netgear",
|
|
|
+ SignalDbm: nil, TrafficMbps: 9.8, Online: true, AttachTo: "dist-living-lan3",
|
|
|
Sparkline: []float64{3, 5, 7, 9, 11, 12, 10, 9, 10, 9, 10, 9.8}},
|
|
|
"xbox-series-s", "renueva en 4 h 12 min", "hace 140 días", "31 GB", "1,9 GB", true, "tv", ""),
|
|
|
withDetails(Device{ID: "apple-tv-4k", Name: "Apple TV 4K", Type: "tv", Manufacturer: "Apple",
|
|
|
IP: "192.168.8.36", MAC: "F0:18:98:2B:33:44", RouterID: "living", Band: "cable",
|
|
|
- SignalDbm: nil, TrafficMbps: 15.2, Online: true, AttachTo: "switch-netgear",
|
|
|
+ SignalDbm: nil, TrafficMbps: 15.2, Online: true, AttachTo: "dist-living-lan3",
|
|
|
Sparkline: []float64{6, 8, 10, 12, 14, 16, 15, 14, 15, 15, 15, 15.2}},
|
|
|
"apple-tv-4k", "renueva en 6 h 3 min", "hace 210 días", "88 GB", "3,4 GB", true, "tv", ""),
|
|
|
withDetails(Device{ID: "receptor-denon", Name: "Receptor Denon", Type: "altavoz", Manufacturer: "Denon",
|
|
|
IP: "192.168.8.37", MAC: "00:05:CD:55:66:77", RouterID: "living", Band: "cable",
|
|
|
- SignalDbm: nil, TrafficMbps: 0.6, Online: true, AttachTo: "switch-netgear",
|
|
|
+ SignalDbm: nil, TrafficMbps: 0.6, Online: true, AttachTo: "dist-living-lan3",
|
|
|
Sparkline: []float64{0.4, 0.5, 0.5, 0.6, 0.6, 0.7, 0.6, 0.6, 0.6, 0.6, 0.6, 0.6}},
|
|
|
"denon-avr", "IP fija (reserva)", "hace 320 días", "640 MB", "42 MB", true, "iot", ""),
|
|
|
// Hipervisor Proxmox (gateway lan2); sus 10 CTs se anidan (OUI BC:24:11)
|
|
|
@@ -512,11 +522,17 @@ func topologyDevices() []Device {
|
|
|
return out
|
|
|
}
|
|
|
|
|
|
-// canonDistributionNodes: distnodes demo (en live los infiere el colector FDB).
|
|
|
+// canonDistributionNodes: distnodes demo (en live los infiere el colector
|
|
|
+// FDB/LLDP). Las DOS historias de switch: fantasma inferido (gateway lan3)
|
|
|
+// vs gestionado identificado por LLDP (Salón lan3, el GS308E del mockup con
|
|
|
+// sus 3 clientes en abanico; Fase 5: ya no existe como Device suelto).
|
|
|
func canonDistributionNodes() []DistributionNode {
|
|
|
return []DistributionNode{
|
|
|
{ID: "dist-flint2-lan3", Kind: "inferred", RouterID: "flint2", Port: "lan3", MacCount: 8},
|
|
|
{ID: "dist-pve", Kind: "hypervisor", RouterID: "flint2", Port: "lan2", MacCount: 11, HostDeviceID: "pve", Name: "Proxmox pve"},
|
|
|
+ {ID: "dist-living-lan3", Kind: "managed", RouterID: "living", Port: "lan3", MacCount: 4,
|
|
|
+ Name: "GS308E", Ip: "192.168.8.13",
|
|
|
+ Lldp: &LldpInfo{Chassis: "GS308E", Mgmt: "192.168.8.13", Caps: "Bridge", PortDesc: "ge5"}},
|
|
|
}
|
|
|
}
|
|
|
|