From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 063681FF14F for ; Fri, 08 May 2026 18:06:03 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 97AA11D9AD; Fri, 8 May 2026 18:06:02 +0200 (CEST) From: Shannon Sterz To: yew-devel@lists.proxmox.com Subject: [PATCH yew-mobile-gui v2 14/21] cluster/qemu firewall: use rules panel and comment out unused tabs Date: Fri, 8 May 2026 17:57:15 +0200 Message-ID: <20260508155722.464564-15-s.sterz@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260508155722.464564-1-s.sterz@proxmox.com> References: <20260508155722.464564-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778255736423 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.035 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 POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_2 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_4 0.1 random spam to be learned in bayes 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] Message-ID-Hash: 5T3QVG7GTYFJM7S6JSAEFXFKKEIYYYGL X-Message-ID-Hash: 5T3QVG7GTYFJM7S6JSAEFXFKKEIYYYGL X-MailFrom: s.sterz@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Yew framework devel list at Proxmox List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: this makes the rules panel actually display the QEMU and cluster firewall rules. it also comments out the place-holder tabs for now as they don't actually offer any real benefit to users yet. add them back once appropriate components have been implemented. Signed-off-by: Shannon Sterz --- src/pages/page_cluster_firewall/mod.rs | 51 ++++++++++---------- src/pages/page_qemu_status/firewall_panel.rs | 27 ++++++----- 2 files changed, 42 insertions(+), 36 deletions(-) diff --git a/src/pages/page_cluster_firewall/mod.rs b/src/pages/page_cluster_firewall/mod.rs index 6bb8253..47b50cf 100644 --- a/src/pages/page_cluster_firewall/mod.rs +++ b/src/pages/page_cluster_firewall/mod.rs @@ -8,7 +8,7 @@ use pwt::prelude::*; use pwt::state::PersistentState; use pwt::widget::{Column, MiniScroll, TabBar, TabBarItem}; -use proxmox_yew_comp::configuration::pve::FirewallOptionsClusterPanel; +use proxmox_yew_comp::configuration::pve::{FirewallOptionsClusterPanel, FirewallRulesPanel}; use pwt::props::StorageLocation; use crate::widgets::TopNavBar; @@ -37,9 +37,9 @@ pub enum ViewState { #[default] Rules, Options, - SecurityGroup, - Alias, - IPSet, + //SecurityGroup, + //Alias, + //IPSet, } pub enum Msg { @@ -69,9 +69,10 @@ impl Component for PvePageClusterFirewall { let (active_tab, content): (_, Html) = match *self.view_state { ViewState::Rules => ( "rules", - html! { -
{ format!("Firewall rules for cluster") }
- }, + FirewallRulesPanel::cluster_firewall() + .mobile(true) + .readonly(true) + .into(), ), ViewState::Options => ( "options", @@ -80,6 +81,12 @@ impl Component for PvePageClusterFirewall { .readonly(true) .into(), ), + /*ViewState::SecurityGroup => ( + "security-group", + html! { +
{ format!("Firewall security group for cluster") }
+ }, + ), ViewState::Alias => ( "alias", html! { @@ -91,13 +98,7 @@ impl Component for PvePageClusterFirewall { html! {
{ format!("Firewall ipset for cluster") }
}, - ), - ViewState::SecurityGroup => ( - "security-group", - html! { -
{ format!("Firewall security group for cluster") }
- }, - ), + ),*/ }; let tab_bar = TabBar::new() @@ -122,6 +123,16 @@ impl Component for PvePageClusterFirewall { .callback(|_| Msg::SetViewState(ViewState::Options)), ), ) + /*.with_item( + TabBarItem::new() + .key("security-group") + .label(tr!("Security Group")) + .icon_class("fa fa-list") + .on_activate( + ctx.link() + .callback(|_| Msg::SetViewState(ViewState::SecurityGroup)), + ), + ) .with_item( TabBarItem::new() .key("alias") @@ -135,17 +146,7 @@ impl Component for PvePageClusterFirewall { .label(tr!("IPSet")) .icon_class("fa fa-list-ol") .on_activate(ctx.link().callback(|_| Msg::SetViewState(ViewState::IPSet))), - ) - .with_item( - TabBarItem::new() - .key("security-group") - .label(tr!("Security Group")) - .icon_class("fa fa-list") - .on_activate( - ctx.link() - .callback(|_| Msg::SetViewState(ViewState::SecurityGroup)), - ), - ); + )*/; Column::new() .class("pwt-fit") diff --git a/src/pages/page_qemu_status/firewall_panel.rs b/src/pages/page_qemu_status/firewall_panel.rs index bcc6213..2c420c8 100644 --- a/src/pages/page_qemu_status/firewall_panel.rs +++ b/src/pages/page_qemu_status/firewall_panel.rs @@ -8,7 +8,7 @@ use pwt::props::StorageLocation; use pwt::state::PersistentState; use pwt::widget::{Column, MiniScroll, TabBar, TabBarItem}; -use proxmox_yew_comp::configuration::pve::FirewallOptionsGuestPanel; +use proxmox_yew_comp::configuration::pve::{FirewallOptionsGuestPanel, FirewallRulesPanel}; use proxmox_yew_comp::form::pve::PveGuestType; #[derive(Clone, PartialEq, Properties)] @@ -31,9 +31,9 @@ pub enum ViewState { #[default] Rules, Options, - Alias, - IPSet, - Log, + //Alias, + //IPSet, + //Log, } pub struct PveQemuFirewallPanel { view_state: PersistentState, @@ -72,9 +72,14 @@ impl Component for PveQemuFirewallPanel { let (active_tab, content): (_, Html) = match *self.view_state { ViewState::Rules => ( "rules", - html! { -
{ format!("Firewall rules for VM {}", props.vmid) }
- }, + FirewallRulesPanel::guest_firewall( + PveGuestType::Qemu, + props.node.clone(), + props.vmid, + ) + .mobile(true) + .readonly(true) + .into(), ), ViewState::Options => ( "options", @@ -83,7 +88,7 @@ impl Component for PveQemuFirewallPanel { .readonly(true) .into(), ), - ViewState::Alias => ( + /*ViewState::Alias => ( "alias", html! {
{ format!("Firewall alias for VM {}", props.vmid) }
@@ -100,7 +105,7 @@ impl Component for PveQemuFirewallPanel { html! {
{ format!("Firewall log for VM {}", props.vmid) }
}, - ), + ),*/ }; let tab_bar = TabBar::new() @@ -125,7 +130,7 @@ impl Component for PveQemuFirewallPanel { .callback(|_| Msg::SetViewState(ViewState::Options)), ), ) - .with_item( + /*.with_item( TabBarItem::new() .key("alias") .label(tr!("Alias")) @@ -145,7 +150,7 @@ impl Component for PveQemuFirewallPanel { .label(tr!("Log")) .icon_class("fa fa-list") .on_activate(ctx.link().callback(|_| Msg::SetViewState(ViewState::Log))), - ); + )*/; Column::new() .class(pwt::css::FlexFit) -- 2.47.3