From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id D73A51FF0B4 for ; Fri, 27 Nov 2026 17:14:00 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 55176218CF; Fri, 27 Nov 2026 17:13:15 +0100 (CET) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Subject: [PATCH datacenter-manager 37/38] ui: views: map: show the names of the locations Date: Fri, 27 Nov 2026 17:12:34 +0100 Message-ID: <20261127161241.3713494-38-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261127161241.3713494-1-d.csapak@proxmox.com> References: <20261127161241.3713494-1-d.csapak@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.249 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: BNXX7LHNTLNAD27OEYTST7IKHQ7WMLXP X-Message-ID-Hash: BNXX7LHNTLNAD27OEYTST7IKHQ7WMLXP X-MailFrom: d.csapak@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: next to their points, so one does not have to hover each point to see what it is. That is the name of the location, or the name of the remote if the location has none. A point that combines several of them only gets a label if they all have the same one. Signed-off-by: Dominik Csapak --- ui/src/dashboard/map.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ui/src/dashboard/map.rs b/ui/src/dashboard/map.rs index 6626ec81..d486f22d 100644 --- a/ui/src/dashboard/map.rs +++ b/ui/src/dashboard/map.rs @@ -427,6 +427,7 @@ impl yew::Component for DashboardMapComp { .max_zoom_level(100.0) .show_night(true) .state_id("PdmWorldMap") + .show_labels(true) .points(self.points.clone()) .connections(self.connections.clone()) .into() @@ -449,6 +450,11 @@ impl std::ops::Deref for PoiInfo { } impl PoiInfo { + /// The name of the location, or of the remote if the location has none. + fn label(&self) -> &str { + self.name.as_deref().unwrap_or(&self.remote.name) + } + fn new(remote: RemoteInfo, nodes: Vec, name: Option) -> Self { yew::props!(Self { name, @@ -595,6 +601,15 @@ impl MapPointData for PoiInfo { point } + fn render_label(args: &PointsRenderArgs) -> Option { + // only if all remotes of the point agree on it + let label = args.points.first()?.data.label(); + args.points + .iter() + .all(|point| point.data.label() == label) + .then(|| label.to_string().into()) + } + fn render_info(args: &PointsRenderArgs) -> Html { let mut points = args.points.to_vec(); points.sort_by_cached_key(|point| point.data.render_title()); -- 2.47.3