import StatusBadge from './StatusBadge'; /** * @param {{ lxc: Array<{ vmid: number; name: string; type: string; status: string; cpu: number; memory: { total: number; used: number }; disk: { total: number; used: number }; node: string }> }} props * @returns {import('react').ReactNode} */ /** * @param {{ lxc: Array<{ vmid: number; name: string; type: string; status: string; cpu: number; memory: { total: number; used: number }; disk: { total: number; used: number }; node: string }>, onPowerAction: (node: string, vmid: number, type: string, action: string) => void }} props */ export default function LXCList({ lxc, onPowerAction }) { if (!lxc?.length) { return
No LXC containers found.
; } const running = lxc.filter((item) => item.status === 'running'); const stopped = lxc.filter((item) => item.status !== 'running'); return (| ID | Name | Node | CPU | Memory | Status | |
|---|---|---|---|---|---|---|
| {item.vmid} | {item.name} | {item.node} | {(item.cpu * 100).toFixed(1)}% | {formatBytes(item.memory?.used || 0)} / {formatBytes(item.memory?.total || 0)} |
| ID | Name | Node | Disk | Status | Actions |
|---|---|---|---|---|---|
| {item.vmid} | {item.name} | {item.node} | {formatBytes(item.disk?.used || 0)} |