From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 7856E1FF183 for ; Wed, 10 Sep 2025 13:53:29 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D68121FABA; Wed, 10 Sep 2025 13:53:33 +0200 (CEST) From: Dominik Csapak To: pdm-devel@lists.proxmox.com Date: Wed, 10 Sep 2025 13:52:54 +0200 Message-ID: <20250910115259.3530107-7-d.csapak@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250910115259.3530107-1-d.csapak@proxmox.com> References: <20250910115259.3530107-1-d.csapak@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.024 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [mod.rs, tree.rs] Subject: [pdm-devel] [PATCH datacenter-manager 5/5] ui: pve: tree: add remote tasks panel X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" under the now visible 'Remote' root object. In the future we probably want to add other things in the top level remote anyway so showing it now can't hurt. Signed-off-by: Dominik Csapak --- ui/src/pve/mod.rs | 7 +++++-- ui/src/pve/tree.rs | 6 +++++- ui/src/remotes/mod.rs | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ui/src/pve/mod.rs b/ui/src/pve/mod.rs index 7313d5e..fcbccc4 100644 --- a/ui/src/pve/mod.rs +++ b/ui/src/pve/mod.rs @@ -32,7 +32,7 @@ pub mod utils; mod tree; use tree::PveTreeNode; -use crate::get_deep_url; +use crate::{get_deep_url, remotes::RemoteTaskList}; #[derive(Debug, Eq, PartialEq, Properties)] pub struct PveRemote { @@ -171,7 +171,10 @@ impl LoadableComponent for PveRemoteComp { let remote = &props.remote; let content: Html = match &self.view { - PveTreeNode::Root => html! {}, + PveTreeNode::Root => Panel::new() + .title(tr!("Remote Tasks")) + .with_child(RemoteTaskList::new().remote(remote.clone())) + .into(), PveTreeNode::Node(node) => { node::NodePanel::new(remote.clone(), node.node.clone()).into() } diff --git a/ui/src/pve/tree.rs b/ui/src/pve/tree.rs index c669bab..d2d920c 100644 --- a/ui/src/pve/tree.rs +++ b/ui/src/pve/tree.rs @@ -256,7 +256,7 @@ impl PveTreeComp { } } self.store.write().update_root_tree(tree); - self.store.write().set_view_root(false); + self.store.write().set_view_root(true); self.loaded = true; } } @@ -557,6 +557,10 @@ fn columns( remote: String, loading: bool, ) -> Rc>> { + let loading = match store.read().root() { + Some(root) => loading && root.children_count() == 0, + None => loading, + }; Rc::new(vec![ DataTableColumn::new("Type/ID") .flex(1) diff --git a/ui/src/remotes/mod.rs b/ui/src/remotes/mod.rs index 88e6c46..83b3331 100644 --- a/ui/src/remotes/mod.rs +++ b/ui/src/remotes/mod.rs @@ -22,6 +22,7 @@ mod config; pub use config::{create_remote, RemoteConfigPanel}; mod tasks; +pub use tasks::RemoteTaskList; use yew::{function_component, Html}; @@ -51,7 +52,7 @@ pub fn system_configuration() -> Html { .key("tasks") .label(tr!("Tasks")) .icon_class("fa fa-book"), - |_| tasks::RemoteTaskList::new().into(), + |_| RemoteTaskList::new().into(), ); NavigationContainer::new().with_child(panel).into() -- 2.47.3 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel