Skip to content

feat(web): serve the web dashboard at /ui/ - #64

Merged
mattmattox merged 8 commits into
mainfrom
claude/dashboard
Nov 12, 2026
Merged

mattmattox merged 8 commits into
mainfrom
claude/dashboard

Conversation

@mattmattox

@mattmattox mattmattox commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Third of the three PRs that replace draft #52: the user's React dashboard (first commit, unchanged), served by goclusterfs-mount at /ui/, built to the plan the PM approved. The plan's details are in API-CONFIG.md under "Web Dashboard".

Corrections to the plan:

  • Token storage: the user's code had no token input at all, so nothing was in localStorage. Settings now has a token field, and the token goes in sessionStorage.
  • Dev server: the Vite proxy keeps the Host header, so the API treats npm run dev as its own origin and writes work there too, still with the token.

Pins:

  • Node: 22.23.4 (2026-10-20). 22.23.5 (2026-11-11, a security release) is under 48 h old today. Bump to it in its own PR after 2026-11-13.
  • setup-node: v7.1.0 (2026-10-08), pinned by SHA.

Additions to the plan: the Settings page runs the three admin endpoints, and a 401 on any page points to Settings for the token.

Also fixed:

  • The data hooks started a new request on every render.
  • Release archives now ship the licenses of the npm packages bundled into the binary.

npm audit on the lockfile (2025-12-31): 19 advisories, all with fixes: 1 low, 4 moderate, 14 high, 0 critical. Nothing is upgraded here; upgrades go in a separate PR, to versions at least 48 h old.

  • Shipped in the binary: only react-router and react-router-dom 7.11.0 (14 advisories). They cover server rendering, RSC, single-fetch, loader redirects and links built from user input. The dashboard uses BrowserRouter with fixed routes only.
  • Build and dev tools only:
    • vite 7.3.0: dev-server file reads and fs.deny bypasses, which only affect npm run dev.
    • rollup 4.54.0: path traversal on write.
    • Also: postcss, brace-expansion, minimatch, picomatch, js-yaml, flatted, nanoid, browserslist, source-map-js, zod, ajv, @humanfs/node, baseline-browser-mapping, postcss-selector-parser and @babel/core.

Results:

  • Here: golangci-lint (linux) 0 issues, tsc -b and eslint clean, API and webui tests pass with -race, parity OK.
  • On .68: the Vite build passes, and TestEmbeddedBuild passes against it.
  • In a browser, against a live token-protected mount on .68, through an SSH tunnel:
    • The shell loads with no CSP violations; without a token the pages get 401.
    • With the token, Dashboard, Cluster, Statistics and Flush journal work.
    • Create, clone and delete work on a 4 MB file. The clone matches the source byte for byte, the deleted snapshot shows as deleting and then disappears, and mount logs each write at INFO.
  • CI at 4188b9a passed, including the Dashboard job and both /ui/ integration tests. Release passed at 4188b9a and 9944ce3, so it builds the UI, packages it with dist.sh and checks the embed.

🤖 Generated with Claude Code

mattmattox and others added 7 commits November 12, 2026 00:29
Vite + React 19 + Tailwind, with pages for the dashboard, cluster,
statistics, snapshots and settings. `npm run dev` serves it on :5173
and proxies /api, /health and /metrics to localhost:8080. Nothing
serves the built files yet.

Source only: node_modules and dist stay ignored by
web/dashboard/.gitignore. The lockfile is the user's from 2025-12-31.

Recovered from untracked work in the user's checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
goclusterfs-mount embeds the dashboard from internal/webui and serves it on
the API server under /ui/, on by default (-dashboard=false turns it off).
Without `make dashboard` the binary embeds a placeholder page that says how
to build it, so go build and go test need no Node.

The static files skip auth and the rate limiter: they hold no data, and a
browser can't send a token when it loads them. /api/v1/* keeps its rules,
and the loopback Host check still covers /ui/. Responses carry a strict
Content-Security-Policy and nosniff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Snapshots are per file: pick a path, then create, clone or delete its
  snapshots, or clone the file. Without a path the page lists every
  snapshot. Delete finishes in the background, so a deleted snapshot shows
  as "deleting" until the worker frees it.
- The API token is entered in Settings and kept in sessionStorage, so it
  goes away with the tab. 401 and 403 explain what to do.
- Cluster shows the registry's nodes from /stats/cluster and the lock
  counters from /stats/lock. There is no leader and no per-lock list.
- Journal states are clean, dirty, recovering and corrupt. TRIM replaces
  the SFB card; small-file containers show as disabled.
- The refresh settings now drive every page. Settings that did nothing
  (theme, compact mode, latency, lock panel, API endpoint) are gone.
- Data hooks no longer refetch on every render.
- Vite builds with base /ui/ into internal/webui/build/dist, without
  source maps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`make dashboard` runs npm ci, lint and the Vite build. A new Dashboard CI
job runs it on Node 22.23.4 and checks that the build embeds and serves.
The Go jobs keep testing /ui/ with the placeholder, so they need no Node.
The release workflow builds the dashboard before dist.sh, dist.sh refuses
to package a placeholder, and archives now carry the licenses of the npm
packages the dashboard bundles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmattox
mattmattox marked this pull request as ready for review November 12, 2026 07:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mattmattox
mattmattox merged commit da56f57 into main Nov 12, 2026
13 checks passed
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