Files
3proxyUI/docs/PLAN.md

49 lines
5.2 KiB
Markdown

# Plan
Updated: 2026-04-02
## Active
1. Keep replacing remaining seeded fallback signals with runtime-backed 3proxy data and extend the Docker-verified ingestion path beyond access-log-derived usage.
2. Harden websocket-driven live sync and keep forms/edit flows resilient to concurrent runtime updates.
## Next
1. Wire real counter/log ingestion into dashboard traffic and user status instead of seeded snapshot values.
2. Refine Docker/runtime behavior and document real host-access expectations and deployment constraints.
3. Expand validation and tests around service mutations, credential safety, websocket reconnect behavior, and runtime failure reporting.
## Done
1. Researched official 3proxy documentation for config scripting, services, counters, reports, auth, and reload hooks.
2. Initialized the repository and established autonomous agent workflow rules.
3. Implemented the first UI slice with hardcoded panel auth, operator-focused dashboard, users table, and system config preview.
4. Added paranoia-oriented tests for login gating, proxy link encoding, quota edge cases, and traffic share formatting.
5. Simplified the UI into a calmer minimalist layout with reduced visual noise and denser operational presentation.
6. Moved user creation into a modal flow and tightened the operator UX with quieter navigation and a denser users table.
7. Rebuilt the UI shell from scratch around a stable topbar/tab layout with fixed typography and lower visual noise across window sizes.
8. Corrected the user-creation flow to select a 3proxy service instead of assigning a per-user port, matching the documented 3proxy model.
9. Stabilized the Users table copy action so the column no longer shifts when the button label changes to `Copied`.
10. Added operator actions in the Users table for pause/resume and delete with confirmation modal coverage.
11. Added a root quick-start prompt file so a new agent can resume implementation or fixes with minimal onboarding.
12. Added a backend control plane with persisted state, 3proxy config generation, runtime actions, and API-backed frontend wiring.
13. Added Docker build/compose runtime that compiles 3proxy in-container and starts the panel with a managed 3proxy process.
14. Added backend tests for config rendering and user-management API edge cases.
15. Added editable System settings with shared validation, a system update API, service/port conflict protection, and UI coverage for local save flows.
16. Simplified the System tab layout by removing the redundant Runtime card and collapsing those fields into a compact settings section.
17. Moved panel auth to server-issued expiring tokens with `sessionStorage` persistence and Compose-configurable credentials/TTL.
18. Restored panel language/theme preferences in Settings with `localStorage`, merged service `Command/Protocol` into a single `Type`, and removed the legacy `admin` service path from managed panel state.
19. Added service-removal confirmation with linked-user warnings, backend cascade deletion for removed services, and migration that strips persisted legacy `admin` services from stored state.
20. Made `npm run dev` start both the Vite client and Express backend, added a Vite API proxy for local development, and restored `system` as the default panel theme so the login screen follows OS appearance.
21. Re-separated the Settings tab into distinct panel-settings and services cards so panel preferences no longer appear inside the Services section.
22. Restored editable proxy endpoint in panel settings so copied proxy URLs and displayed user endpoints can be corrected from the UI.
23. Replaced seeded dashboard/user usage with live 3proxy access-log ingestion, derived user traffic/status from runtime logs, and added frontend polling so the panel refreshes runtime state automatically.
24. Verified the new runtime-backed snapshot flow in Docker by sending real traffic through the bundled 3proxy services and observing live byte counters in `/api/state`.
25. Replaced frontend polling with websocket live sync over `/ws`, sending only changed top-level snapshot sections while keeping the current `http/ws` path compatible with future `https/wss` deployment.
26. Stopped incoming runtime sync from overwriting dirty Settings drafts and added hash-based tab navigation so refresh/back/forward stay on the current panel tab.
27. Verified websocket delivery in Docker over plain `ws://127.0.0.1:3000/ws` by authenticating, receiving `snapshot.init`, mutating panel state, and observing a follow-up `snapshot.patch`.
28. Reworked Users actions into fixed-width icon buttons, added edit-in-modal flow, generated credentials only for new users, and blocked action buttons while commands are in flight.
29. Added backend user-update support plus runtime stop control, then verified both in Docker by updating `u-1` and stopping the real bundled 3proxy process through the API.
30. Added a websocket heartbeat so time-based status transitions such as `live -> idle/warn` are recalculated predictably even when no new proxy events arrive.
31. Moved proxy-copy into the Users actions column, added a last-seen/online column from parsed 3proxy logs, and introduced bounded websocket/API reconnect attempts with a visible connection banner and forced logout after full recovery failure.