all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Hanreich <s.hanreich@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH pve-yew-mobile-gui v2 1/1] tree-wide: handle fallback enum values
Date: Thu, 13 Nov 2025 16:09:31 +0100	[thread overview]
Message-ID: <20251113150934.611263-8-s.hanreich@proxmox.com> (raw)
In-Reply-To: <20251113150934.611263-1-s.hanreich@proxmox.com>

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@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 02b57cb..7302229 100644
--- a/src/pages/page_resources.rs
+++ b/src/pages/page_resources.rs
@@ -232,7 +232,8 @@ impl PvePageResources {
                     ClusterResourceType::Pool
                     | ClusterResourceType::Network
                     | ClusterResourceType::Sdn
-                    | ClusterResourceType::Openvz => {
+                    | ClusterResourceType::Openvz
+                    | ClusterResourceType::UnknownEnumValue(_) => {
                         /* ignore for now  */
                         None
                     }
@@ -345,6 +346,7 @@ fn type_ordering(ty: ClusterResourceType) -> usize {
         ClusterResourceType::Pool => 5,
         ClusterResourceType::Sdn => 6,
         ClusterResourceType::Network => 7,
+        ClusterResourceType::UnknownEnumValue(_) => 1000,
     }
 }
 
diff --git a/src/pages/page_task_status.rs b/src/pages/page_task_status.rs
index de702c1..9217e75 100644
--- a/src/pages/page_task_status.rs
+++ b/src/pages/page_task_status.rs
@@ -129,6 +129,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


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  parent reply	other threads:[~2025-11-13 15:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13 15:09 [pdm-devel] [RFC proxmox{, -yew-comp, -datacenter-manager}/yew-mobile-gui v2 0/7] Add fallback variant to enum properties in Proxmox VE Rust API types Stefan Hanreich
2025-11-13 15:09 ` [pdm-devel] [PATCH proxmox v2 1/4] pve-api-types: add FixedString type Stefan Hanreich
2025-11-13 15:09 ` [pdm-devel] [PATCH proxmox v2 2/4] pve-api-types: generate fallback variant for enums Stefan Hanreich
2025-11-13 15:09 ` [pdm-devel] [PATCH proxmox v2 3/4] pve-api-types: regenerate Stefan Hanreich
2025-11-13 15:09 ` [pdm-devel] [PATCH proxmox v2 4/4] pve-api-types: sdn: handle fallback variant Stefan Hanreich
2025-11-13 15:09 ` [pdm-devel] [PATCH proxmox-yew-comp v2 1/1] pve: qemu: handle fallback enum variants Stefan Hanreich
2025-11-13 15:09 ` [pdm-devel] [PATCH proxmox-datacenter-manager v2 1/1] tree-wide: handle new unknown " Stefan Hanreich
2025-11-13 15:09 ` Stefan Hanreich [this message]
2025-11-13 20:33 ` [pdm-devel] [RFC proxmox{, -yew-comp, -datacenter-manager}/yew-mobile-gui v2 0/7] Add fallback variant to enum properties in Proxmox VE Rust API types Thomas Lamprecht
2025-11-13 21:28 ` [pdm-devel] applied-series: " Thomas Lamprecht

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=20251113150934.611263-8-s.hanreich@proxmox.com \
    --to=s.hanreich@proxmox.com \
    --cc=pdm-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal