feat(instances): show bridge comments in add-NIC dropdown
All checks were successful
Deploy to Production / Trigger production update (push) Successful in 9s
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:
@@ -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>
|
||||
);
|
||||
})}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user