public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [PATCH datacenter-manager] ui: auto-installer: parse empty string as 0 for new template counters
Date: Tue, 26 May 2026 16:45:31 +0200	[thread overview]
Message-ID: <20260526144538.3931349-1-d.csapak@proxmox.com> (raw)

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





             reply	other threads:[~2026-05-26 14:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 14:45 Dominik Csapak [this message]
2026-05-26 14:53 ` [PATCH datacenter-manager] ui: auto-installer: parse empty string as 0 for new template counters Lukas Wagner
2026-05-26 15:01 ` applied: " 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=20260526144538.3931349-1-d.csapak@proxmox.com \
    --to=d.csapak@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 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