fix(ipam): require resource name before allocating IP and fill missing fields on VM link
All checks were successful
Backend Tests / pytest (Python 3.12) (push) Successful in 46s
Deploy to Production / Trigger production update (push) Successful in 8s

- Validate resource name in auto-allocate form before sending request
- Fill resource_name, proxmox_node, resource_type, mac_address when syncing
  a VM that already has matching vmid/server_id but missing metadata

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-20 03:23:57 +05:00
parent 7546883393
commit 965fb858da
4 changed files with 12 additions and 1 deletions

View File

@@ -97,6 +97,7 @@ function AllocateCard() {
};
const handleAllocate = () => {
if (!networkId) { toast.error(t('ipam.select_network')); return; }
if (!resourceName.trim()) { toast.error(t('ipam.resource_required')); return; }
autoAllocate.mutate(
{ network_id: Number(networkId), resource_name: resourceName || undefined, hostname: hostname || undefined },
{