feat: add LXC container support to Proxmox extension
- Add is_lxc boolean column to ext_proxmox_nodes (default false, existing nodes unaffected) - Add LXC checkbox to admin node creation form (disabled on edit) - Dynamic API path selection via Node::vmType() (returns 'lxc' or 'qemu') - LXC deployment: syncLxcSettings() for cores, memory, swap, hostname, rootfs, net config - LXC network uses name=eth0 format with applyLxcPoolSettings() for VLAN/firewall/MTU - All lifecycle operations LXC-aware: install, suspend, unsuspend, terminate, upgrade, reinstall - VNC/xterm console uses correct type (lxc vs kvm) - All 20+ Livewire components use vmType() for Proxmox API paths - LXC user interface shows basic-only view (no advanced toggle, no KVM-specific tabs) - Basic tabs for LXC: Overview, Network Configuration, Backups, Console
This commit is contained in:
@@ -73,7 +73,7 @@ class Network extends Component
|
||||
{
|
||||
try {
|
||||
$proxmox = new Proxmox;
|
||||
$config = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
|
||||
$config = $proxmox->request('/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
|
||||
|
||||
$interfaces = [];
|
||||
$configs = [];
|
||||
@@ -204,7 +204,7 @@ class Network extends Component
|
||||
{
|
||||
try {
|
||||
$proxmox = new Proxmox;
|
||||
$response = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/agent/network-get-interfaces');
|
||||
$response = $proxmox->request('/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/agent/network-get-interfaces');
|
||||
$json = $response->json();
|
||||
|
||||
// Check if the response indicates an error (VM not running, guest agent not available, etc.)
|
||||
@@ -290,7 +290,7 @@ class Network extends Component
|
||||
{
|
||||
try {
|
||||
$proxmox = new Proxmox;
|
||||
$config = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
|
||||
$config = $proxmox->request('/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
|
||||
|
||||
// CPU cores can be specified with 'cores' or 'cpus' in Proxmox config
|
||||
$cores = (int) ($config['cores'] ?? $config['cpus'] ?? 1);
|
||||
@@ -434,7 +434,7 @@ class Network extends Component
|
||||
}
|
||||
|
||||
$proxmox = new Proxmox;
|
||||
$currentConfig = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
|
||||
$currentConfig = $proxmox->request('/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
|
||||
$currentValue = (string) ($currentConfig[$this->selectedInterface] ?? '');
|
||||
|
||||
$segments = array_filter(array_map('trim', explode(',', $currentValue)));
|
||||
@@ -476,7 +476,7 @@ class Network extends Component
|
||||
|
||||
try {
|
||||
$proxmox->request(
|
||||
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
|
||||
'/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config',
|
||||
'put',
|
||||
[$this->selectedInterface => $newValue]
|
||||
);
|
||||
@@ -536,7 +536,7 @@ class Network extends Component
|
||||
try {
|
||||
$proxmox = new Proxmox;
|
||||
$proxmox->request(
|
||||
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
|
||||
'/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config',
|
||||
'put',
|
||||
['delete' => $target]
|
||||
);
|
||||
@@ -595,7 +595,7 @@ class Network extends Component
|
||||
|
||||
try {
|
||||
$proxmox = new Proxmox;
|
||||
$currentConfig = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
|
||||
$currentConfig = $proxmox->request('/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
|
||||
$currentValue = (string) ($currentConfig[$name] ?? '');
|
||||
|
||||
if (empty($currentValue)) {
|
||||
@@ -632,7 +632,7 @@ class Network extends Component
|
||||
$newValue = implode(',', $newSegments);
|
||||
|
||||
$proxmox->request(
|
||||
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
|
||||
'/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config',
|
||||
'put',
|
||||
[$name => $newValue]
|
||||
);
|
||||
@@ -728,7 +728,7 @@ class Network extends Component
|
||||
|
||||
$proxmox = new Proxmox;
|
||||
$proxmox->request(
|
||||
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
|
||||
'/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config',
|
||||
'put',
|
||||
[$newInterfaceName => $newConfig]
|
||||
);
|
||||
@@ -751,7 +751,7 @@ class Network extends Component
|
||||
|
||||
try {
|
||||
$proxmox = new Proxmox;
|
||||
$currentConfig = $proxmox->request('/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
|
||||
$currentConfig = $proxmox->request('/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config')->json()['data'] ?? [];
|
||||
$currentValue = (string) ($currentConfig[$name] ?? '');
|
||||
|
||||
if (empty($currentValue)) {
|
||||
@@ -808,7 +808,7 @@ class Network extends Component
|
||||
$newValue = implode(',', $newSegments);
|
||||
|
||||
$proxmox->request(
|
||||
'/nodes/' . $this->server->node->name . '/qemu/' . $this->server->vm_id . '/config',
|
||||
'/nodes/' . $this->server->node->name . '/' . $this->server->node->vmType() . '/' . $this->server->vm_id . '/config',
|
||||
'put',
|
||||
[$name => $newValue]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user