[pdm-devel] [PATCH datacenter-manager v2 1/2] ui: register task descriptions for some native PDM tasks
Lukas Wagner
l.wagner at proxmox.com
Thu Dec 18 13:19:01 CET 2025
Signed-off-by: Lukas Wagner <l.wagner at proxmox.com>
---
ui/src/lib.rs | 2 +-
ui/src/main.rs | 7 ++++---
ui/src/tasks.rs | 19 ++++++++++++++++++-
3 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/ui/src/lib.rs b/ui/src/lib.rs
index 1aac7571..674cb27b 100644
--- a/ui/src/lib.rs
+++ b/ui/src/lib.rs
@@ -54,7 +54,7 @@ mod load_result;
pub use load_result::LoadResult;
mod tasks;
-pub use tasks::register_pve_tasks;
+pub use tasks::register_tasks;
mod view_list_context;
pub use view_list_context::ViewListContext;
diff --git a/ui/src/main.rs b/ui/src/main.rs
index 5f859dbc..56ae7429 100644
--- a/ui/src/main.rs
+++ b/ui/src/main.rs
@@ -23,8 +23,8 @@ use proxmox_yew_comp::{
//use pbs::MainMenu;
use pdm_api_types::views::ViewConfig;
use pdm_ui::{
- check_pdm_subscription, pdm_subscription_alert, register_pve_tasks, MainMenu, RemoteList,
- RemoteListCacheEntry, SearchProvider, TopNavBar, ViewListContext,
+ check_pdm_subscription, pdm_subscription_alert, MainMenu, RemoteList, RemoteListCacheEntry,
+ SearchProvider, TopNavBar, ViewListContext,
};
type MsgRemoteList = Result<RemoteList, Error>;
@@ -380,7 +380,8 @@ fn main() {
yew::set_custom_panic_hook(panic_hook());
init_task_descr_table_base();
- register_pve_tasks();
+ pdm_ui::register_tasks();
+
proxmox_yew_comp::http_setup(&proxmox_yew_comp::ExistingProduct::PDM);
pwt::props::set_http_get_method(
diff --git a/ui/src/tasks.rs b/ui/src/tasks.rs
index 0f9a9aa7..7e40863d 100644
--- a/ui/src/tasks.rs
+++ b/ui/src/tasks.rs
@@ -4,7 +4,12 @@ use pwt::tr;
use pdm_api_types::{NativeUpid, RemoteUpid};
use yew::virtual_dom::Key;
-pub fn register_pve_tasks() {
+pub fn register_tasks() {
+ register_pve_tasks();
+ register_pdm_tasks();
+}
+
+fn register_pve_tasks() {
register_task_description("qmstart", ("VM", tr!("Start")));
register_task_description("acmedeactivate", ("ACME Account", tr!("Deactivate")));
register_task_description("acmenewcert", ("SRV", tr!("Order Certificate")));
@@ -107,6 +112,18 @@ pub fn register_pve_tasks() {
register_task_description("zfsremove", ("ZFS Pool", tr!("Remove")));
}
+fn register_pdm_tasks() {
+ register_task_description("logrotate", tr!("Log Rotation"));
+ register_task_description(
+ "refresh-remote-tasks",
+ tr!("Fetch latest tasks from remotes"),
+ );
+ register_task_description(
+ "refresh-remote-updates",
+ tr!("Fetch system update list from remotes"),
+ );
+}
+
/// Format a UPID that is either [`RemoteUpid`] or a [`UPID`]
/// If it's a [`RemoteUpid`], prefixes it with the remote name
pub fn format_optional_remote_upid(upid: &str, include_remote: bool) -> String {
--
2.47.3
More information about the pdm-devel
mailing list