[pdm-devel] [PATCH datacenter-manager v2 12/12] pdm-client: top entities: add view-filter parameter

Dominik Csapak d.csapak at proxmox.com
Wed Nov 5 11:12:12 CET 2025


This'll need some changes in the gui since this moved to
ui/src/dashboard/view.rs

otherwise LGTM

On 11/3/25 1:35 PM, Lukas Wagner wrote:
> Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
> ---
>   lib/pdm-client/src/lib.rs | 10 +++++++---
>   ui/src/dashboard/mod.rs   |  2 +-
>   2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/pdm-client/src/lib.rs b/lib/pdm-client/src/lib.rs
> index 7102ee05..c9ed18cc 100644
> --- a/lib/pdm-client/src/lib.rs
> +++ b/lib/pdm-client/src/lib.rs
> @@ -956,9 +956,13 @@ impl<T: HttpApiClient> PdmClient<T> {
>           Ok(self.0.get(&path).await?.expect_json()?.data)
>       }
>   
> -    pub async fn get_top_entities(&self) -> Result<TopEntities, Error> {
> -        let path = "/api2/extjs/resources/top-entities";
> -        Ok(self.0.get(path).await?.expect_json()?.data)
> +    pub async fn get_top_entities(&self, view_filter: Option<&str>) -> Result<TopEntities, Error> {
> +        let builder = ApiPathBuilder::new("/api2/extjs/resources/top-entities".to_string())
> +            .maybe_arg("view-filter", &view_filter);
> +
> +        let path = builder.build();
> +
> +        Ok(self.0.get(&path).await?.expect_json()?.data)
>       }
>   
>       pub async fn pve_node_status(&self, remote: &str, node: &str) -> Result<NodeStatus, Error> {
> diff --git a/ui/src/dashboard/mod.rs b/ui/src/dashboard/mod.rs
> index 07d5cd99..ce64d847 100644
> --- a/ui/src/dashboard/mod.rs
> +++ b/ui/src/dashboard/mod.rs
> @@ -319,7 +319,7 @@ impl PdmDashboard {
>               let top_entities_future = {
>                   let link = link.clone();
>                   async move {
> -                    let res = client.get_top_entities().await;
> +                    let res = client.get_top_entities(None).await;
>                       link.send_message(Msg::LoadingFinished(LoadingResult::TopEntities(res)));
>                   }
>               };





More information about the pdm-devel mailing list