* [pdm-devel] [PATCH proxmox{, -datacenter-manager, -yew-comp} 0/4] rename ListFirewallRules to FirewallRule
@ 2025-12-17 15:08 Hannes Laimer
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox 1/2] pve-api-types: " Hannes Laimer
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Hannes Laimer @ 2025-12-17 15:08 UTC (permalink / raw)
To: pdm-devel
The name was odd since it is the struct of the items the list conatains,
not the list itself. This just renames the struct and fixes its
use-sites.
No functional change intended.
proxmox:
Hannes Laimer (2):
pve-api-types: rename ListFirewallRules to FirewallRule
pve-api-types: regenerate
pve-api-types/generate.pl | 10 +-
pve-api-types/src/generated/code.rs | 16 +-
pve-api-types/src/generated/types.rs | 262 +++++++++++++--------------
3 files changed, 144 insertions(+), 144 deletions(-)
proxmox-datacenter-manager:
Hannes Laimer (1):
pdm: rename ListFirewallRules to FirewallRule
lib/pdm-client/src/lib.rs | 8 ++++----
server/src/api/pve/firewall.rs | 16 ++++++++--------
2 files changed, 12 insertions(+), 12 deletions(-)
proxmox-yew-comp:
Hannes Laimer (1):
firewall: rules: rename ListFirewallRules to FirewallRule
src/firewall/rules.rs | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
Summary over all repositories:
6 files changed, 169 insertions(+), 169 deletions(-)
--
Generated by git-murpp 0.8.1
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pdm-devel] [PATCH proxmox 1/2] pve-api-types: rename ListFirewallRules to FirewallRule
2025-12-17 15:08 [pdm-devel] [PATCH proxmox{, -datacenter-manager, -yew-comp} 0/4] rename ListFirewallRules to FirewallRule Hannes Laimer
@ 2025-12-17 15:08 ` Hannes Laimer
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox 2/2] pve-api-types: regenerate Hannes Laimer
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Hannes Laimer @ 2025-12-17 15:08 UTC (permalink / raw)
To: pdm-devel
Since this is the type for just an item, not the whole list,
having it named `ListFirewallRules` didn't make much sense.
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
pve-api-types/generate.pl | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pve-api-types/generate.pl b/pve-api-types/generate.pl
index 3cebe321..17f7e1e5 100755
--- a/pve-api-types/generate.pl
+++ b/pve-api-types/generate.pl
@@ -414,13 +414,13 @@ api(GET => '/nodes/{node}/qemu/{vmid}/firewall/options', 'qemu_firewall_options'
api(PUT => '/nodes/{node}/qemu/{vmid}/firewall/options', 'set_qemu_firewall_options', 'param-name' => 'UpdateGuestFirewallOptions');
# rules
-api(GET => '/cluster/firewall/rules', 'list_cluster_firewall_rules', 'return-name' => 'ListFirewallRules');
+api(GET => '/cluster/firewall/rules', 'list_cluster_firewall_rules', 'return-name' => 'FirewallRule');
-api(GET => '/nodes/{node}/firewall/rules', 'list_node_firewall_rules', 'return-name' => 'ListFirewallRules');
+api(GET => '/nodes/{node}/firewall/rules', 'list_node_firewall_rules', 'return-name' => 'FirewallRule');
-api(GET => '/nodes/{node}/lxc/{vmid}/firewall/rules', 'list_lxc_firewall_rules', 'return-name' => 'ListFirewallRules');
-api(GET => '/nodes/{node}/qemu/{vmid}/firewall/rules', 'list_qemu_firewall_rules', 'return-name' => 'ListFirewallRules');
-Schema2Rust::derive('ListFirewallRules' => 'Clone', 'PartialEq');
+api(GET => '/nodes/{node}/lxc/{vmid}/firewall/rules', 'list_lxc_firewall_rules', 'return-name' => 'FirewallRule');
+api(GET => '/nodes/{node}/qemu/{vmid}/firewall/rules', 'list_qemu_firewall_rules', 'return-name' => 'FirewallRule');
+Schema2Rust::derive('FirewallRule' => 'Clone', 'PartialEq');
Schema2Rust::generate_enum('SdnObjectState', {
type => 'string',
--
2.47.3
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pdm-devel] [PATCH proxmox 2/2] pve-api-types: regenerate
2025-12-17 15:08 [pdm-devel] [PATCH proxmox{, -datacenter-manager, -yew-comp} 0/4] rename ListFirewallRules to FirewallRule Hannes Laimer
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox 1/2] pve-api-types: " Hannes Laimer
@ 2025-12-17 15:08 ` Hannes Laimer
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox-datacenter-manager 1/1] pdm: rename ListFirewallRules to FirewallRule Hannes Laimer
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox-yew-comp 1/1] firewall: rules: " Hannes Laimer
3 siblings, 0 replies; 5+ messages in thread
From: Hannes Laimer @ 2025-12-17 15:08 UTC (permalink / raw)
To: pdm-devel
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
pve-api-types/src/generated/code.rs | 16 +-
pve-api-types/src/generated/types.rs | 262 +++++++++++++--------------
2 files changed, 139 insertions(+), 139 deletions(-)
diff --git a/pve-api-types/src/generated/code.rs b/pve-api-types/src/generated/code.rs
index f364f9cd..3b80d933 100644
--- a/pve-api-types/src/generated/code.rs
+++ b/pve-api-types/src/generated/code.rs
@@ -512,7 +512,7 @@ pub trait PveClient {
}
/// List rules.
- async fn list_cluster_firewall_rules(&self) -> Result<Vec<ListFirewallRules>, Error> {
+ async fn list_cluster_firewall_rules(&self) -> Result<Vec<FirewallRule>, Error> {
Err(Error::Other("list_cluster_firewall_rules not implemented"))
}
@@ -541,7 +541,7 @@ pub trait PveClient {
&self,
node: &str,
vmid: u32,
- ) -> Result<Vec<ListFirewallRules>, Error> {
+ ) -> Result<Vec<FirewallRule>, Error> {
Err(Error::Other("list_lxc_firewall_rules not implemented"))
}
@@ -555,7 +555,7 @@ pub trait PveClient {
}
/// List rules.
- async fn list_node_firewall_rules(&self, node: &str) -> Result<Vec<ListFirewallRules>, Error> {
+ async fn list_node_firewall_rules(&self, node: &str) -> Result<Vec<FirewallRule>, Error> {
Err(Error::Other("list_node_firewall_rules not implemented"))
}
@@ -574,7 +574,7 @@ pub trait PveClient {
&self,
node: &str,
vmid: u32,
- ) -> Result<Vec<ListFirewallRules>, Error> {
+ ) -> Result<Vec<FirewallRule>, Error> {
Err(Error::Other("list_qemu_firewall_rules not implemented"))
}
@@ -1222,7 +1222,7 @@ where
}
/// List rules.
- async fn list_cluster_firewall_rules(&self) -> Result<Vec<ListFirewallRules>, Error> {
+ async fn list_cluster_firewall_rules(&self) -> Result<Vec<FirewallRule>, Error> {
let url = "/api2/extjs/cluster/firewall/rules";
Ok(self.0.get(url).await?.expect_json()?.data)
}
@@ -1262,7 +1262,7 @@ where
&self,
node: &str,
vmid: u32,
- ) -> Result<Vec<ListFirewallRules>, Error> {
+ ) -> Result<Vec<FirewallRule>, Error> {
let url = &format!(
"/api2/extjs/nodes/{}/lxc/{}/firewall/rules",
percent_encode(node.as_bytes(), percent_encoding::NON_ALPHANUMERIC),
@@ -1287,7 +1287,7 @@ where
}
/// List rules.
- async fn list_node_firewall_rules(&self, node: &str) -> Result<Vec<ListFirewallRules>, Error> {
+ async fn list_node_firewall_rules(&self, node: &str) -> Result<Vec<FirewallRule>, Error> {
let url = &format!(
"/api2/extjs/nodes/{}/firewall/rules",
percent_encode(node.as_bytes(), percent_encoding::NON_ALPHANUMERIC)
@@ -1317,7 +1317,7 @@ where
&self,
node: &str,
vmid: u32,
- ) -> Result<Vec<ListFirewallRules>, Error> {
+ ) -> Result<Vec<FirewallRule>, Error> {
let url = &format!(
"/api2/extjs/nodes/{}/qemu/{}/firewall/rules",
percent_encode(node.as_bytes(), percent_encoding::NON_ALPHANUMERIC),
diff --git a/pve-api-types/src/generated/types.rs b/pve-api-types/src/generated/types.rs
index 26f07a5a..823799ce 100644
--- a/pve-api-types/src/generated/types.rs
+++ b/pve-api-types/src/generated/types.rs
@@ -1891,6 +1891,137 @@ pub enum FirewallLogLevel {
serde_plain::derive_display_from_serialize!(FirewallLogLevel);
serde_plain::derive_fromstr_from_deserialize!(FirewallLogLevel);
+#[api(
+ properties: {
+ action: {
+ type: String,
+ },
+ comment: {
+ optional: true,
+ type: String,
+ },
+ dest: {
+ optional: true,
+ type: String,
+ },
+ dport: {
+ optional: true,
+ type: String,
+ },
+ enable: {
+ optional: true,
+ type: Integer,
+ },
+ "icmp-type": {
+ optional: true,
+ type: String,
+ },
+ iface: {
+ optional: true,
+ type: String,
+ },
+ ipversion: {
+ optional: true,
+ type: Integer,
+ },
+ log: {
+ optional: true,
+ type: FirewallLogLevel,
+ },
+ "macro": {
+ optional: true,
+ type: String,
+ },
+ pos: {
+ type: Integer,
+ },
+ proto: {
+ optional: true,
+ type: String,
+ },
+ source: {
+ optional: true,
+ type: String,
+ },
+ sport: {
+ optional: true,
+ type: String,
+ },
+ type: {
+ type: String,
+ },
+ },
+)]
+/// Object.
+#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
+pub struct FirewallRule {
+ /// Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name
+ pub action: String,
+
+ /// Descriptive comment
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub comment: Option<String>,
+
+ /// Restrict packet destination address
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub dest: Option<String>,
+
+ /// Restrict TCP/UDP destination port
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub dport: Option<String>,
+
+ /// Flag to enable/disable a rule
+ #[serde(deserialize_with = "proxmox_serde::perl::deserialize_i64")]
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub enable: Option<i64>,
+
+ /// Specify icmp-type. Only valid if proto equals 'icmp' or
+ /// 'icmpv6'/'ipv6-icmp'
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ #[serde(rename = "icmp-type")]
+ pub icmp_type: Option<String>,
+
+ /// Network interface name. You have to use network configuration key names
+ /// for VMs and containers
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub iface: Option<String>,
+
+ /// IP version (4 or 6) - automatically determined from source/dest
+ /// addresses
+ #[serde(deserialize_with = "proxmox_serde::perl::deserialize_i64")]
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub ipversion: Option<i64>,
+
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub log: Option<FirewallLogLevel>,
+
+ /// Use predefined standard macro
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ #[serde(rename = "macro")]
+ pub r#macro: Option<String>,
+
+ /// Rule position in the ruleset
+ #[serde(deserialize_with = "proxmox_serde::perl::deserialize_i64")]
+ pub pos: i64,
+
+ /// IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers,
+ /// as defined in '/etc/protocols'
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub proto: Option<String>,
+
+ /// Restrict packet source address
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub source: Option<String>,
+
+ /// Restrict TCP/UDP source port
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub sport: Option<String>,
+
+ /// Rule type
+ #[serde(rename = "type")]
+ pub ty: String,
+}
+
#[api]
/// Firewall conntrack helper.
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
@@ -2191,137 +2322,6 @@ pub enum ListControllersType {
serde_plain::derive_display_from_serialize!(ListControllersType);
serde_plain::derive_fromstr_from_deserialize!(ListControllersType);
-#[api(
- properties: {
- action: {
- type: String,
- },
- comment: {
- optional: true,
- type: String,
- },
- dest: {
- optional: true,
- type: String,
- },
- dport: {
- optional: true,
- type: String,
- },
- enable: {
- optional: true,
- type: Integer,
- },
- "icmp-type": {
- optional: true,
- type: String,
- },
- iface: {
- optional: true,
- type: String,
- },
- ipversion: {
- optional: true,
- type: Integer,
- },
- log: {
- optional: true,
- type: FirewallLogLevel,
- },
- "macro": {
- optional: true,
- type: String,
- },
- pos: {
- type: Integer,
- },
- proto: {
- optional: true,
- type: String,
- },
- source: {
- optional: true,
- type: String,
- },
- sport: {
- optional: true,
- type: String,
- },
- type: {
- type: String,
- },
- },
-)]
-/// Object.
-#[derive(Clone, Debug, PartialEq, serde::Deserialize, serde::Serialize)]
-pub struct ListFirewallRules {
- /// Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name
- pub action: String,
-
- /// Descriptive comment
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub comment: Option<String>,
-
- /// Restrict packet destination address
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub dest: Option<String>,
-
- /// Restrict TCP/UDP destination port
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub dport: Option<String>,
-
- /// Flag to enable/disable a rule
- #[serde(deserialize_with = "proxmox_serde::perl::deserialize_i64")]
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub enable: Option<i64>,
-
- /// Specify icmp-type. Only valid if proto equals 'icmp' or
- /// 'icmpv6'/'ipv6-icmp'
- #[serde(default, skip_serializing_if = "Option::is_none")]
- #[serde(rename = "icmp-type")]
- pub icmp_type: Option<String>,
-
- /// Network interface name. You have to use network configuration key names
- /// for VMs and containers
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub iface: Option<String>,
-
- /// IP version (4 or 6) - automatically determined from source/dest
- /// addresses
- #[serde(deserialize_with = "proxmox_serde::perl::deserialize_i64")]
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub ipversion: Option<i64>,
-
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub log: Option<FirewallLogLevel>,
-
- /// Use predefined standard macro
- #[serde(default, skip_serializing_if = "Option::is_none")]
- #[serde(rename = "macro")]
- pub r#macro: Option<String>,
-
- /// Rule position in the ruleset
- #[serde(deserialize_with = "proxmox_serde::perl::deserialize_i64")]
- pub pos: i64,
-
- /// IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers,
- /// as defined in '/etc/protocols'
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub proto: Option<String>,
-
- /// Restrict packet source address
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub source: Option<String>,
-
- /// Restrict TCP/UDP source port
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub sport: Option<String>,
-
- /// Rule type
- #[serde(rename = "type")]
- pub ty: String,
-}
-
#[api]
/// Only list specific interface types.
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize)]
--
2.47.3
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pdm-devel] [PATCH proxmox-datacenter-manager 1/1] pdm: rename ListFirewallRules to FirewallRule
2025-12-17 15:08 [pdm-devel] [PATCH proxmox{, -datacenter-manager, -yew-comp} 0/4] rename ListFirewallRules to FirewallRule Hannes Laimer
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox 1/2] pve-api-types: " Hannes Laimer
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox 2/2] pve-api-types: regenerate Hannes Laimer
@ 2025-12-17 15:08 ` Hannes Laimer
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox-yew-comp 1/1] firewall: rules: " Hannes Laimer
3 siblings, 0 replies; 5+ messages in thread
From: Hannes Laimer @ 2025-12-17 15:08 UTC (permalink / raw)
To: pdm-devel
Adjust to the rename in pve-api-types.
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
lib/pdm-client/src/lib.rs | 8 ++++----
server/src/api/pve/firewall.rs | 16 ++++++++--------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/lib/pdm-client/src/lib.rs b/lib/pdm-client/src/lib.rs
index 01ee6f7..9467142 100644
--- a/lib/pdm-client/src/lib.rs
+++ b/lib/pdm-client/src/lib.rs
@@ -475,7 +475,7 @@ impl<T: HttpApiClient> PdmClient<T> {
pub async fn pve_get_cluster_firewall_rules(
&self,
remote: &str,
- ) -> Result<Vec<pve_api_types::ListFirewallRules>, Error> {
+ ) -> Result<Vec<pve_api_types::FirewallRule>, Error> {
let path = format!("/api2/extjs/pve/remotes/{remote}/firewall/rules");
Ok(self.0.get(&path).await?.expect_json()?.data)
}
@@ -484,7 +484,7 @@ impl<T: HttpApiClient> PdmClient<T> {
&self,
remote: &str,
node: &str,
- ) -> Result<Vec<pve_api_types::ListFirewallRules>, Error> {
+ ) -> Result<Vec<pve_api_types::FirewallRule>, Error> {
let path = format!("/api2/extjs/pve/remotes/{remote}/nodes/{node}/firewall/rules");
Ok(self.0.get(&path).await?.expect_json()?.data)
}
@@ -494,7 +494,7 @@ impl<T: HttpApiClient> PdmClient<T> {
remote: &str,
node: Option<&str>,
vmid: u32,
- ) -> Result<Vec<pve_api_types::ListFirewallRules>, Error> {
+ ) -> Result<Vec<pve_api_types::FirewallRule>, Error> {
let path = ApiPathBuilder::new(format!(
"/api2/extjs/pve/remotes/{remote}/lxc/{vmid}/firewall/rules"
))
@@ -508,7 +508,7 @@ impl<T: HttpApiClient> PdmClient<T> {
remote: &str,
node: Option<&str>,
vmid: u32,
- ) -> Result<Vec<pve_api_types::ListFirewallRules>, Error> {
+ ) -> Result<Vec<pve_api_types::FirewallRule>, Error> {
let path = ApiPathBuilder::new(format!(
"/api2/extjs/pve/remotes/{remote}/qemu/{vmid}/firewall/rules"
))
diff --git a/server/src/api/pve/firewall.rs b/server/src/api/pve/firewall.rs
index af11d58..e60961c 100644
--- a/server/src/api/pve/firewall.rs
+++ b/server/src/api/pve/firewall.rs
@@ -529,7 +529,7 @@ pub async fn node_firewall_status(
returns: {
type: Array,
description: "List cluster firewall rules.",
- items: { type: pve_api_types::ListFirewallRules },
+ items: { type: pve_api_types::FirewallRule },
},
access: {
permission: &Permission::Privilege(&["resource", "{remote}"], PRIV_RESOURCE_AUDIT, false),
@@ -539,7 +539,7 @@ pub async fn node_firewall_status(
pub async fn cluster_firewall_rules(
remote: String,
_rpcenv: &mut dyn RpcEnvironment,
-) -> Result<Vec<pve_api_types::ListFirewallRules>, Error> {
+) -> Result<Vec<pve_api_types::FirewallRule>, Error> {
let (remotes, _) = pdm_config::remotes::config()?;
let pve = connect_to_remote(&remotes, &remote)?;
@@ -646,7 +646,7 @@ pub async fn update_node_firewall_options(
returns: {
type: Array,
description: "List node firewall rules.",
- items: { type: pve_api_types::ListFirewallRules },
+ items: { type: pve_api_types::FirewallRule },
},
access: {
permission: &Permission::Privilege(&["resource", "{remote}"], PRIV_RESOURCE_AUDIT, false),
@@ -657,7 +657,7 @@ pub async fn node_firewall_rules(
remote: String,
node: String,
_rpcenv: &mut dyn RpcEnvironment,
-) -> Result<Vec<pve_api_types::ListFirewallRules>, Error> {
+) -> Result<Vec<pve_api_types::FirewallRule>, Error> {
let (remotes, _) = pdm_config::remotes::config()?;
let pve = connect_to_remote(&remotes, &remote)?;
@@ -782,7 +782,7 @@ pub async fn update_qemu_firewall_options(
returns: {
type: Array,
description: "List LXC firewall rules.",
- items: { type: pve_api_types::ListFirewallRules },
+ items: { type: pve_api_types::FirewallRule },
},
access: {
permission: &Permission::Privilege(&["resource", "{remote}", "guest", "{vmid}"], PRIV_RESOURCE_AUDIT, false),
@@ -794,7 +794,7 @@ pub async fn lxc_firewall_rules(
node: Option<String>,
vmid: u32,
_rpcenv: &mut dyn RpcEnvironment,
-) -> Result<Vec<pve_api_types::ListFirewallRules>, Error> {
+) -> Result<Vec<pve_api_types::FirewallRule>, Error> {
let (remotes, _) = pdm_config::remotes::config()?;
let pve = connect_to_remote(&remotes, &remote)?;
@@ -818,7 +818,7 @@ pub async fn lxc_firewall_rules(
returns: {
type: Array,
description: "List QEMU firewall rules.",
- items: { type: pve_api_types::ListFirewallRules },
+ items: { type: pve_api_types::FirewallRule },
},
access: {
permission: &Permission::Privilege(&["resource", "{remote}", "guest", "{vmid}"], PRIV_RESOURCE_AUDIT, false),
@@ -830,7 +830,7 @@ pub async fn qemu_firewall_rules(
node: Option<String>,
vmid: u32,
_rpcenv: &mut dyn RpcEnvironment,
-) -> Result<Vec<pve_api_types::ListFirewallRules>, Error> {
+) -> Result<Vec<pve_api_types::FirewallRule>, Error> {
let (remotes, _) = pdm_config::remotes::config()?;
let pve = connect_to_remote(&remotes, &remote)?;
--
2.47.3
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* [pdm-devel] [PATCH proxmox-yew-comp 1/1] firewall: rules: rename ListFirewallRules to FirewallRule
2025-12-17 15:08 [pdm-devel] [PATCH proxmox{, -datacenter-manager, -yew-comp} 0/4] rename ListFirewallRules to FirewallRule Hannes Laimer
` (2 preceding siblings ...)
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox-datacenter-manager 1/1] pdm: rename ListFirewallRules to FirewallRule Hannes Laimer
@ 2025-12-17 15:08 ` Hannes Laimer
3 siblings, 0 replies; 5+ messages in thread
From: Hannes Laimer @ 2025-12-17 15:08 UTC (permalink / raw)
To: pdm-devel
Adjust to rename in pve-api-types.
Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
src/firewall/rules.rs | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/firewall/rules.rs b/src/firewall/rules.rs
index 0958fc0..c40fab7 100644
--- a/src/firewall/rules.rs
+++ b/src/firewall/rules.rs
@@ -82,10 +82,10 @@ pub enum FirewallMsg {
#[doc(hidden)]
pub struct ProxmoxFirewallRules {
- store: Store<pve_api_types::ListFirewallRules>,
- loader: Loader<Vec<pve_api_types::ListFirewallRules>>,
- _listener: SharedStateObserver<LoaderState<Vec<pve_api_types::ListFirewallRules>>>,
- columns: Rc<Vec<DataTableHeader<pve_api_types::ListFirewallRules>>>,
+ store: Store<pve_api_types::FirewallRule>,
+ loader: Loader<Vec<pve_api_types::FirewallRule>>,
+ _listener: SharedStateObserver<LoaderState<Vec<pve_api_types::FirewallRule>>>,
+ columns: Rc<Vec<DataTableHeader<pve_api_types::FirewallRule>>>,
}
fn pill(text: impl Into<AttrValue>) -> Container {
@@ -99,7 +99,7 @@ fn pill(text: impl Into<AttrValue>) -> Container {
.with_child(text.into())
}
-fn format_firewall_rule(rule: &pve_api_types::ListFirewallRules) -> Html {
+fn format_firewall_rule(rule: &pve_api_types::FirewallRule) -> Html {
let mut parts: Vec<VNode> = Vec::new();
if let Some(iface) = &rule.iface {
@@ -155,21 +155,21 @@ impl ProxmoxFirewallRules {
}
}
- fn build_columns() -> Rc<Vec<DataTableHeader<pve_api_types::ListFirewallRules>>> {
+ fn build_columns() -> Rc<Vec<DataTableHeader<pve_api_types::FirewallRule>>> {
Rc::new(vec![
DataTableColumn::new("")
.width("30px")
.justify("right")
.show_menu(false)
.resizable(false)
- .render(|rule: &pve_api_types::ListFirewallRules| html! {&rule.pos})
+ .render(|rule: &pve_api_types::FirewallRule| html! {&rule.pos})
.into(),
DataTableColumn::new(tr!("On"))
.width("40px")
.justify("center")
.resizable(false)
.render(
- |rule: &pve_api_types::ListFirewallRules| match rule.enable {
+ |rule: &pve_api_types::FirewallRule| match rule.enable {
Some(1) => Fa::new("check").into(),
Some(0) | None => Fa::new("minus").into(),
_ => "-".into(),
@@ -178,19 +178,19 @@ impl ProxmoxFirewallRules {
.into(),
DataTableColumn::new(tr!("Type"))
.width("80px")
- .render(|rule: &pve_api_types::ListFirewallRules| html! {&rule.ty})
+ .render(|rule: &pve_api_types::FirewallRule| html! {&rule.ty})
.into(),
DataTableColumn::new(tr!("Action"))
.width("100px")
- .render(|rule: &pve_api_types::ListFirewallRules| html! {&rule.action})
+ .render(|rule: &pve_api_types::FirewallRule| html! {&rule.action})
.into(),
DataTableColumn::new(tr!("Rule"))
.flex(1)
- .render(|rule: &pve_api_types::ListFirewallRules| format_firewall_rule(rule))
+ .render(|rule: &pve_api_types::FirewallRule| format_firewall_rule(rule))
.into(),
DataTableColumn::new(tr!("Comment"))
.width("150px")
- .render(|rule: &pve_api_types::ListFirewallRules| {
+ .render(|rule: &pve_api_types::FirewallRule| {
rule.comment.as_deref().unwrap_or("-").into()
})
.into(),
@@ -207,7 +207,7 @@ impl Component for ProxmoxFirewallRules {
let url: AttrValue = props.context.rules_url().into();
- let store = Store::with_extract_key(|item: &pve_api_types::ListFirewallRules| {
+ let store = Store::with_extract_key(|item: &pve_api_types::FirewallRule| {
Key::from(item.pos.to_string())
});
--
2.47.3
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-12-17 15:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-17 15:08 [pdm-devel] [PATCH proxmox{, -datacenter-manager, -yew-comp} 0/4] rename ListFirewallRules to FirewallRule Hannes Laimer
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox 1/2] pve-api-types: " Hannes Laimer
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox 2/2] pve-api-types: regenerate Hannes Laimer
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox-datacenter-manager 1/1] pdm: rename ListFirewallRules to FirewallRule Hannes Laimer
2025-12-17 15:08 ` [pdm-devel] [PATCH proxmox-yew-comp 1/1] firewall: rules: " Hannes Laimer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox