From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id AA5571FF183 for ; Wed, 10 Sep 2025 14:05:16 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id EA6521FFEF; Wed, 10 Sep 2025 14:05:20 +0200 (CEST) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Wed, 10 Sep 2025 14:04:42 +0200 Message-ID: <20250910120447.3685764-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.974 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment KAM_MAILER 2 Automated Mailer Tag Left in Email SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pdm-devel] [PATCH datacenter-manager] ui: fix navigate_to route paths X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" routes must start with a '/' and we need the '/remote-' prefix to route to the correct panel Signed-off-by: Dominik Csapak --- ui/src/lib.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ui/src/lib.rs b/ui/src/lib.rs index e591a9e..77b1d3a 100644 --- a/ui/src/lib.rs +++ b/ui/src/lib.rs @@ -152,32 +152,32 @@ pub(crate) fn navigate_to( Some(match resource { pdm_client::types::Resource::PveQemu(PveQemuResource { vmid, .. }) | pdm_client::types::Resource::PveLxc(PveLxcResource { vmid, .. }) => { - (Some(remote), format!("guest+{vmid}")) + (true, format!("guest+{vmid}")) } pdm_client::types::Resource::PveNode(node) => { - (Some(remote), format!("node+{}", node.node)) + (true, format!("node+{}", node.node)) } pdm_client::types::Resource::PveStorage(storage) => ( - Some(remote), + true, format!("storage+{}+{}", storage.node, storage.storage), ), pdm_client::types::Resource::PveSdn(PveSdnResource::Zone(_)) => { - (None, "sdn/zones".to_string()) - } - pdm_client::types::Resource::PbsDatastore(store) => { - (Some(remote), store.name.clone()) + (false, "sdn/zones".to_string()) } + pdm_client::types::Resource::PbsDatastore(store) => (true, store.name.clone()), // FIXME: implement _ => return None, }) }) - .unwrap_or_default(); + .unwrap_or_else(|| (true, String::new())); - let prefix = prefix - .map(|prefix| format!("{prefix}/")) - .unwrap_or_default(); + let prefix = if prefix { + format!("remote-{remote}/") + } else { + String::new() + }; - nav.push(&yew_router::AnyRoute::new(format!("{prefix}{id}"))); + nav.push(&yew_router::AnyRoute::new(format!("/{prefix}{id}"))); } } -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel