From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id AD6EE1FF0DF for ; Fri, 28 Aug 2026 14:56:08 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 77759214DC; Fri, 28 Aug 2026 14:56:08 +0200 (CEST) Content-Type: text/plain; charset=UTF-8 Date: Fri, 28 Aug 2026 14:56:04 +0200 Message-Id: Subject: Re: [PATCH datacenter-manager v3 7/9] ui: pve: show ha maintenance mode for nodes From: "Lukas Wagner" To: "Dominik Csapak" , Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: aerc 0.21.0-0-g5549850facc2-dirty References: <20260821123201.3035643-1-d.csapak@proxmox.com> <20260821123201.3035643-8-d.csapak@proxmox.com> In-Reply-To: <20260821123201.3035643-8-d.csapak@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787921754756 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.406 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: ZUFZ7YONDO26PQ74RFKQBZ723IRQ7C6M X-Message-ID-Hash: ZUFZ7YONDO26PQ74RFKQBZ723IRQ7C6M X-MailFrom: l.wagner@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: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri Aug 21, 2026 at 2:30 PM CEST, Dominik Csapak wrote: > By rendering a small `Badge` after the nodename in the pve tree and the > resource tree, when the node is in ha maintenance mode. > > I opted for showing the ha state here differently than in PVE, because > seeing the online/offline state separately from the hastate can make > sense (so there is no ambiguity if the node is online or offline). > > To do this we have to add the hastate to the `PveNodeResource` and wire > that through from the /cluster/resources call. > > We also have to update the pwt-assets submodule to get the necessary CSS > classes for the badge. > > This partially fixes #7371. > > Signed-off-by: Dominik Csapak > --- > lib/pdm-api-types/src/resource.rs | 26 ++++++++++++++++++++++++++ > server/src/api/resources.rs | 1 + > ui/pwt-assets | 2 +- > ui/src/pve/tree.rs | 11 +++++++++-- > ui/src/renderer.rs | 19 +++++++++++++++++-- > ui/src/widget/resource_tree.rs | 3 ++- > 6 files changed, 56 insertions(+), 6 deletions(-) > > diff --git a/lib/pdm-api-types/src/resource.rs b/lib/pdm-api-types/src/re= source.rs > index de2a93b4..29d70a3e 100644 > --- a/lib/pdm-api-types/src/resource.rs > +++ b/lib/pdm-api-types/src/resource.rs > @@ -477,6 +477,29 @@ pub struct PveLxcResource { > pub vmid: u32, > } > =20 > +#[api] > +#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] > +#[serde(rename_all =3D "kebab-case")] > +/// HA State of a PVE node. > +pub enum PveNodeHaState { > + /// The node is online and member of quorate partition > + Online, > + /// Node is a member of a quorate partition but in maintenance mode > + Maintenance, > + /// Not member of quorate partition, but possibly still running > + Unknown, > + /// Node needs to be fenced > + Fence, > + /// Node vanished from cluster member list > + Gone, > + /// Other (unknown) HA state > + #[serde(untagged)] > + Other(String), > +} > + > +serde_plain::derive_display_from_serialize!(PveNodeHaState); > +serde_plain::derive_fromstr_from_deserialize!(PveNodeHaState); > + > #[api] > #[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] > #[serde(rename_all =3D "kebab-case")] > @@ -502,6 +525,9 @@ pub struct PveNodeResource { > pub status: String, > /// Subscription level > pub level: String, > + /// HA State > + #[serde(default)] This should probably also have skip_serializing_if =3D "Option::is_none"