feat(instances): add/remove network interface from Networking tab
All checks were successful
Backend Tests / pytest (Python 3.12) (push) Successful in 1m28s
Deploy to Production / Trigger production update (push) Successful in 8s

- AddNetworkInterfaceDialog: bridge dropdown (node networks), model
  select for VM, VLAN tag, firewall, optional MAC; LXC extras: eth name,
  dhcp/static IP with CIDR + gateway; picks next free netN slot
- NetworkingTab: Add interface button, per-NIC delete with confirmation
  (config.put delete=netN)
- new useNodeNetworks hook; netif i18n keys (en/ru)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 02:36:20 +05:00
parent 161182b392
commit 052f9afb65
5 changed files with 467 additions and 29 deletions

View File

@@ -645,6 +645,26 @@ export function useExecuteCommand(serverId: number, vmid: number) {
});
}
// ==================== Node networks (bridges) ====================
export interface NodeNetworkIface {
iface?: string;
name?: string;
type?: string;
active?: number;
cidr?: string;
ipam_network_id?: number;
ipam_cidr?: string;
ipam_name?: string;
}
export function useNodeNetworks(serverId: number, node: string, enabled = true) {
return useQuery<{ node: string; interfaces: NodeNetworkIface[] }>({
queryKey: ['node-networks', serverId, node],
queryFn: () => apiClient.get(`/proxmox/api/servers/${serverId}/nodes/${node}/networks`),
enabled: enabled && !!node,
});
}
// ==================== ISO mount/unmount (KVM only) ====================
export interface IsoItem {
volid: string;