Skip to content

Commit b3ffb60

Browse files
committed
style: redesign web admin panel with sidebar nav, dark theme, confirmation modals
1 parent 293ca2d commit b3ffb60

3 files changed

Lines changed: 1070 additions & 891 deletions

File tree

ARCHITECTURE.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -384,13 +384,17 @@ Implementation notes (`server/admin_panel.go`):
384384

385385
### Web Admin Panel
386386

387-
The web-based interface provides the same functionality through a browser:
388-
389-
- **Session Authentication**: Secure login with admin key validation
390-
- **CSRF Protection**: Cross-site request forgery prevention
391-
- **Real-time Updates**: Live data refresh without page reloads
392-
- **RESTful API**: Programmatic access to administrative functions
393-
- **Responsive Design**: Works across desktop and mobile devices
387+
The web-based interface (`admin_web.html`, embedded via `go:embed`) provides the same functionality through a browser with a sidebar-navigation layout:
388+
389+
- **Sidebar Navigation**: Fixed sidebar with icon+label nav items (Overview, Users, System, Logs, Plugins, Metrics) and a Sign out button; collapses on mobile with a hamburger toggle and overlay
390+
- **Session Authentication**: Secure login with admin key validation (1-hour HMAC-signed sessions)
391+
- **CSRF Protection**: Cross-site request forgery prevention on all state-changing POST endpoints
392+
- **Confirmation Modals**: Destructive actions (Clear Database, Ban, Kick, Uninstall, Reset Metrics) require user confirmation before executing
393+
- **Real-time Updates**: Live data refresh every 5 seconds without page reloads; manual refresh via top-bar icon button
394+
- **RESTful API**: Programmatic access to administrative functions (session cookie auth)
395+
- **Responsive Design**: Sidebar collapses on screens below 800px; stat grids, metric cards, and config tables adapt to available width
396+
- **Status Badges**: Pill-style badges with dot indicators for online/offline/banned/kicked states and TLS enabled/disabled
397+
- **Toast Notifications**: Slide-up feedback messages for action results (success/error/info)
394398

395399
## Security Architecture
396400

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,11 +432,17 @@ Enable with `--admin-panel` flag, then press `Ctrl+A` to access:
432432

433433
### Web Admin Panel
434434
Enable with `--web-panel` flag, access at `http://localhost:8080/admin`:
435+
- Sidebar-navigation layout (Overview, Users, System, Logs, Plugins, Metrics)
435436
- Secure session-based login (1-hour expiration)
436-
- Live dashboard with metrics visualization
437-
- RESTful API endpoints with `X-Admin-Key` auth
438-
- CSRF protection on all state-changing operations
439-
- HttpOnly cookies with SameSite protection
437+
- Live dashboard with stats cards, configuration, and database info
438+
- User management table with status badges, ban/kick with confirmation modals
439+
- System management with config viewer and database statistics
440+
- Real-time log viewer with level/component/timestamp columns
441+
- Plugin management with install, enable, disable, uninstall actions
442+
- Performance metrics with connection, message, and memory history
443+
- RESTful API endpoints with session cookie auth
444+
- CSRF protection on all state-changing operations (HttpOnly + SameSite cookies)
445+
- Responsive design (sidebar collapses on mobile with hamburger menu)
440446

441447
**API Example:**
442448
```bash

0 commit comments

Comments
 (0)