UI review: docs, summary and plan
Summary of U1-U18, change log row, APP_UI README, UI architecture, accepted risk of the token in localStorage. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
32d6b0e525
commit
9443ab6fce
6 files changed
+195
-16
No files matched your search
+20
-9
@@ -1,25 +1,36 @@
|
||||
# OpenVPN Dashboard UI (`APP_UI`)
|
||||
# OpenVPN Controller UI (`APP_UI`)
|
||||
|
||||
A Single Page Application (SPA) built with **Vue 3** and **Vite**. It serves as the unified dashboard for monitoring and management.
|
||||
|
||||
## Project Structure
|
||||
|
||||
- `src/views/`: Page components (Dashboard, Login, Profiles, etc.).
|
||||
- `src/components/`: Reusable widgets (Charts, Sidebar).
|
||||
- `src/stores/`: Pinia state management (Auth, Client Data).
|
||||
- `src/views/`: Pages (Analytics, Clients, Certificates, PKI and VPN configuration, Server Process, Backup and Restore, Account, Login).
|
||||
- `src/components/`: Reusable widgets (`BaseModal`, `ConfirmModal`, `StatusBadge`, toasts, dialogs).
|
||||
- `src/composables/`: Shared logic: `useApi` (axios clients: monitoring API, profiler API, `/api/auth`), `useTrafficChart` (charts), `useTheme`, `useToast`, `useFormatters`, `usePkiStatus`.
|
||||
- `src/utils/`: Helpers without Vue (CIDR parsing).
|
||||
- `default.conf.template`: nginx configuration of the container image (security headers, gzip, cache, API proxy).
|
||||
|
||||
## Configuration
|
||||
|
||||
Runtime configuration is loaded from `/config.json` (in `public/`) to allow environment-independent builds.
|
||||
Runtime configuration is loaded from `/config.json` (in `public/`) to allow environment-independent builds. With the container nginx the CSP allows requests to the page origin only (`connect-src 'self'`): keep the API paths proxied (`/api/v1`, `/profiles-api`).
|
||||
|
||||
## Development
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run dev
|
||||
# Access at http://localhost:5173
|
||||
npm ci # exact versions from package-lock.json (npm install after changing package.json)
|
||||
npm run dev # http://localhost:5173
|
||||
npm run build
|
||||
npm test # Vitest: formatters, CIDR parsing, 401 handling
|
||||
npm run lint # ESLint (minimal Vue rules)
|
||||
```
|
||||
|
||||
Node 20.19 or newer is required (Vite 7).
|
||||
|
||||
## Notes
|
||||
|
||||
- The session token is kept in `localStorage` (accepted risk, see `DOCS/General/Security_Architecture.md`).
|
||||
- Confirmations use `ConfirmModal`, notices use toasts (`useToast`); the native `confirm()` and SweetAlert2 are not used.
|
||||
- After changing the UI sources, refresh the committed build for system-service installs: `deploy/native/build-ui.sh --publish` (`deploy/native/check-ui.sh` shows whether it is stale).
|
||||
|
||||
## Documentation
|
||||
See `DOCS/UI/Architecture.md` for detailed architecture notes.
|
||||
|
||||
Reference in new issue
Block a user