mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-23 20:25:56 +00:00
Show vCenter MoRef in workload ID column for vSphere VMs
The workload table's ID column reads displayId, which the mapping pipeline derived only from numeric vmid. vCenter identifies VMs by managed object reference (e.g. vm-206), not a Proxmox-shaped numeric vmid, so vSphere rows landed in the table with a blank ID cell. When workloadType is vm and there's no Proxmox-shaped numeric vmid, fall back to resource.vmware.managedObjectId. The MoRef is the identifier operators recognize from the vCenter UI, so the column now shows what an operator would expect to see.
This commit is contained in:
@@ -378,11 +378,20 @@ const mapResourceToWorkload = (resource: APIResource): WorkloadGuest | null => {
|
||||
? resource.proxmox.vmid
|
||||
: 0;
|
||||
const rawDisplayId = resource.id;
|
||||
// vCenter identifies VMs by managed object reference (e.g. `vm-206`),
|
||||
// not a numeric vmid. When the resource has no Proxmox-shaped numeric
|
||||
// vmid, fall back to the vSphere MoRef so the workload table's ID
|
||||
// column shows the identifier operators recognize from vCenter rather
|
||||
// than rendering blank.
|
||||
const vsphereDisplayId =
|
||||
workloadType === 'vm' && vmid <= 0
|
||||
? (resource.vmware?.managedObjectId ?? '').trim() || undefined
|
||||
: undefined;
|
||||
const displayId =
|
||||
workloadType === 'vm' || workloadType === 'system-container'
|
||||
? vmid > 0
|
||||
? String(vmid)
|
||||
: undefined
|
||||
: vsphereDisplayId
|
||||
: rawDisplayId
|
||||
? rawDisplayId.length > 12
|
||||
? rawDisplayId.slice(0, 12)
|
||||
|
||||
Reference in New Issue
Block a user