[pdm-devel] [PATCH pve-yew-mobile-gui 1/1] tree-wide: handle fallback enum values

Stefan Hanreich s.hanreich at proxmox.com
Wed Nov 12 10:22:10 CET 2025


pve-api-types introduced a new fallback variant when encountering
unknown enum variants in the Proxmox VE API response.

For the resources overview, simply ignore any unknown resource type
and do nothing, as is alreadu the case with known resource types that
are not yet implemented.

Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
---
 src/pages/page_resources.rs   | 4 +++-
 src/pages/page_task_status.rs | 7 +++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/pages/page_resources.rs b/src/pages/page_resources.rs
index f0c1e2d..50b2545 100644
--- a/src/pages/page_resources.rs
+++ b/src/pages/page_resources.rs
@@ -231,7 +231,8 @@ impl PvePageResources {
                     ClusterResourceType::Node => Some(self.create_node_list_item(ctx, item)),
                     ClusterResourceType::Pool
                     | ClusterResourceType::Openvz
-                    | ClusterResourceType::Sdn => {
+                    | ClusterResourceType::Sdn
+                    | ClusterResourceType::UnknownEnumValue(_) => {
                         /* ignore for now  */
                         None
                     }
@@ -343,6 +344,7 @@ fn type_ordering(ty: ClusterResourceType) -> usize {
         ClusterResourceType::Node => 4,
         ClusterResourceType::Pool => 5,
         ClusterResourceType::Sdn => 6,
+        ClusterResourceType::UnknownEnumValue(_) => 1000,
     }
 }
 
diff --git a/src/pages/page_task_status.rs b/src/pages/page_task_status.rs
index 4424eed..dda34a5 100644
--- a/src/pages/page_task_status.rs
+++ b/src/pages/page_task_status.rs
@@ -125,6 +125,13 @@ impl PvePageTaskStatus {
                         (IsRunning::Stopped, None) => {
                             format!("{} ({})", tr!("stopped"), tr!("unknown"))
                         }
+                        (IsRunning::UnknownEnumValue(value), msg) => {
+                            format!(
+                                "{} ({})",
+                                tr!("unknown status '{0}'", value),
+                                msg.as_ref().unwrap_or(&tr!("unknown"))
+                            )
+                        }
                     },
                 ));
 
-- 
2.47.3




More information about the pdm-devel mailing list