Skip to content

Settings admin panes + Reports definitions CRUD, plus frontend-next CI (#1608) - #1619

Merged
Xore merged 4 commits into
port-foundationfrom
port-1608-settings-reports-ui
Aug 18, 2026
Merged

Settings admin panes + Reports definitions CRUD, plus frontend-next CI (#1608)#1619
Xore merged 4 commits into
port-foundationfrom
port-1608-settings-reports-ui

Conversation

@Xore

@Xore Xore commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

Closes the last concrete functional gap in #1608's frontend port: two pages had backend APIs with zero frontend consumers.

settings.tsx gains the four admin panes the legacy dashboard's settings modal had:

  • Services — sensors/probes/workers table (state/health/restarts), start/stop/restart (admin-gated), log viewer.
  • Configuration history — revision list + rollback (admin-gated).
  • Audit log — settings mutation log, filterable by the actual action: "..." strings used across the crate.
  • Reporter stats — report-sender metric glance (attempted/sent/suppressed/dry-run/failed).

reports.tsx: the report-definitions block was a raw <pre>{JSON.stringify(...)}</pre> dump with a comment saying editing needed the worker port — that port (#1610) is done and reports_api.rs has full CRUD + generate. Replaced with real create/edit/delete/generate UI, admin-gated the same way, template/theme/scope/elements/branding/schedule fields validated against the actual backend constants (MAX_REPORT_NAME=60, theme ∈ {dark,light}).

Every mutation follows the existing savePresentation admin-gating precedent (checked at the BFF, since the Rust tier's own trust boundary is the service token, not a role check). No new CSS — every class used was already present in theme.css and already used elsewhere in this app.

CI: frontend-next has had zero CI coverage since it was scaffolded (the "Dashboard frontend" job only ever built the legacy dashboard/frontend). Added a parallel frontend-next job: npm ci → regenerate + diff-check the committed route tree → tsc --noEmitvite build. The typecheck step is continue-on-error: true for now — it surfaces a real, pre-existing, codebase-wide issue (65 errors, 22 files) unrelated to this PR: TanStack Start's compile-time serialization check rejects Record<string, unknown> (used everywhere for raw ES _source docs) because unknown can't be proven JSON-safe, even though it always is here. vite build (esbuild, doesn't type-check) is unaffected and stays the real blocking gate. Filed #1618 to track the real fix and flip typecheck back to blocking.

Verification

  • npm run build: clean, no errors.
  • port-tests/backend-api.sh against live ES: 69/69 pass.
  • port-tests/frontend-ssr.sh against live ES: 38/38 pass, including /settings and /reports.
  • Manually round-tripped the one genuinely new write path directly against live ES (create → generate → delete a report definition via curl, exactly the payload shape the frontend sends) — confirmed working, generated a real PDF, test artifact cleaned up afterward.

Test plan

  • Build passes
  • Live-ES backend + SSR smoke suites pass (107/107)
  • Manual write-path round trip (report definition CRUD + generate) against live ES
  • Visual check in a browser (not done from this environment — recommend a quick look before merge)

🤖 Generated with Claude Code

Xore and others added 3 commits August 19, 2026 00:28
frontend-next has had zero CI coverage since it was scaffolded --
the "Dashboard frontend" job only ever built the legacy
dashboard/frontend. Add a parallel job: npm ci, generate-routes
(+ diff-check the committed routeTree.gen.ts for drift), tsc
--noEmit, then a full vite build. Deliberately does not wire in
port-tests/ (needs live ES over an SSH tunnel to the homeserver --
not reachable from a GitHub-hosted runner, and not appropriate to
point at production data from CI); that suite stays a manual/local
verification step.
Settings (#1612): add the four admin panes the legacy dashboard's
settings modal had but frontend-next never got a consumer for —
Services (start/stop/restart honeypot sensors/probes/workers + log
viewer), Reporter stats (metrics.json passthrough glance), Configuration
history (revision list + rollback), and the settings Audit log
(filterable by action). Every mutation (service actions, rollback)
follows the exact same client-enforced-at-the-BFF admin-gating pattern
as the existing savePresentation handler, since the Rust tier itself
has no admin check.

Reports (#1612): replace the raw <pre>{JSON.stringify(...)}</pre> dump
of report definitions with a real CRUD UI against reports_api.rs's now-
complete definitions endpoints — list/create/edit/delete plus on-demand
Generate, all admin-gated the same way. The generated-reports table is
untouched. The definition form covers name/template/theme, a practical
subset of scope (window/ip/sensor/port/signature, or job/hash for the
sandbox/payload/ghidra templates), the element checklist, branding, the
event appendix limit, and a daily/weekly/monthly schedule toggle;
sandbox/payload/ghidra definitions save fine but surface the backend's
"not yet implemented" message inline on Generate rather than a raw
error, since that renderer gap is documented and out of scope here.

Every new class used (metric-grid/metric__*, data-table, table-scroll,
badge--*, chip/is-active, btn-*, input, note, empty, skeleton-line,
code) is one already used elsewhere in this codebase — no new CSS.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
tsc --noEmit currently fails codebase-wide (65 errors, 22 files) on
a pre-existing TanStack Start serialization-check pattern unrelated
to this change (Record<string, unknown> for raw ES documents isn't
provably JSON-serializable to the type checker, even though it always
is here) -- shipping it as a blocking gate would make every future PR
red from the first push. vite build stays the real, blocking gate;
typecheck output is still visible in the job log for anyone touching
these files. Filed #1618 to fix the root cause and flip this back.
@github-actions

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

The standalone `tsr generate` CLI (npm run generate-routes) and the
tanstackStart() vite plugin's own route generation (used by `build`/
`dev`) disagree on one thing: the plugin also emits a `Register` SSR
type augmentation block the CLI strips out. Diffing right after
generate-routes flagged the committed, plugin-shaped file as stale on
every single run -- confirmed by the job's first real run on #1619.
Move the diff check after `build`, whose output is what's actually
committed and actually ships; drop the redundant CLI step entirely.
@Xore
Xore merged commit 89184b1 into port-foundation Aug 18, 2026
89 checks passed
@Xore
Xore deleted the port-1608-settings-reports-ui branch August 18, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant