2.8 KiB
2.8 KiB
NexusGuard SD-WAN — WGDashboard Parity Plan (Phase 4.9)
Goal: Bring the Dashboard UI to feature-parity with WGDashboard — multi-user management, global device view for Admin, WireGuard local interface status, external node health, and proper Endpoint vs ListenAddress config.
Task 4.9.1: User Management API (Admin CRUD)
- Create
api/users.gowith CRUD endpoints (GET /api/v1/users,POST /api/v1/users,DELETE /api/v1/users) - Wire
UsersHandlerinmain.goprotected route group (admin-only JWT check) - Write tests for user CRUD
Task 4.9.2: Admin Global Device View
- Modify
api/devices.goList(): if requester is admin, return ALL devices with Preload("User") - Add
?user_id=query parameter filter for admin - Write tests verifying admin sees all devices, regular user sees only own
Task 4.9.3: Dashboard UI - Users Page
- Create
src/api/users.tswith user CRUD API calls - Create
src/views/Users.vue— table of users with create/delete actions - Add "Users" link to Sidebar in
src/App.vueand route insrc/router/index.ts - Add "Owner" column in
src/views/Devices.vuewhen admin logged in - Add user filter dropdown in Devices page for admin
Task 4.9.4: WireGuard Local Interface Manager (Backend)
- Create
internal/wgmanager/manager.go— wgctrl integration for local wg0 (with stub for Windows cross-compile) - Implement:
GetStatus(),SetConfig(listenPort, privateKey),Down() - Add
/api/v1/wg/statusendpoint: UP/DOWN, Rx/Tx bytes, peer count, last handshake - Add
/api/v1/wg/upand/api/v1/wg/downendpoints to start/stop local wg0 - Wire into
main.goroute group
Task 4.9.5: Dashboard UI - Local WG Status Widget
- Create
src/components/WgStatusCard.vue— ON/OFF toggle, Rx/Tx counters, peer count - Integrate into
src/views/Dashboard.vue
Task 4.9.6: External Node Health Check
- Add background goroutine in
main.gopinging registered WgServer endpoints every 30s via UDP - Track health status in a thread-safe in-memory map
- Add
GET /api/v1/servers/statusreturning health of each node - Update
src/views/Servers.vueto show Online/Offline dots and last-check timestamp - Update
src/api/servers.tswith status endpoint
Task 4.9.7: Endpoint vs ListenAddress Split
- Add
ListenAddresscolumn to WgServer model (default0.0.0.0:51820) - Rename
Endpointin model/API toPublicEndpointfor clarity - Update
migrations/001_init.sqland GORM model mapper - Update
api/servers.goCRUD to split the fields - Update Provisioning API to use
PublicEndpoint(not ListenAddress) - Update
src/api/servers.tstype andsrc/views/Servers.vueform to show both fields - Write tests for provisioning returning correct PublicEndpoint