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 19D7B1FF183 for ; Wed, 3 Dec 2025 14:40:42 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 53B98AA88; Wed, 3 Dec 2025 14:41:08 +0100 (CET) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Wed, 3 Dec 2025 14:40:28 +0100 Message-ID: <20251203134035.3214495-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.120 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 POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_2 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_4 0.1 random spam to be learned in bayes RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: remote wizard: append nodename to tokenname if possible 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" so that multiple PDM instances can access the same remotes without having their token names clash by default. Extract the token name from the `Proxmox` object of the index. Signed-off-by: Dominik Csapak --- ui/src/remotes/wizard_page_info.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ui/src/remotes/wizard_page_info.rs b/ui/src/remotes/wizard_page_info.rs index 8bcd1b38..fbe57d63 100644 --- a/ui/src/remotes/wizard_page_info.rs +++ b/ui/src/remotes/wizard_page_info.rs @@ -1,8 +1,10 @@ use std::rc::Rc; use anyhow::Error; +use gloo_utils::{format::JsValueSerdeExt, window}; use html::IntoEventCallback; use serde::{Deserialize, Serialize}; +use wasm_bindgen::JsValue; use yew::virtual_dom::{Key, VComp, VNode}; use proxmox_schema::property_string::PropertyString; @@ -341,7 +343,10 @@ impl Component for PdmWizardPageInfo { .disabled(!self.user_mode) .required(self.user_mode) .submit(self.user_mode) - .default("pdm-admin"), + .default(match get_nodename() { + Some(nodename) => format!("pdm-admin-{nodename}"), + None => "pdm-admin".to_string(), + }), ) .with_right_custom_child(Container::new().key("spacer")) //spacer .with_right_custom_child( @@ -409,3 +414,15 @@ impl From for VNode { VNode::from(comp) } } + +#[derive(Deserialize)] +struct ProxmoxServerConfig { + #[serde(alias = "NodeName")] + pub node_name: String, +} + +fn get_nodename() -> Option { + let value = js_sys::Reflect::get(&window(), &JsValue::from_str("Proxmox")).ok()?; + let config: ProxmoxServerConfig = JsValueSerdeExt::into_serde(&value).ok()?; + Some(config.node_name) +} -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel