Просмотр исходного кода

feat(topology): anillos guia para todos los anillos wifi usados + punto orbitante 24s en la nube Internet (C3, port del mockup)

agent 4 месяцев назад
Родитель
Сommit
55320cc367
2 измененных файлов с 16 добавлено и 1 удалено
  1. 11 1
      app/src/components/topology/TopologyMap.tsx
  2. 5 0
      app/src/components/topology/model.ts

+ 11 - 1
app/src/components/topology/TopologyMap.tsx

@@ -668,9 +668,11 @@ export function TopologyMap({ model, apiRef, showLabels, flow, hoverLink, onHove
         </defs>
 
         {/* ------------------------- Anillos guía wifi ------------------------- */}
+        {/* guías para TODOS los anillos usados (el modelo añade anillos extra
+            si el wifi supera el aforo de los dos primeros) */}
         <g aria-hidden>
           {routerNodes.map((node) =>
-            (node.id === model.gatewayNode?.id ? [88, 118] : [74, 108]).map((r) => (
+            (model.ringRadii.get(node.id) ?? (node.id === model.gatewayNode?.id ? [88, 118] : [74, 108])).map((r) => (
               <circle
                 key={`${node.id}-ring-${r}`}
                 cx={node.x}
@@ -811,6 +813,14 @@ export function TopologyMap({ model, apiRef, showLabels, flow, hoverLink, onHove
                 transition={{ duration: 5, repeat: Infinity, ease: 'easeInOut' }}
               />
             )}
+            {/* anillo orbital con punto rotando 24s (mockup v5) */}
+            {!reduce && (
+              <g aria-hidden>
+                <circle r={38} fill="none" stroke={COLOR.ok} strokeWidth={1.2} strokeDasharray="3 7" opacity={0.55} />
+                <circle r={3} fill={COLOR.ok} cx={0} cy={-38} />
+                <animateTransform attributeName="transform" type="rotate" from="0" to="360" dur="24s" repeatCount="indefinite" />
+              </g>
+            )}
             <circle r={28} fill="rgb(var(--elevated))" stroke={COLOR.ok} strokeWidth={2} />
             <Cloud x={-12} y={-10} width={24} height={20} className="text-ok" strokeWidth={1.75} aria-hidden />
           </motion.g>

+ 5 - 0
app/src/components/topology/model.ts

@@ -130,6 +130,8 @@ export interface TopologyModel {
   ctsByHost: Map<string, ChipNode[]>
   /** nº de CTs por host (badge +N) */
   ctCountByHost: Map<string, number>
+  /** radios de los anillos wifi realmente usados por router (guías punteadas) */
+  ringRadii: Map<string, number[]>
   links: TopoLink[]
   totalPackets: number
   activeLinkCount: number
@@ -454,6 +456,7 @@ export function buildTopologyModel({ routers, devices, wan, wireguard, distribut
   })
 
   // wifi: anillos con arcos prohibidos (uplink, etiqueta, WAN, fan cableado)
+  const ringRadii = new Map<string, number[]>()
   for (const node of routerNodes) {
     const isGw = node.id === gatewayNode?.id
     const wifi = childrenOf(node.id).filter((d) => !isWired(d)).map((d) => mkChip(d, node.id))
@@ -477,6 +480,7 @@ export function buildTopologyModel({ routers, devices, wan, wireguard, distribut
       rings.push({ r: last.r + 30, cap: last.cap + 5 })
       cap = rings.reduce((a, r) => a + r.cap, 0)
     }
+    ringRadii.set(node.id, rings.map((r) => r.r))
     ringLayout(wifi, node, rings, excludes)
     // chips algo menores en anillos externos
     wifi.forEach((c, i) => {
@@ -754,6 +758,7 @@ export function buildTopologyModel({ routers, devices, wan, wireguard, distribut
     distNodes,
     ctsByHost,
     ctCountByHost,
+    ringRadii,
     links,
     totalPackets,
     activeLinkCount,