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:
@@ -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 = [];
|
||||
|
||||
Reference in New Issue
Block a user