[pdm-devel] [PATCH datacenter-manager] ui: task list: look up task description for PBS tasks
Lukas Wagner
l.wagner at proxmox.com
Tue Dec 2 17:39:59 CET 2025
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 at 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
More information about the pdm-devel
mailing list