public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Lukas Wagner" <l.wagner@proxmox.com>
To: "Shan Shaji" <s.shaji@proxmox.com>, <pdm-devel@lists.proxmox.com>
Subject: Re: [PATCH datacenter-manager] ui: token_panel: show date and time correctly in token edit window
Date: Wed, 27 May 2026 14:54:18 +0200	[thread overview]
Message-ID: <DITH3AT9P8RN.1TSUAL3KKPEHK@proxmox.com> (raw)
In-Reply-To: <20260527122639.319204-1-s.shaji@proxmox.com>

On Wed May 27, 2026 at 2:26 PM CEST, Shan Shaji wrote:
> Fix an issue where the currently selected token expiry date was not
> displayed in the token edit window.
>
> This occurred because `epoch_to_rfc3339` returns a string containing
> timezone information, which is unsupported by the HTML `datetime-local`
> input element. As a result, the element failed to parse and show the
> current value.
>
> Fix this by using our custom utility function from `proxmox_yew_comp`,
> which correctly formats the string as `YYYY-MM-DDTHH:mm` (without the
> timezone offset).
>
> Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
> ---
>  ui/src/remotes/auto_installer/token_panel.rs | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/ui/src/remotes/auto_installer/token_panel.rs b/ui/src/remotes/auto_installer/token_panel.rs
> index d213f39b..ebacc18c 100644
> --- a/ui/src/remotes/auto_installer/token_panel.rs
> +++ b/ui/src/remotes/auto_installer/token_panel.rs
> @@ -328,11 +328,15 @@ fn edit_input_panel(token: &AnswerToken) -> Html {
>              tr!("Expire"),
>              Field::new()
>                  .name("expire-at")
> -                .value(
> -                    token
> -                        .expire_at
> -                        .and_then(|exp| proxmox_time::epoch_to_rfc3339(exp).ok()),
> -                )
> +                .value(token.expire_at.and_then(|exp| {
> +                    let expiry_at = if exp == 0 {
> +                        String::new()
> +                    } else {
> +                        proxmox_yew_comp::utils::epoch_to_input_value(exp)
> +                    };
> +
> +                    Some(expiry_at)
> +                }))
>                  .placeholder(tr!("never"))
>                  .input_type(InputType::DatetimeLocal),
>          )

Was about to try to fix the same issue, but you were quicker :)

Can confirm that this fixes the issue:

Tested-by: Lukas Wagner <l.wagner@proxmox.com>




  reply	other threads:[~2026-05-27 12:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27 12:26 [PATCH datacenter-manager] ui: token_panel: show date and time correctly in token edit window Shan Shaji
2026-05-27 12:54 ` Lukas Wagner [this message]
2026-05-27 14:02 ` 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=DITH3AT9P8RN.1TSUAL3KKPEHK@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=pdm-devel@lists.proxmox.com \
    --cc=s.shaji@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