Commit Graph

7 Commits

Author SHA1 Message Date
julian 96ea568e53 style(frontend): Chakra Petch instrument-panel restyle + real mobile layout
Build Art IoT image / build-and-publish (push) Successful in 43s
- Chakra Petch replaces Archivo for all UI type (Plex Mono demoted to data:
  ids, timestamps, tabular numbers); brand set in 700 italic caps
- every corner squared; signature chamfer cut (echoing the typeface) on gun
  bays, login plate and solid buttons; lamps stay round (physical lamps)
- phones: nav becomes a fixed bottom tab bar with safe-area padding, tables
  collapse into labeled stacked rows (data-label), bigger touch targets
- desktop nav as underline tabs; inline styles in Account moved to classes
2026-07-18 09:05:12 +02:00
julian d285a32829 chore(frontend): drop the 'what may authorize' subtitle for good; rebuild 2026-07-12 10:01:25 +02:00
julian 25fa1f9fc5 feat: live telemetry on gun cards — SoC battery gauge, kW, V, A, delivered kWh
- backend keeps the latest meter sample per active transaction in memory
  and ships it as active_transactions[tx].telemetry on /api/status
  (Transaction.Begin snapshots skipped: taken before the BMS is read)
- Battery component: fill + color sweep red (empty) -> blue (half) ->
  green (full) per the owner's spec; aria meter semantics
- charging bays show the gauge, a prominent kW readout, and delivered
  kWh / voltage / current rows; hint while awaiting the first sample
- smoke: 60 checks (telemetry rides /api/status)
2026-07-12 09:39:05 +02:00
julian 8d8affe6ff feat(backend): capture voltage, current and sample context in meter samples
The charger sends Voltage/Current.Import in every MeterValues frame but
we only stored energy/power/SoC. samples now also record voltage_v,
current_a and the OCPP context (Sample.Periodic vs Transaction.Begin/End
snapshots, which are legitimately all-zero). Existing dbs migrate via
ALTER TABLE on open.
2026-07-12 09:32:32 +02:00
julian 069d544bb5 feat: private session history, own-permissions view, plug-gated start button
- non-admins now see ONLY their own sessions in /api/sessions (own app
  starts + own linked cards); gun scopes grant control, not visibility;
  admins see everything
- Account page shows the logged-in user's permissions in plain words
  (Administrator badge, or the guns/relays they control), built solely
  from data already visible to them
- Start button arms only when the gun reports Preparing (cable in the
  car); idle unplugged gun shows an explanatory hint instead
- keep owner's app rename to 'Art IoT'
- smoke test: 59 checks (gun-scoped user sees no foreign sessions)
2026-07-12 09:04:06 +02:00
julian 3387f8689e feat(frontend): always-visible gun bays, idle/plugged/charging lamp language, self-service password
- Control renders every gun declared in the chargers registry, even when
  the charger is offline or has not reported that connector yet (state
  shows Offline / No status yet in gray)
- owner-specified state language: gray = idle, pulsing blue = cable in
  the socket (Preparing), green = charging; suspended/finishing = steady
  blue; fault = red
- POST /api/me/password (requires current password) + /account page,
  username in the topbar links to it
- smoke test: 58 checks (password change round-trip incl. old-password
  invalidation)
2026-07-12 08:37:20 +02:00
julian 75869364b0 feat: React control panel; pending-card review workflow; auth-method audit
Frontend rewrite (frontend/, replacing backend/static/):
- Vite + TypeScript + React 19, React Router 7, zustand, TanStack Query 5
- dev: vite proxy /api -> :9000; prod: npm run build -> dist/, served by
  the backend with SPA fallback
- pages: Control (gun bays w/ scope+readiness-gated start/stop, relays),
  History (who/via/gun/when/duration/kWh audit), Cards (pending review,
  enrolled, rejected), Users (permission checkbox matrix)
- self-contained: fonts bundled, no CDN; light/dark; reduced-motion safe

Backend:
- learn mode removed: unknown cards are always refused and queued in
  pending_cards; admin approves (name + owner + gun restrictions in one
  step) or rejects (denied_cards, silent, un-rejectable); pending count
  rides /api/status as the notification signal
- sessions record the auth method (card tap vs in-app button) for audit
- GET /api/permissions: grantable-permission catalog driving the UI matrix
- SPA static serving with path-traversal guard; 503 hint when not built

Smoke test: 54 checks incl. approve/reject round-trips over a fake charge
point and method audit assertions.
2026-07-11 20:52:20 +02:00