diff --git a/CLAUDE.md b/CLAUDE.md index 4aa3d38..a603c98 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -21,7 +21,6 @@ src/ ├── app/ │ ├── api/ # Next.js API routes (server-side) │ │ ├── proxy/[...]/route.js # Reverse proxy to Proxmox web UI -│ │ ├── vnc/route.js # VNC ticket fetcher │ │ ├── power/route.js # Power control (start/stop/restart) │ │ ├── nodes/vms/lxc/route.js # Query endpoints (aggregates across nodes) │ │ └── status/route.js # Aggregated summary stats @@ -30,8 +29,7 @@ src/ ├── components/ │ ├── Dashboard.js # Main UI: tabs, summary cards, power action handler │ ├── NodeList.js / NodeCard.js # Node overview -│ ├── VMList.js / LXCList.js # VM/LXC list views -│ ├── ConsolePanel.js # Console embed panel +│ ├── VMList.js / LXCList.js # VM/LXC list views (each row has Console/Start/Stop buttons) │ └── StatusBadge.js # Status indicator └── lib/ └── proxmox.js # Proxmox API client — getNodes, getVMs, getLXC, getSummary, powerControl @@ -44,6 +42,7 @@ src/ - **Dashboard** uses direct React state + manual `axios.get()` calls for power actions (instant UI sync), and SWR with `refreshInterval` for periodic polling of the same endpoints. - **Power action flow**: `handlePowerAction` in Dashboard.js fires `POST /api/power`, then immediately re-fetches all four caches (`/api/nodes`, `/api/vms`, `/api/lxc`, `/api/status`) and sets state directly. Use `requestAnimationFrame` flush before the API call so status messages paint. - **Auth**: PVEAPIToken header: `Authorization: PVEAPIToken=${TOKEN_ID}=${TOKEN_SECRET}`. +- **Console**: VMList/LXCList build `consoleUrl` from `PROXMOX_WEB_URL` with `?console={qemu|lxc}&vmid={id}&node={node}` params. Dashboard opens it via `window.open()` in a new tab so browser session cookies handle Proxmox auth. - **TLS**: `NODE_TLS_REJECT_UNAUTHORIZED=0` in `.env.local` for self-signed certs. Shows a console warning — acceptable for internal lab use. - **Tailwind CSS 4**: Uses `@tailwindcss/postcss` config. CSS vars in `globals.css` for theming. - **All API routes return 502 on Proxmox failures** with `{ error, data: null }`. @@ -56,7 +55,6 @@ src/ | `PROXMOX_TOKEN_ID` | Yes | API token ID | | `PROXMOX_TOKEN_SECRET` | Yes | API token secret | | `PROXMOX_WEB_URL` | No | Web UI URL (defaults from PROXMOX_API_URL) | -| `PROXMOX_CONSOLE_TOKEN` | No | Console session token (defaults from PROXMOX_TOKEN_ID) | | `NEXT_PUBLIC_API_POLL_INTERVAL` | No | Poll interval ms (default 30000) | | `NODE_TLS_REJECT_UNAUTHORIZED` | No | `0` for self-signed certs | diff --git a/backlog.md b/backlog.md index fa2034a..e47a0dd 100644 --- a/backlog.md +++ b/backlog.md @@ -3,8 +3,8 @@ ## Quick Wins (low effort, high value) ### Console Link -- Add a clickable name link per row linking to Proxmox web console: `/pve/console.html?node=X&vmid=Y` -- **Status: done (pending push)** +- Console button per row opens Proxmox web UI console in new tab. URL built from web UI endpoint with session cookies for auth. +- **Status: done (merged to main)** ### Manual Refresh - Button in dashboard header that calls `mutate()` on all SWR caches