New home dashboard - #128
Conversation
Greptile SummaryThis PR replaces the old home page (which contained embedded video tutorials) with a rich dashboard showing nginx status with uptime, host/stream/certificate counts, traffic statistics, expiring certificates, and recent error logs. The backend gains a
Confidence Score: 5/5Safe to merge; backend changes are well-tested and fail gracefully, and the frontend rework is self-contained with no broken contracts. The backend uptime logic handles all error paths (missing PID, dead process, ps parse failure) with a log-and-ignore strategy so the API never breaks. The new listAll() paginator correctly terminates on empty pages. Frontend changes are additive and permission-gated. No data mutation or auth boundary changes are present. No files require special attention; the two observations on HomePage.tsx are minor efficiency notes.
|
| Filename | Overview |
|---|---|
| core/nginx/process_manager_unix.go | Adds Unix uptime calculation via ps -o lstart=; depends on procps being available (added to Dockerfile) and locale-consistent date output. |
| core/nginx/process_manager_windows.go | Adds Windows uptime calculation via Win32 GetProcessTimes; handles boundary case where seconds < 0. |
| core/nginx/service.go | Extends GetStatus to return a Status struct with running flag and optional uptime; gracefully degrades when uptime resolution fails. |
| frontend/src/domain/home/HomePage.tsx | Complete rewrite of the home page into a rich dashboard; fetches counts, certificates, logs, and traffic stats with permission-aware conditional loading. |
| frontend/src/domain/home/components/NginxStatusCard.tsx | New self-contained nginx status card; subscribes to nginx events, fetches its own status, and renders running/offline/unknown state with uptime display. |
| frontend/src/domain/certificate/CertificateService.ts | Adds listAll() paginator that fetches all certificate pages sequentially; break condition guards against empty pages and totalItems convergence. |
| api/nginx/status_handler.go | Status handler now returns running and uptimeSeconds fields from the new Status struct. |
| Dockerfile | Adds procps to the Alpine runtime image so that ps -o lstart= is available for the Unix uptime calculation. |
Sequence Diagram
sequenceDiagram
participant UI as HomePage
participant NSC as NginxStatusCard
participant BE as Backend API
UI->>+BE: Promise.all [getMetadata, isRunning, getSettings, list(hosts,1), list(streams,1), listAll(certs)]
NSC->>+BE: getStatus() (independent call)
BE-->>-NSC: "{running, uptimeSeconds}"
BE-->>-UI: [metadata, nginxRunning, settings, hostsPage, streamsPage, certificates]
alt serverLogsEnabled
UI->>+BE: logs(15, 0)
BE-->>-UI: errorLogs
end
alt "statsSupported && statsEnabled && nginxRunning"
UI->>+BE: getStats()
BE-->>-UI: TrafficStatsResponse
end
UI->>UI: setState (render dashboard)
NSC->>NSC: setState (render status card)
Reviews (2): Last reviewed commit: "New home dashboard" | Re-trigger Greptile
|



No description provided.