public inbox for yew-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Shannon Sterz <s.sterz@proxmox.com>
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	[thread overview]
Message-ID: <20260508155722.464564-15-s.sterz@proxmox.com> (raw)
In-Reply-To: <20260508155722.464564-1-s.sterz@proxmox.com>

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 <s.sterz@proxmox.com>
---
 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! {
-                    <div>{ format!("Firewall rules for cluster") }</div>
-                },
+                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! {
+                    <div>{ format!("Firewall security group for cluster") }</div>
+                },
+            ),
             ViewState::Alias => (
                 "alias",
                 html! {
@@ -91,13 +98,7 @@ impl Component for PvePageClusterFirewall {
                 html! {
                     <div>{ format!("Firewall ipset for cluster") }</div>
                 },
-            ),
-            ViewState::SecurityGroup => (
-                "security-group",
-                html! {
-                    <div>{ format!("Firewall security group for cluster") }</div>
-                },
-            ),
+            ),*/
         };
 
         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<ViewState>,
@@ -72,9 +72,14 @@ impl Component for PveQemuFirewallPanel {
         let (active_tab, content): (_, Html) = match *self.view_state {
             ViewState::Rules => (
                 "rules",
-                html! {
-                    <div>{ format!("Firewall rules for VM {}", props.vmid) }</div>
-                },
+                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! {
                     <div>{ format!("Firewall alias for VM {}", props.vmid) }</div>
@@ -100,7 +105,7 @@ impl Component for PveQemuFirewallPanel {
                 html! {
                     <div>{ format!("Firewall log for VM {}", props.vmid) }</div>
                 },
-            ),
+            ),*/
         };
 
         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





  parent reply	other threads:[~2026-05-08 16:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08 15:57 [PATCH yew-comp/yew-mobile-gui v2 00/21] firewall tabs and clean up for pve-yew-mobile-gui Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-comp v2 01/21] firewall rules panel: correct the url for the pve cluster firewall rules Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 02/21] cargo.toml: globally ignore certain clippy lints Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 03/21] main: avoid unnecessary clones Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 04/21] tree-wide: collapse if statements Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 05/21] tree-wide: implement the `From` trait instead of the `Into` trait Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 06/21] tree-wide: implement `Default` for types with an `new()` constructor Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 07/21] tree-wide: remove unnecessary lazy evaluations Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 08/21] tree-wide: remove needless borrows Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 09/21] configuration page: remove redundant static lifetimes Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 10/21] resources/configuration page: remove useless `.into()` calls Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 11/21] tree-wide: fix several clippy lints Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 12/21] dashboard: use proper plural translation string instead of "CPU(s)" Shannon Sterz
2026-05-08 16:11   ` Shan Shaji
2026-05-08 16:13   ` Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 13/21] configuration: clarify that "Firewall" shows the cluster's firewall Shannon Sterz
2026-05-08 15:57 ` Shannon Sterz [this message]
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 15/21] qemu status page: align icons better with tabs Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 16/21] lxc page: align layout for lxc guest with qemu guests Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 17/21] lxc: add support for a rudimentary firewall tab for lxc guests Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 18/21] node status: align layout for node status with guest pages Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 19/21] node: add a rudimentary firewall tab for cluster nodes Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 20/21] api types: remove unused file Shannon Sterz
2026-05-08 15:57 ` [PATCH yew-mobile-gui v2 21/21] resources page: map subscription level analogous to dashboard Shannon Sterz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260508155722.464564-15-s.sterz@proxmox.com \
    --to=s.sterz@proxmox.com \
    --cc=yew-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal