Cybersecurity-Projects/PROJECTS/advanced/monitor-the-situation-dashb.../frontend
CarterPerez-dev d01fc57989 fix(monitor/frontend): DShield panel matches actual snapshot.scan_firehose shape
The panel crashed at runtime with "(ds.topports ?? []).slice is not a
function" because Plan 5 assumed shapes that didn't match what the Phase 2
DShield collector actually emits. Reality:

  topports: Record<string, Port>      // dict keyed "0".."N", not Array
  port field: targetport              // not "port"
  topips[].source                     // the IP — not "ip"
  topips[].reports                    // the count — not "records"
  topips                              // has no country/CC field
  dailysummary[].date                 // ISO date string, ascending order

toArray() helper accepts both Record<string,T> and T[] defensively (so
either shape works if the backend changes its mind). Both lists sort by
rank before slicing. The CC column is dropped (data doesn't carry it);
its slot becomes the per-source target count which the data does carry.
Daily summary picks the latest entry by date instead of index 0 (the
order is ascending, so [0] would be the oldest day).

Bigger discovery: most snapshot keys (cve_new / kev_added /
ransomware_victim / coinbase_price / etc.) are LATEST-event payloads,
not the recent-list arrays Plan 5 anticipated. Tasks 15-21 will need
per-topic Zustand stores that accumulate over time, populated by Task 24
from snapshot bootstrap + WS messages. Will discuss with Carter before
committing to that architecture.
2026-05-03 09:12:36 -04:00
..
public/assets feat(monitor): infra scaffold — Dockerfiles, conf/ tree, .gitignore 2026-05-01 06:12:25 -04:00
src fix(monitor/frontend): DShield panel matches actual snapshot.scan_firehose shape 2026-05-03 09:12:36 -04:00
.dockerignore feat(monitor): infra scaffold — Dockerfiles, conf/ tree, .gitignore 2026-05-01 06:12:25 -04:00
.gitignore feat(monitor): infra scaffold — Dockerfiles, conf/ tree, .gitignore 2026-05-01 06:12:25 -04:00
.stylelintignore feat(monitor): infra scaffold — Dockerfiles, conf/ tree, .gitignore 2026-05-01 06:12:25 -04:00
biome.json feat(monitor): infra scaffold — Dockerfiles, conf/ tree, .gitignore 2026-05-01 06:12:25 -04:00
index.html feat(monitor/frontend): ethos-aligned base styles (zero rounding, density, tabular nums) 2026-05-02 05:33:12 -04:00
package.json feat(monitor/frontend): shared Panel shell + KPI + Sparkline + StaleIndicator primitives 2026-05-03 07:12:20 -04:00
pnpm-lock.yaml feat(monitor/frontend): shared Panel shell + KPI + Sparkline + StaleIndicator primitives 2026-05-03 07:12:20 -04:00
stylelint.config.js feat(monitor): infra scaffold — Dockerfiles, conf/ tree, .gitignore 2026-05-01 06:12:25 -04:00
tsconfig.app.json feat(monitor): infra scaffold — Dockerfiles, conf/ tree, .gitignore 2026-05-01 06:12:25 -04:00
tsconfig.json feat(monitor): infra scaffold — Dockerfiles, conf/ tree, .gitignore 2026-05-01 06:12:25 -04:00
tsconfig.node.json feat(monitor): infra scaffold — Dockerfiles, conf/ tree, .gitignore 2026-05-01 06:12:25 -04:00
vite.config.ts feat(monitor): infra scaffold — Dockerfiles, conf/ tree, .gitignore 2026-05-01 06:12:25 -04:00