all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pdm-devel] [PATCH datacenter-manager] ui: task list: look up task description for PBS tasks
@ 2025-12-02 16:39 Lukas Wagner
  2025-12-02 18:49 ` [pdm-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Wagner @ 2025-12-02 16:39 UTC (permalink / raw)
  To: pdm-devel

Before this commit, PBS tasks would have their full UPID in the
'Description' column, which looks a bit odd.

The actual task description definitions are still missing, these can be
added later. Up until then, the description will now look like e.g.
'create-datastore xyz', which is definitely better than the plain UPID.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 ui/src/tasks.rs | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/ui/src/tasks.rs b/ui/src/tasks.rs
index 41a8648d..0f9a9aa7 100644
--- a/ui/src/tasks.rs
+++ b/ui/src/tasks.rs
@@ -1,8 +1,7 @@
 use proxmox_yew_comp::utils::{format_task_description, format_upid, register_task_description};
 use pwt::tr;
 
-use pdm_api_types::RemoteUpid;
-use pdm_client::types::PveUpid;
+use pdm_api_types::{NativeUpid, RemoteUpid};
 use yew::virtual_dom::Key;
 
 pub fn register_pve_tasks() {
@@ -112,10 +111,16 @@ pub fn register_pve_tasks() {
 /// If it's a [`RemoteUpid`], prefixes it with the remote name
 pub fn format_optional_remote_upid(upid: &str, include_remote: bool) -> String {
     if let Ok(remote_upid) = upid.parse::<RemoteUpid>() {
-        let description = match remote_upid.upid().parse::<PveUpid>() {
-            Ok(upid) => format_task_description(&upid.worker_type, upid.worker_id.as_deref()),
+        let description = match remote_upid.native_upid() {
+            Ok(NativeUpid::PveUpid(upid)) => {
+                format_task_description(&upid.worker_type, upid.worker_id.as_deref())
+            }
+            Ok(NativeUpid::PbsUpid(upid)) => {
+                format_task_description(&upid.worker_type, upid.worker_id.as_deref())
+            }
             Err(_) => format_upid(&remote_upid.upid()),
         };
+
         if include_remote {
             format!("{} - {}", remote_upid.remote(), description)
         } else {
-- 
2.47.3



_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-12-02 18:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-02 16:39 [pdm-devel] [PATCH datacenter-manager] ui: task list: look up task description for PBS tasks Lukas Wagner
2025-12-02 18:49 ` [pdm-devel] applied: " Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal