public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [PATCH datacenter-manager] ui: auto-installer: parse empty string as 0 for new template counters
@ 2026-05-26 14:45 Dominik Csapak
  2026-05-26 14:53 ` Lukas Wagner
  2026-05-26 15:01 ` applied: " Thomas Lamprecht
  0 siblings, 2 replies; 3+ messages in thread
From: Dominik Csapak @ 2026-05-26 14:45 UTC (permalink / raw)
  To: pdm-devel

otherwise adding a new template counter will result in getting an error
message that "" is not a valid value even though 0 is entered.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 ui/src/remotes/auto_installer/prepared_answer_form.rs | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ui/src/remotes/auto_installer/prepared_answer_form.rs b/ui/src/remotes/auto_installer/prepared_answer_form.rs
index 255f36dd..431a713d 100644
--- a/ui/src/remotes/auto_installer/prepared_answer_form.rs
+++ b/ui/src/remotes/auto_installer/prepared_answer_form.rs
@@ -1075,6 +1075,7 @@ fn kv_list_to_template_counter_map_validate(v: &Vec<(String, Value)>) -> Result<
         if TEMPLATE_COUNTER_NAME_REGEX.is_match(k) {
             let value = match v {
                 Value::Number(number) => number.as_i64(),
+                Value::String(text) if text == "" => Some(0),
                 Value::String(text) => text.parse().ok(),
                 _ => None,
             };
-- 
2.47.3





^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-05-26 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-26 14:45 [PATCH datacenter-manager] ui: auto-installer: parse empty string as 0 for new template counters Dominik Csapak
2026-05-26 14:53 ` Lukas Wagner
2026-05-26 15:01 ` applied: " Thomas Lamprecht

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