From a5905e8ecb1ad3e04968f3d845dad5788ed6c5a6 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Mon, 23 Nov 2026 17:37:23 -0300 Subject: [PATCH] Show only the worker name as the peer location --- api/views.py | 5 ++++- .../wireguard/peer_list/script_wireguard_status_update.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/views.py b/api/views.py index c5ca5d3..e1d7cf0 100644 --- a/api/views.py +++ b/api/views.py @@ -358,7 +358,7 @@ def func_concatenate_cluster_wireguard_status_cache() -> None: .first() ) if master_cache and isinstance(master_cache.data, dict): - cache_entries.append({"source_name": "master", "source_uuid": "", "data": master_cache.data,}) + cache_entries.append({"source_name": "master", "source_label": "", "source_uuid": "", "data": master_cache.data,}) worker_statuses = (WorkerStatus.objects.filter( worker__enabled=True, wireguard_status_updated__gt=timezone.now() - timedelta(minutes=10) @@ -368,6 +368,7 @@ def func_concatenate_cluster_wireguard_status_cache() -> None: cache_entries.append( { "source_name": f"worker_{ws.worker.name}", + "source_label": ws.worker.name, "source_uuid": str(ws.worker.uuid), "data": ws.wireguard_status or {}, } @@ -375,6 +376,7 @@ def func_concatenate_cluster_wireguard_status_cache() -> None: for entry in cache_entries: source_name = entry["source_name"] + source_label = entry["source_label"] source_uuid = entry["source_uuid"] data = entry.get("data") or {} @@ -393,6 +395,7 @@ def func_concatenate_cluster_wireguard_status_cache() -> None: peer_info_copy = dict(peer_info) peer_info_copy["source_name"] = source_name + peer_info_copy["source_label"] = source_label peer_info_copy["source_uuid"] = source_uuid if peer_key not in combined_data[interface]: diff --git a/templates/wireguard/peer_list/script_wireguard_status_update.html b/templates/wireguard/peer_list/script_wireguard_status_update.html index c2849fa..d87a955 100644 --- a/templates/wireguard/peer_list/script_wireguard_status_update.html +++ b/templates/wireguard/peer_list/script_wireguard_status_update.html @@ -141,7 +141,7 @@ const getPeerLocationLabel = (peerInfo) => { if (peerInfo && peerInfo.source_uuid && String(peerInfo.source_uuid).trim() !== '') { - return peerInfo.source_name || ''; + return peerInfo.source_label || peerInfo.source_name || ''; } return "{% trans 'Primary Server' %}"; };