From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id CD1651FF179 for ; Wed, 29 Oct 2025 15:48:48 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C979CE575; Wed, 29 Oct 2025 15:49:19 +0100 (CET) From: Lukas Wagner To: pdm-devel@lists.proxmox.com Date: Wed, 29 Oct 2025 15:49:01 +0100 Message-ID: <20251029144902.446852-13-l.wagner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251029144902.446852-1-l.wagner@proxmox.com> References: <20251029144902.446852-1-l.wagner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761749339116 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.027 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 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 12/13] pdm-client: resource list: add view-filter parameter 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" Signed-off-by: Lukas Wagner --- cli/client/src/resources.rs | 2 +- lib/pdm-client/src/lib.rs | 9 ++++++++- ui/src/sdn/zone_tree.rs | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cli/client/src/resources.rs b/cli/client/src/resources.rs index dbf9f265..bc3a98ba 100644 --- a/cli/client/src/resources.rs +++ b/cli/client/src/resources.rs @@ -31,7 +31,7 @@ pub fn cli() -> CommandLineInterface { )] /// List all the remotes this instance is managing. async fn get_resources(max_age: Option) -> Result<(), Error> { - let mut resources = client()?.resources(max_age).await?; + let mut resources = client()?.resources(max_age, None).await?; let output_format = env().format_args.output_format; if output_format == OutputFormat::Text { if resources.is_empty() { diff --git a/lib/pdm-client/src/lib.rs b/lib/pdm-client/src/lib.rs index 0cab7691..7102ee05 100644 --- a/lib/pdm-client/src/lib.rs +++ b/lib/pdm-client/src/lib.rs @@ -863,9 +863,14 @@ impl PdmClient { Ok(self.0.get(&path).await?.expect_json()?.data) } - pub async fn resources(&self, max_age: Option) -> Result, Error> { + pub async fn resources( + &self, + max_age: Option, + view_filter: Option<&str>, + ) -> Result, Error> { let path = ApiPathBuilder::new("/api2/extjs/resources/list") .maybe_arg("max-age", &max_age) + .maybe_arg("view-filter", &view_filter) .build(); Ok(self.0.get(&path).await?.expect_json()?.data) } @@ -874,10 +879,12 @@ impl PdmClient { &self, max_age: Option, resource_type: ResourceType, + view_filter: Option<&str>, ) -> Result, Error> { let path = ApiPathBuilder::new("/api2/extjs/resources/list") .maybe_arg("max-age", &max_age) .arg("resource-type", resource_type) + .maybe_arg("view-filter", &view_filter) .build(); Ok(self.0.get(&path).await?.expect_json()?.data) diff --git a/ui/src/sdn/zone_tree.rs b/ui/src/sdn/zone_tree.rs index 2f907641..9b688769 100644 --- a/ui/src/sdn/zone_tree.rs +++ b/ui/src/sdn/zone_tree.rs @@ -281,7 +281,7 @@ impl LoadableComponent for ZoneTreeComponent { Box::pin(async move { let client = pdm_client(); let remote_resources = client - .resources_by_type(None, ResourceType::PveSdnZone) + .resources_by_type(None, ResourceType::PveSdnZone, None) .await?; link.send_message(Self::Message::LoadFinished(remote_resources)); -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel