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
+10
-4
@@ -7,13 +7,16 @@ The frontend is a Single Page Application (SPA) built with **Vue 3** and **Vite*
|
||||
- **Build Tool**: Vite
|
||||
- **Styling**: Bootstrap 5 + Custom CSS (`src/assets/main.css`)
|
||||
- **Routing**: Vue Router
|
||||
- **HTTP Client**: Axios
|
||||
- **HTTP Client**: Axios (three instances in `useApi.js`: monitoring API, profiler API, `/api/auth`)
|
||||
- **Checks**: Vitest (`npm test`), ESLint (`npm run lint`)
|
||||
|
||||
## Key Features
|
||||
- **Responsive Design**: Mobile-friendly sidebar and layouts.
|
||||
- **Theme Support**: Built-in Light/Dark mode toggling.
|
||||
- **Theme Support**: Light/Dark mode toggling; the first visit follows the system setting (`prefers-color-scheme`), the choice is saved. The theme is applied before the app is mounted.
|
||||
- **Real-Time Data**: Polls the Monitoring API (`APP_CORE`) for live statistics.
|
||||
- **Authentication**: JWT-based auth flow with support for 2FA.
|
||||
- **Authentication**: JWT-based auth flow with support for 2FA. The token is kept in `localStorage` (accepted risk, see [Security Architecture](../General/Security_Architecture.md)). A `401` from the monitoring or profiler API ends the session and opens `/login`; `401` from `/api/auth/*` (wrong current password or 2FA code) does not: it is shown as an error. Unknown addresses redirect to `/`.
|
||||
- **Confirmations and notices**: destructive actions ask through `ConfirmModal` (each instance has a unique id); results are toasts (`useToast`). The native `confirm()` and SweetAlert2 are not used.
|
||||
- **Charts**: `composables/useTrafficChart.js` (downsampling, labels, theme colors, Chart.js config) is shared by Analytics and the client history window.
|
||||
|
||||
## Pages
|
||||
|
||||
@@ -33,7 +36,7 @@ Run-time configuration is loaded from `/public/config.json`. This allows the Vue
|
||||
```json
|
||||
{
|
||||
"api_base_url": "/api/v1", // Proxy path to Core Monitoring API
|
||||
"profiles_api_base_url": "/api", // Proxy path to Profiler API
|
||||
"profiles_api_base_url": "/profiles-api", // Proxy path to Profiler API
|
||||
"refresh_interval": 30000 // Poll interval in ms
|
||||
}
|
||||
```
|
||||
@@ -44,3 +47,6 @@ The UI is served by Nginx in production and proxies API requests to:
|
||||
- `/profiles-api/` -> **APP_PROFILER** (FastAPI, Port 8000)
|
||||
|
||||
See [Deployment Guide](../Deployment/README.md) for Nginx configuration details.
|
||||
|
||||
## Web server headers (container image)
|
||||
`APP_UI/default.conf.template` (also used by the all-in-one image) sends `X-Content-Type-Options`, `X-Frame-Options: DENY`, `Referrer-Policy: no-referrer` and a CSP (`default-src 'self'`, inline styles allowed, `img-src`/`font-src` with `data:`, `connect-src 'self'`), compresses text files, serves `/assets/` with `immutable` caching and `index.html`/`config.json` with `no-cache`. If `config.json` points to another origin, add it to `connect-src`. The system-service nginx (`deploy/native/nginx`) has its own headers.
|
||||
Reference in new issue
Block a user