Преглед изворни кода

style: plain hyphens in the facet prose

The facet change brought 21 em dashes in comments and the CHANGELOG entry. The one in model.ts stays: band: '—' is a data sentinel for synthetic CT nodes, not prose.
gnacho пре 2 дана
родитељ
комит
da0aef0bfc

+ 1 - 1
CHANGELOG.md

@@ -12,7 +12,7 @@ y este proyecto se adhiere a [Versionado Semántico](https://semver.org/lang/es/
 - A host that runs other machines - an RKE2 node, a PVE box, a Docker host - can report the guests nested inside it through an optional `workloads` section in the push: stable id, name, kind and state per guest. The server keeps the census as reported and shows it on the unit's detail page, a count and a list with each workload's state. It is detail data, not graph data: a node with a hundred pods does not draw a hundred clients (#2227). Thanks to @brainnoms for the contract.
 - A unit that is not the gateway can keep the neighbours of its uplink out of its client list. The agent reports its logical networks with their Linux devices, the router detail page shows a Client discovery panel with Automatic, On or Off per network, and Automatic ignores the network that carries the unit's uplink (`br-*` bridges excepted, where an AP's uplink is its own LAN). Only devices attributed from ARP alone are filtered: a wireless association or an FDB entry still wins (#2235).
 - An invalid MAC that a poll, a push or a beacon drops is now logged once per value instead of silently. Each subsystem keeps its own logger, forgets after 24 hours, and caps at 64 keys before a single suppression line (#2240).
-- A topology override can declare an agent row a `facet` of an existing device (target = agent slug, parent = the host's MAC): the agent stops being a second box on the map and becomes a face of the host it describes. The fold drops the row from `routers[]` and the canvas, hangs a `facet` pointer on the parent device (`{routerId, label, online}`) and renders the agent's panels — system vitals plus its workload census — inside the device's detail view. A stopped agent badges the device ("RKE2 agent down") instead of resurrecting the box, and health keeps scoring the full fleet (#2227).
+- A topology override can declare an agent row a `facet` of an existing device (target = agent slug, parent = the host's MAC): the agent stops being a second box on the map and becomes a face of the host it describes. The fold drops the row from `routers[]` and the canvas, hangs a `facet` pointer on the parent device (`{routerId, label, online}`) and renders the agent's panels - system vitals plus its workload census - inside the device's detail view. A stopped agent badges the device ("RKE2 agent down") instead of resurrecting the box, and health keeps scoring the full fleet (#2227).
 - A switch fed only by the Realtek beacon can report the LLDP neighbours it receives, as an optional `lldp` section in the datagram, so the topology gets the chassis name, the local port and the management address from the unit that really sees those frames. The section is bounded (64 neighbours, 128 characters per text field), an old build keeps working unchanged, and an absent section keeps the last known neighbours (#2184).
 - A rejected push says why. The server answered `unauthorized`, `invalid_signature` or `stale_payload` and kept only a timestamp, so the panel showed the same "token rejected" badge for a stale token, an agent older than the server and a unit whose clock is minutes off. The reason is stored next to the timestamp, returned by `/api/agents` as `rejectedReason`, shown in the badge tooltip with what to check, and quoted in the auto-rearm alert, which no longer says "restarted but did not come back" when the pushes never got in (#2211).
 

+ 1 - 1
app/public/locales/en/translation.json

@@ -1723,7 +1723,7 @@
     "host": {
       "hypervisor": "hypervisor",
       "proxmox": "Proxmox",
-      "note": "Hypervisor: {{count}} CTs/VMs behind its virtual bridge — not a switch",
+      "note": "Hypervisor: {{count}} CTs/VMs behind its virtual bridge - not a switch",
       "workloadAllRunning": "all running",
       "workloadDown_one": "{{count}} down",
       "workloadDown_other": "{{count}} down"

+ 1 - 1
app/public/locales/es/translation.json

@@ -1723,7 +1723,7 @@
     "host": {
       "hypervisor": "hipervisor",
       "proxmox": "Proxmox",
-      "note": "Hipervisor: {{count}} CTs/VMs tras su bridge virtual — no es un switch",
+      "note": "Hipervisor: {{count}} CTs/VMs tras su bridge virtual - no es un switch",
       "workloadAllRunning": "todas en marcha",
       "workloadDown_one": "{{count}} caída",
       "workloadDown_other": "{{count}} caídas"

+ 3 - 3
app/src/components/DeviceFacetPanel.tsx

@@ -1,11 +1,11 @@
 /**
- * DeviceFacetPanel — NETPULSE-ONE-LEGION.
+ * DeviceFacetPanel - NETPULSE-ONE-LEGION.
  *
  * An agent row the fleet declared `facet` of this device is not a box:
  * it is another face of the host (the RKE2 agent on the legion machine).
  * The server drops it from routers[]/topology and hangs a DeviceFacet
  * pointer on the parent device; this panel is where the folded agent's
- * truth lives — vitals straight from the agent row plus its workload
+ * truth lives - vitals straight from the agent row plus its workload
  * census (the #2227 WorkloadsPanel, reused untouched).
  *
  * When the agent stops pushing, the device carries the badge (no ghost
@@ -28,7 +28,7 @@ interface FacetDetailResponse {
 }
 
 /** One vitals chip; null values (pusher without the section) are skipped,
- *  never painted as zero — the #441 law for external units. */
+ *  never painted as zero - the #441 law for external units. */
 function Vital({ label, value }: { label: string; value: string | null }) {
   if (value === null) return null
   return (

+ 1 - 1
app/src/components/routers/AgentsSection.tsx

@@ -933,7 +933,7 @@ export function AgentsSection() {
   const { agents, routers, devices } = useNetPulse()
 
   // Facet overrides (agent rows folded into a host device): the Agents table
-  // must not re-mint a "second host" identity for a faceted slug — label it
+  // must not re-mint a "second host" identity for a faceted slug - label it
   // with the facet name and the device it folds into instead of a bare slug.
   const [facetBySlug, setFacetBySlug] = useState<Record<string, { name?: string; parentName?: string }>>({})
   useEffect(() => {

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

@@ -2052,7 +2052,7 @@ const ChipGroup = memo(function ChipGroup({
   const Icon = deviceIcon(d)
   // #1757: la VLAN manda sobre el color del borde para que dos clientes del
   // mismo puerto/VLAN se lean como el mismo segmento. LLDP sigue con su badge.
-  // Facet CT caído (FACET-TOPOLOGY-CANVAS): el estado del censo manda — un
+  // Facet CT caído (FACET-TOPOLOGY-CANVAS): el estado del censo manda - un
   // huésped no-running se busca POR COLOR desde el mapa, ámbar = hay un
   // problema bajo este hipervisor.
   const stroke = chip.workloadState === 'warn'

+ 10 - 10
server-go/internal/adapters/facet.go

@@ -1,8 +1,8 @@
-// facet.go — the "facet" topology-override kind (NETPULSE-ONE-LEGION).
+// facet.go - the "facet" topology-override kind (NETPULSE-ONE-LEGION).
 //
 // An external agent push is contractually a router, so a pusher that
 // describes an EXISTING host (the RKE2 agent on the legion box) mints a
-// box for a machine the fleet already draws — two representations of one
+// box for a machine the fleet already draws - two representations of one
 // host is a lie on the map. A facet override says: the target row (agent
 // slug, non-MAC ids accepted per the #1485 precedent) is not a new box
 // but another face of the device whose MAC is the parent.
@@ -14,7 +14,7 @@
 // panels (system vitals + workloads) inside the device's detail view.
 //
 // Graceful-degradation rule: a facet only folds when BOTH ends are
-// present — the target router in the list and the parent device in the
+// present - the target router in the list and the parent device in the
 // census. A facet that cannot render leaves the box standing (a box is
 // honest; a swallowed row is not), and no ghost box can reappear while
 // the override is enabled: staleness rides on DeviceFacet.Online, which
@@ -45,7 +45,7 @@ type DeviceFacet struct {
 	// Online mirrors the faceted router row's status so a stopped pusher
 	// badges the device instead of drawing a box.
 	Online bool `json:"online"`
-	// Workloads is the agent's last reported guest census (count only —
+	// Workloads is the agent's last reported guest census (count only -
 	// the full list is detail data, fetched from the router's detail
 	// endpoint when the panel opens). 0 with WorkloadsKnown false means
 	// the agent never reported the section.
@@ -53,7 +53,7 @@ type DeviceFacet struct {
 	WorkloadsKnown bool `json:"workloadsKnown,omitempty"`
 	// WorkloadItems is the bounded sample of the census the canvas grids
 	// as CT chips under the host (the facet→hypervisor bridge,
-	// FACET-TOPOLOGY-CANVAS). Capped at facetWorkloadItemCap — Workloads
+	// FACET-TOPOLOGY-CANVAS). Capped at facetWorkloadItemCap - Workloads
 	// stays the true total. Non-running items always survive the cap:
 	// a down guest must stay findable in the sample, so the fill order
 	// keeps every not-running item before trimming running ones.
@@ -75,7 +75,7 @@ type censusFunc func(routerID string) (items []probe.WorkloadItem, count int, ok
 // parents. When nothing folds, the inputs are returned untouched.
 func foldFacetRouters(routers []Router, devices []Device, overrides []TopologyOverride,
 	census censusFunc) ([]Router, []Device) {
-	// Index enabled facets: target id (lowercased — targets may be router
+	// Index enabled facets: target id (lowercased - targets may be router
 	// slugs, and the #1485 lane already matches those case-insensitively)
 	// → override. First enabled row per target wins (List is ordered by
 	// enabled DESC, created ASC).
@@ -151,7 +151,7 @@ func foldFacetRouters(routers []Router, devices []Device, overrides []TopologyOv
 
 // censusOfLastPolled reports the last workload census an agent pushed
 // (live state; ok=false when the agent never reported the section or the
-// census is older than the #2236 TTL — a dead pusher must not keep painting
+// census is older than the #2236 TTL - a dead pusher must not keep painting
 // facet counts and CT chips, only its offline badge).
 func (l *Live) censusOfLastPolled(id string) ([]probe.WorkloadItem, int, bool) {
 	l.mu.Lock()
@@ -169,7 +169,7 @@ func (l *Live) censusOfLastPolled(id string) ([]probe.WorkloadItem, int, bool) {
 
 // capWorkloadSample trims a census to `cap` items for the facet pointer
 // without hiding a problem: every not-running item is kept first (the
-// down-state needle must survive the cut — the canvas paints it in warn
+// down-state needle must survive the cut - the canvas paints it in warn
 // and the tooltip counts it), then running ones fill the rest in census
 // order. The copy never aliases the polled slice's backing array (#1378
 // law: projections do not share live state).
@@ -210,7 +210,7 @@ func workloadRunning(state string) bool {
 // foldFacetedRouters drops agent rows the fleet declared as facets of an
 // existing device from a router list, checking parent presence against
 // the attributed device census (a facet whose host is gone keeps its
-// box — the fold never swallows a row it cannot render).
+// box - the fold never swallows a row it cannot render).
 func (l *Live) foldFacetedRouters(routers []Router) []Router {
 	if l.db == nil {
 		return routers
@@ -235,7 +235,7 @@ func (l *Live) foldFacetedDevices(devices []Device) []Device {
 	}
 	// The fold learns the facet's status and census from the ROUTER rows,
 	// so the device half needs them too: pass the unfolded base list (the
-	// nil-routers call would fold nothing — there would be no target).
+	// nil-routers call would fold nothing - there would be no target).
 	_, d := foldFacetRouters(l.routerRows(), devices, ov, l.censusOfLastPolled)
 	return d
 }

+ 1 - 1
server-go/internal/adapters/facet_test.go

@@ -1,4 +1,4 @@
-// facet_test.go — el plegado de facets (NETPULSE-ONE-LEGION): una fila de
+// facet_test.go - el plegado de facets (NETPULSE-ONE-LEGION): una fila de
 // agente declarada facet de un device existente NO es una caja; desaparece
 // del listado y deja su puntero en el device padre.
 package adapters

+ 2 - 2
server-go/internal/adapters/live.go

@@ -5127,7 +5127,7 @@ func (l *Live) buildOverview(ctx context.Context) (*Overview, error) {
 	// queden vacíos los absorbe después #1374 sin dejar huérfanos.
 	claimSwitchFdbClients(polled, devices, distNodes, gwID, fdbEvidence, lldpEvidence, overrideUplinks)
 	// Facet fold (NETPULSE-ONE-LEGION): an agent row the fleet declared
-	// facet of an existing device is not a box — it drops out of the
+	// facet of an existing device is not a box - it drops out of the
 	// canvas and the overview's router list, and the parent device
 	// carries the pointer (Device.Facet) so its panels render inside the
 	// device's detail view. Health still scores the FULL fleet: a stopped
@@ -5139,7 +5139,7 @@ func (l *Live) buildOverview(ctx context.Context) (*Overview, error) {
 			return nil, 0, false
 		}
 		// #2236 freshness: past the TTL the census is not data, it is a
-		// fossil — fold without chips (gnacho on #2233).
+		// fossil - fold without chips (gnacho on #2233).
 		w := freshWorkloads(p.workloads, p.polledAt, l.nowMillis())
 		if w == nil {
 			return nil, 0, false