feat: add start/stop/restart buttons for VMs and LXCs

- New POST /api/power route for Proxmox power operations
- powerControl() method in proxmox.js library
- Start/Stop/Restart action buttons in VMList and LXCList tables
- Status feedback banner in Dashboard on power action

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-05-07 08:07:38 +01:00
parent 47f10cc2c2
commit 51753269ca
5 changed files with 127 additions and 5 deletions

View File

@@ -163,7 +163,20 @@ export async function getLXC(nodeName) {
* Aggregated summary across all nodes.
* @returns {Promise<SummaryStat>}
*/
export async function getSummary() {
/**
* Sends a power action to a VM or LXC.
* @param {string} nodeName
* @param {number} vmid
* @param {'qemu'|'lxc'} type
* @param {'start'|'stop'|'restart'} action
* @returns {Promise<void>}
*/
export async function powerControl(nodeName, vmid, type, action) {
await proxmoxFetch(`/nodes/${nodeName}/${type}/${vmid}/status/${action}`, 'POST');
}
/**
* Aggregated summary across all nodes.
const nodes = await getNodes();
let totalVMs = [];
let totalLXC = [];