feat(instances): show bridge comments in add-NIC dropdown
All checks were successful
Deploy to Production / Trigger production update (push) Successful in 9s

Bridge selector now shows the Proxmox interface comment (WAN, Cisco,
subnet, ...) next to the bridge name, like the native Proxmox dialog,
falling back to IPAM/interface CIDR; list sorted by name.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 02:42:44 +05:00
parent 052f9afb65
commit 7e1580579d
2 changed files with 10 additions and 2 deletions

View File

@@ -53,7 +53,10 @@ export default function AddNetworkInterfaceDialog({ open, onClose, serverId, vmi
const { data: networks } = useNodeNetworks(serverId, node, open);
const bridges = useMemo(
() => (networks?.interfaces ?? []).filter((i) => i.type === 'bridge'),
() =>
(networks?.interfaces ?? [])
.filter((i) => i.type === 'bridge')
.sort((a, b) => (a.iface || a.name || '').localeCompare(b.iface || b.name || '')),
[networks],
);
@@ -190,9 +193,13 @@ export default function AddNetworkInterfaceDialog({ open, onClose, serverId, vmi
<SelectContent>
{bridges.map((b) => {
const name = b.iface || b.name || '';
const hint = b.comments?.trim() || b.ipam_cidr || b.cidr || '';
return (
<SelectItem key={name} value={name}>
{name}{b.ipam_cidr ? ` (${b.ipam_cidr})` : b.cidr ? ` (${b.cidr})` : ''}
<span className="flex items-center gap-2">
{name}
{hint && <span className="text-xs text-muted-foreground">{hint}</span>}
</span>
</SelectItem>
);
})}

View File

@@ -652,6 +652,7 @@ export interface NodeNetworkIface {
type?: string;
active?: number;
cidr?: string;
comments?: string;
ipam_network_id?: number;
ipam_cidr?: string;
ipam_name?: string;