[pdm-devel] [PATCH datacenter-manager] ui: use TaskListItem from pbs_api_types to replace removed types

Shannon Sterz s.sterz at proxmox.com
Thu Oct 16 10:43:09 CEST 2025


proxmox-yew-comp recently (c555d73c3bbe2f761b5c0aa237852bc65c870d34:
cleanup: remove copied types - use types from pbs_api_types instead)
removed TaskListItem from the common_api_types module and replaced it
with pbs_api_types' TaskListItem. so use that here again too to make
the ui build again avoid incompatabilities.

Signed-off-by: Shannon Sterz <s.sterz at proxmox.com>
---
this will make the ui build-able again aginst current yew-comp master
(c726bddb7b2b999437215b697d025ba76fcfb328: apt package manager: make it
compile again).

note that pdm_api_types has a basically identical TaskListItem type, but
we can't use that here because yew-comp expects the one from
pbs_api_types.

 ui/src/dashboard/filtered_tasks.rs | 5 +++--
 ui/src/main.rs                     | 2 +-
 ui/src/remotes/tasks.rs            | 6 +++---
 ui/src/top_nav_bar.rs              | 2 +-
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/ui/src/dashboard/filtered_tasks.rs b/ui/src/dashboard/filtered_tasks.rs
index b939ccd..5be3bc8 100644
--- a/ui/src/dashboard/filtered_tasks.rs
+++ b/ui/src/dashboard/filtered_tasks.rs
@@ -2,7 +2,7 @@ use std::rc::Rc;

 use anyhow::Error;
 use proxmox_yew_comp::{
-    common_api_types::{TaskListItem, TaskStatusClass},
+    common_api_types::TaskStatusClass,
     http_get,
     utils::{format_duration_human, render_epoch},
     Status, TaskViewer,
@@ -25,6 +25,7 @@ use pwt::{
 };
 use pwt::{state::Store, tr, widget::Dialog};

+use pbs_api_types::TaskListItem;
 use pdm_api_types::{RemoteUpid, TaskFilters, TaskStateType};

 use crate::tasks::{format_optional_remote_upid, TaskWorkerType};
@@ -131,7 +132,7 @@ impl Component for PdmFilteredTasks {
             Msg::LoadFinished(res)
         });
         Self {
-            task_store: Store::new(),
+            task_store: Store::with_extract_key(|item: &TaskListItem| item.upid.clone().into()),
             task_info: None,
             loading: true,
             last_error: None,
diff --git a/ui/src/main.rs b/ui/src/main.rs
index 767a3cc..715ecec 100644
--- a/ui/src/main.rs
+++ b/ui/src/main.rs
@@ -13,8 +13,8 @@ use pwt::props::TextRenderFn;
 use pwt::state::{Loader, PersistentState};
 use pwt::widget::{Column, DesktopApp, Dialog, Mask};

+use pbs_api_types::TaskListItem;
 use proxmox_login::Authentication;
-use proxmox_yew_comp::common_api_types::TaskListItem;
 use proxmox_yew_comp::utils::init_task_descr_table_base;
 use proxmox_yew_comp::{
     authentication_from_cookie, http_get, register_auth_observer, AuthObserver, LoginPanel,
diff --git a/ui/src/remotes/tasks.rs b/ui/src/remotes/tasks.rs
index fc7c30a..4853a1c 100644
--- a/ui/src/remotes/tasks.rs
+++ b/ui/src/remotes/tasks.rs
@@ -7,11 +7,11 @@ use yew::{
     AttrValue, Component, Properties,
 };

+use pbs_api_types::TaskListItem;
 use pdm_api_types::RemoteUpid;

-use proxmox_yew_comp::{
-    common_api_types::TaskListItem, utils::render_epoch_short, TaskViewer, Tasks,
-};
+use proxmox_yew_comp::{utils::render_epoch_short, TaskViewer, Tasks};
+
 use pwt::{
     css::{FlexFit, JustifyContent},
     props::{ContainerBuilder, FieldBuilder, WidgetBuilder},
diff --git a/ui/src/top_nav_bar.rs b/ui/src/top_nav_bar.rs
index 9aeeb73..74394a8 100644
--- a/ui/src/top_nav_bar.rs
+++ b/ui/src/top_nav_bar.rs
@@ -13,7 +13,6 @@ use yew::virtual_dom::{VComp, VNode};
 use pwt::state::{Loader, Theme, ThemeObserver};
 use pwt::widget::{Button, Container, Row, ThemeModeSelector, Tooltip};

-use proxmox_yew_comp::common_api_types::TaskListItem;
 use proxmox_yew_comp::utils::set_location_href;
 use proxmox_yew_comp::RunningTasksButton;
 use proxmox_yew_comp::{http_get, LanguageDialog, TaskViewer, ThemeDialog};
@@ -21,6 +20,7 @@ use proxmox_yew_comp::{http_get, LanguageDialog, TaskViewer, ThemeDialog};
 use pwt_macros::builder;

 use pdm_api_types::RemoteUpid;
+use pbs_api_types::TaskListItem;

 use crate::tasks::format_optional_remote_upid;
 use crate::widget::SearchBox;
--
2.47.3





More information about the pdm-devel mailing list