mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-21 10:43:36 +00:00
fix: Group VMs by instance instead of node for duplicate hostname support
When multiple Proxmox instances share the same hostname (e.g., 'px1'), VMs were incorrectly grouped together under a single heading. Changed grouping key from guest.node (raw hostname) to guest.instance (disambiguated name like 'px1 (10.0.2.224)') to properly separate VMs from different Proxmox instances. Related to #891
This commit is contained in:
@@ -1301,14 +1301,15 @@ export function ThresholdsTable(props: ThresholdsTableProps) {
|
||||
)
|
||||
: guests;
|
||||
|
||||
// Group by node
|
||||
// Group by instance (not node - node is just the hostname which may be duplicated)
|
||||
// Instance is the disambiguated name like "px1" or "px1 (10.0.2.224)"
|
||||
const grouped: Record<string, Resource[]> = {};
|
||||
filteredGuests.forEach((guest) => {
|
||||
const node = guest.node || 'Unknown';
|
||||
if (!grouped[node]) {
|
||||
grouped[node] = [];
|
||||
const groupKey = guest.instance || guest.node || 'Unknown';
|
||||
if (!grouped[groupKey]) {
|
||||
grouped[groupKey] = [];
|
||||
}
|
||||
grouped[node].push(guest);
|
||||
grouped[groupKey].push(guest);
|
||||
});
|
||||
|
||||
// Sort guests within each group by vmid
|
||||
|
||||
Reference in New Issue
Block a user