Commit graph

10 commits

Author SHA1 Message Date
david kiania
0ed9b6a252 feat(tickets): teardrop pin icons; closed = one slate colour, status ignored
Render INC tickets as canvas-drawn teardrop map pins via MapLibre symbol layers
(scales to thousands of closed features, unlike DOM markers):

- Open pins coloured by SLA state; larger than the old circles for hierarchy.
- Closed pins use a single muted slate colour irrespective of status (the only
  distinction that matters once closed), slightly smaller + under the open layer.
- Legend/popup closed swatch aligned to the new closed colour.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 12:05:03 +03:00
david kiania
6504328e58 fix(tickets): keep INC header KPIs from being clobbered by other tabs
Late async loaders (notably the boot-time logistics loadAll) called their KPI
renderer unconditionally, overwriting the shared header strip after the user had
switched to another tab. Guard renderKpis / renderFuelKpis / renderIncKpis so each
only updates the header when its own tab is active.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 11:52:46 +03:00
david kiania
e32ec92cbf feat(tickets): replace INC/CRQ map with INC operations dashboard
Overhaul the Tickets tab into the documented INC operations dashboard,
backed by the new GET /webhook/inc-dashboard endpoint (reporting.fn_inc_dashboard):

- Filterbar (cluster / status / window: today|week|month|custom)
- Metric strip: open now, closed in window, open/closed SLA breakdown,
  avg MTTR, closures/day + freshness
- Live map: open INC coloured by SLA state, dimmed closed overlay,
  FleetNow vehicle markers, layer toggles + SLA legend
- By-status / by-cluster tables + daily closures chart
- Data load decoupled from the basemap so the dashboard renders even if
  WebGL/map init is slow or fails

Removes the old combined INC/CRQ map and the /webhook/tickets call (CRQ deferred).
Adds docs/tickets-inc-{overhaul-plan,implementation-guide}.{md,html}.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-16 11:42:23 +03:00
kianiadee
f27afcfa9e feat(fuel): add Fuel Log tab (real fills from the fuel feed)
New tab backed by dashboard_api /analytics/fuel-fills(+/recent): KPI strip
(litres, KES spend, fills, KES/L, vehicles), spend+litres daily trend, per-vehicle
table (incl. km/L), by-department breakdown, recent fills. Shares the filter state
plus new department/fuel-type dropdowns; lazy-loads on first open. Recent-fills
time renders the Africa/Nairobi wall-clock value directly (no double tz shift).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 00:01:08 +03:00
david kiania
59620722cd feat(tickets): replace scaffold with FleetNow-style map (live vehicles + INC/CRQ layers)
- #view-tickets is now a MapLibre map: live vehicle DOM markers (ported from
  FleetNow) + INC (red) / CRQ (blue) ticket circle layers from /webhook/tickets
- Layers toggle with counts; open/all status filter; lazy-init + map.resize()
- Header KPI strip shows INC/CRQ open + vehicles/moving on the Tickets tab
- Logistics analytics tab unchanged

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 16:24:16 +03:00
david kiania
d907ea9425 merge: Logistics/Tickets tabbed navigation into staging 2026-06-11 14:20:09 +03:00
david kiania
2611212fcd feat(ui): add Logistics/Tickets tabbed navigation
- Wrap the existing analytics dashboard as the Logistics tab
- Add a scaffolded Tickets tab (per-tab KPIs, recent-tickets + by-status
  cards, informative empty state)
- Shared header KPI strip swaps per tab; tickets load lazily on first open
- Ticket data source left as a dashboard_api integration point — no S3
  credentials embedded in the static SPA

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 14:19:56 +03:00
david kiania
c2908cc17d chore: remove auto-deploy test marker
Auto-deploy verified (push->Forgejo webhook->Coolify->Traefik). Reverting the
test meta marker.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 14:07:36 +03:00
david kiania
71f40e8c62 test: build marker to verify Forgejo->Coolify auto-deploy
Harmless <meta> marker to confirm a push to staging triggers a Coolify
redeploy. Safe to revert.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 14:06:34 +03:00
david kiania
ff5945a85d feat: FleetOps analytics SPA (Caddy) — initial scaffold
Fleet operations analytics (fuel · utilisation · distance · driver behaviour),
sibling to FleetNow. Self-contained src/index.html (inline CSS/JS + Chart.js CDN)
reusing FleetNow's warm-dark ops palette + header shell for a familiar look.

Reads dashboard_api /analytics/* (fleet-summary, utilisation, driver-behaviour,
fuel, filters). Panels: KPI strip, distance/idle daily-trend chart, per-vehicle
table, driver leaderboard, fuel (data-gated).

Served by Caddy on :80 (Traefik terminates TLS). Per-env API base injected at
runtime via Caddy `templates` -> /env.js ({{env "API_BASE"}}); falls back to the
staging API. Dockerfile runs `caddy validate` at build.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-10 13:00:31 +03:00