From d.csapak at proxmox.com Fri Jan 9 14:12:42 2026 From: d.csapak at proxmox.com (Dominik Csapak) Date: Fri, 9 Jan 2026 14:12:42 +0100 Subject: [yew-devel] [PATCH yew-comp] syslog: use new DateField for selecting the date Message-ID: <20260109131319.2631622-1-d.csapak@proxmox.com> The native browser date/datetime-local interface is rather bad on desktop, so using our own here is much better ux. We currently only have a 'date' field, so use a separate field for the time (browser native time input). In the future we can replace both again with a single date time selector when we implement one. Signed-off-by: Dominik Csapak --- Caution: If this is used somewhere, we have to bump the pwt-assets there to include the new datetime field styling. src/syslog.rs | 138 +++++++++++++++++++++++--------------------------- 1 file changed, 62 insertions(+), 76 deletions(-) diff --git a/src/syslog.rs b/src/syslog.rs index 5635c22..03926d1 100644 --- a/src/syslog.rs +++ b/src/syslog.rs @@ -1,6 +1,6 @@ use std::rc::Rc; -use pwt::widget::form::InputType; +use pwt::widget::form::{DateField, InputType, PlainDate}; use pwt::widget::{Button, Container, Row, SegmentedButton}; use yew::html::IntoPropValue; use yew::virtual_dom::{VComp, VNode}; @@ -46,40 +46,34 @@ impl Syslog { pub enum Msg { ChangeMode(bool), LoadingChange((usize, bool)), - Since(String), - Until(String), + SinceDate(Option), + SinceTime(String), + UntilDate(Option), + UntilTime(String), } pub struct ProxmoxSyslog { active: bool, - since: js_sys::Date, + since: PlainDate, + since_time: String, since_label_id: AttrValue, - until: js_sys::Date, + until: PlainDate, + until_time: String, until_label_id: AttrValue, pending: bool, } -fn date_to_input_value(date: &js_sys::Date) -> String { - if date.get_date() == 0 { - // invalid data (clear field creates this) - String::new() - } else { - format!( - "{:04}-{:02}-{:02}T{:02}:{:02}", - date.get_full_year(), - date.get_month() + 1, - date.get_date(), - date.get_hours(), - date.get_minutes(), - ) - } +fn date_time_to_epoch(date: &PlainDate, time: &str) -> Option { + let (hours, minutes) = time.split_once(':')?; + let d = date.to_date(); + d.set_hours(hours.parse().ok()?); + d.set_minutes(minutes.parse().ok()?); + let res = d.get_time() / 1000.0; + res.is_finite().then_some(res.round() as i64) } impl ProxmoxSyslog { fn create_toolbar(&self, ctx: &Context) -> Html { - let since = date_to_input_value(&self.since); - let until = date_to_input_value(&self.until); - Toolbar::new() .with_optional_child( self.pending.then_some( @@ -117,14 +111,23 @@ impl ProxmoxSyslog { ) .with_child( Container::new().with_child( - Field::new() + DateField::new() .label_id(self.since_label_id.clone()) - .input_type(InputType::DatetimeLocal) + .required(true) + .disabled(self.active) + .on_change(ctx.link().callback(Msg::SinceDate)) + .value(self.since.to_string()), + ), + ) + .with_child( + Container::new().with_child( + Field::new() + .input_type(InputType::Time) .required(true) // avoid clear button in firefox .disabled(self.active) .class("pwt-input-hide-clear-button") - .on_change(ctx.link().callback(Msg::Since)) - .value(since), + .on_change(ctx.link().callback(Msg::SinceTime)) + .value(self.since_time.to_string()), ), ) .with_child( @@ -135,15 +138,25 @@ impl ProxmoxSyslog { .class(self.active.then_some("pwt-label-disabled")) .with_child("Until:"), ) + .with_child( + Container::new().with_child( + DateField::new() + .label_id(self.until_label_id.clone()) + .required(true) // avoid clear button in firefox + .disabled(self.active) + .on_change(ctx.link().callback(Msg::UntilDate)) + .value(self.until.to_string()), + ), + ) .with_child( Container::new().with_child( Field::new() .label_id(self.until_label_id.clone()) - .input_type(InputType::DatetimeLocal) + .input_type(InputType::Time) .required(true) // avoid clear button in firefox .disabled(self.active) - .on_change(ctx.link().callback(Msg::Until)) - .value(until), + .on_change(ctx.link().callback(Msg::UntilTime)) + .value(self.until_time.to_string()), ), ) .border_bottom(true) @@ -159,26 +172,12 @@ impl ProxmoxSyslog { })) .into() } else { - let since = if self.since.get_date() == 0 { - // invalid data (clear field creates this) - get_default_since() - } else { - self.since.clone() - }; - - let until = if self.until.get_date() == 0 { - // invalid data (clear field creates this) - None - } else { - Some((self.until.get_time() / 1000.0) as i64) - }; - LogView::new(props.base_url.clone()) .padding(2) .class("pwt-flex-fill") .service(props.service.clone()) - .since((since.get_time() / 1000.0) as i64) - .until(until) + .since(date_time_to_epoch(&self.since, &self.since_time)) + .until(date_time_to_epoch(&self.until, &self.until_time)) .active(false) .on_pending_change(ctx.link().callback(Msg::LoadingChange)) .into() @@ -186,27 +185,6 @@ impl ProxmoxSyslog { } } -fn get_default_since() -> js_sys::Date { - let since = js_sys::Date::new_0(); - - since.set_hours(0); - since.set_minutes(0); - since.set_seconds(0); - since.set_milliseconds(0); - - since -} - -fn get_default_until() -> js_sys::Date { - let until = js_sys::Date::new_0(); - - until.set_hours(23); - until.set_minutes(59); - until.set_seconds(59); - until.set_milliseconds(999); - - until -} impl Component for ProxmoxSyslog { type Message = Msg; type Properties = Syslog; @@ -214,9 +192,11 @@ impl Component for ProxmoxSyslog { fn create(_ctx: &Context) -> Self { Self { active: true, - since: get_default_since(), + since: PlainDate::today(), + since_time: "00:00".to_string(), since_label_id: AttrValue::from(pwt::widget::get_unique_element_id()), - until: get_default_until(), + until: PlainDate::today(), + until_time: "23:59".to_string(), until_label_id: AttrValue::from(pwt::widget::get_unique_element_id()), pending: false, } @@ -224,16 +204,22 @@ impl Component for ProxmoxSyslog { fn update(&mut self, _ctx: &Context, msg: Self::Message) -> bool { match msg { - Msg::Since(datetime) => { - let since = js_sys::Date::parse(&datetime); - let since = js_sys::Date::new(&since.into()); - self.since = since; + Msg::SinceDate(Some(date)) => { + self.since = date; + true + } + Msg::SinceDate(None) => false, + Msg::SinceTime(time) => { + self.since_time = time; + true + } + Msg::UntilDate(Some(date)) => { + self.until = date; true } - Msg::Until(datetime) => { - let until = js_sys::Date::parse(&datetime); - let until = js_sys::Date::new(&until.into()); - self.until = until; + Msg::UntilDate(None) => false, + Msg::UntilTime(time) => { + self.until_time = time; true } Msg::LoadingChange((num, tail_view)) => { -- 2.47.3 From d.csapak at proxmox.com Mon Jan 12 13:09:01 2026 From: d.csapak at proxmox.com (Dominik Csapak) Date: Mon, 12 Jan 2026 13:09:01 +0100 Subject: [yew-devel] [PATCH yew-widget-toolkit 1/1] widget: tab panel: mark material tabs with css class for variants In-Reply-To: <20260112120907.1947324-1-d.csapak@proxmox.com> References: <20260112120907.1947324-1-d.csapak@proxmox.com> Message-ID: <20260112120907.1947324-2-d.csapak@proxmox.com> that way it's possible to give different css properties to primary and secondary style material tabs. Signed-off-by: Dominik Csapak --- src/widget/tab/tab_bar.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widget/tab/tab_bar.rs b/src/widget/tab/tab_bar.rs index 44fb9f3..6714746 100644 --- a/src/widget/tab/tab_bar.rs +++ b/src/widget/tab/tab_bar.rs @@ -487,13 +487,13 @@ impl Component for PwtTabBar { let rtl = self.rtl.unwrap_or(false); let (variant_class, indicator_class) = match ctx.props().style { - TabBarStyle::Pills => ("pwt-nav-pills", classes!()), + TabBarStyle::Pills => (classes!("pwt-nav-pills"), classes!()), TabBarStyle::MaterialPrimary => ( - "pwt-tab-material", + classes!("pwt-tab-material", "primary"), classes!("pwt-tab-active-indicator", "primary"), ), TabBarStyle::MaterialSecondary => ( - "pwt-tab-material", + classes!("pwt-tab-material", "secondary"), classes!("pwt-tab-active-indicator", "secondary"), ), }; -- 2.47.3 From d.csapak at proxmox.com Mon Jan 12 13:09:02 2026 From: d.csapak at proxmox.com (Dominik Csapak) Date: Mon, 12 Jan 2026 13:09:02 +0100 Subject: [yew-devel] [PATCH yew-widget-toolkit-assets 1/1] material: tab panel: fix secondary tab bar style In-Reply-To: <20260112120907.1947324-1-d.csapak@proxmox.com> References: <20260112120907.1947324-1-d.csapak@proxmox.com> Message-ID: <20260112120907.1947324-3-d.csapak@proxmox.com> secondary tabbars should align the icon in a row, not a column, and also the icon should use the same size as the text. Use the new 'primary' and 'secondary' classes on the tabbars to differentiate them. Signed-off-by: Dominik Csapak --- scss/material/_theme_post_material.scss | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/scss/material/_theme_post_material.scss b/scss/material/_theme_post_material.scss index 0f448cb..c88b055 100644 --- a/scss/material/_theme_post_material.scss +++ b/scss/material/_theme_post_material.scss @@ -35,15 +35,27 @@ ul.pwt-menubar { span { display: flex; - flex-direction: column; align-items: center; - gap: 0; + } + } + + &.primary { + .pwt-nav-link { + span { + gap: 0; + flex-direction: column; - &:before { - font-size: map-get($font-size, "headline-small"); + &:before { + font-size: map-get($font-size, "headline-small"); + } } } } + &.secondary { + span { + flex-direction: row; + } + } } /// `pwt-datatable-content tr` -- 2.47.3 From d.csapak at proxmox.com Mon Jan 12 13:09:00 2026 From: d.csapak at proxmox.com (Dominik Csapak) Date: Mon, 12 Jan 2026 13:09:00 +0100 Subject: [yew-devel] [PATCH yew-widget-toolkit/yew-widget-toolkit-assets 0/2] fix style for secondary material style tabs Message-ID: <20260112120907.1947324-1-d.csapak@proxmox.com> adds some classes to the tab bar to determine the style, and adds custom style for the secondary material tabs proxmox-yew-widget-toolkit: Dominik Csapak (1): widget: tab panel: mark material tabs with css class for variants src/widget/tab/tab_bar.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) proxmox-yew-widget-toolkit-assets: Dominik Csapak (1): material: tab panel: fix secondary tab bar style scss/material/_theme_post_material.scss | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) Summary over all repositories: 2 files changed, 19 insertions(+), 7 deletions(-) -- Generated by git-murpp 0.8.1 From l.wagner at proxmox.com Mon Jan 12 14:09:51 2026 From: l.wagner at proxmox.com (Lukas Wagner) Date: Mon, 12 Jan 2026 14:09:51 +0100 Subject: [yew-devel] [PATCH yew-widget-toolkit] improve keyboard navigation with fields in data tables In-Reply-To: <20251202155805.110540-1-d.csapak@proxmox.com> References: <20251202155805.110540-1-d.csapak@proxmox.com> Message-ID: On Tue Dec 2, 2025 at 4:57 PM CET, Dominik Csapak wrote: > when inside an input field in a data table, the intention was to focus > the next cell when pressing tab. This currently does not work correctly, > since 'cell_focus_next' tries to focus the next element next to the > already focused one, and that is not the cell itself but the field > inside. > > Instead of trying to fix that, simply let the browser handle the focus > handling. This has the advantage that in table with multiple fields > (like we have in the PDM node list for remotes) we directly focus the > next input field instead of the next cell (which would need another > press of 'tab' to focus the input field). > > The downside is that to focus the next cell (if it does not contain an > input), one has to "go out" of the field by pressing F2 and then > pressing tab. > > Since in a data table with fields it is often more useful to navigate > between those instead of the table cells, i opted for this solution. > > In addition, add a tabindex of '0' to the triggers, so they'll always be > able to be focused. > > Signed-off-by: Dominik Csapak > --- > src/widget/data_table/data_table.rs | 5 +---- > src/widget/trigger.rs | 2 +- > 2 files changed, 2 insertions(+), 5 deletions(-) > > diff --git a/src/widget/data_table/data_table.rs b/src/widget/data_table/data_table.rs > index 7805340..8a68e8c 100644 > --- a/src/widget/data_table/data_table.rs > +++ b/src/widget/data_table/data_table.rs > @@ -1220,10 +1220,7 @@ impl Component for PwtDataTable { > event.prevent_default(); > self.cell_focus_next(&record_key, true); > } > - "Tab" if inside_input => { > - event.prevent_default(); > - self.cell_focus_next(&record_key, !shift); > - } > + "Tab" if inside_input => {} > " " if !inside_input => { > // avoid scrollbar default action > event.prevent_default(); > diff --git a/src/widget/trigger.rs b/src/widget/trigger.rs > index be8d8fb..a5d19cf 100644 > --- a/src/widget/trigger.rs > +++ b/src/widget/trigger.rs > @@ -68,7 +68,7 @@ impl Component for PwtTrigger { > None, > ); > > - Tooltip::new(icon).tip(props.tip).into() > + Tooltip::new(icon).tabindex(0).tip(props.tip).into() > } > } > Seems to work as expected: Tested-by: Lukas Wagner From dietmar at proxmox.com Mon Jan 12 16:26:27 2026 From: dietmar at proxmox.com (Dietmar Maurer) Date: Mon, 12 Jan 2026 15:26:27 +0000 Subject: [yew-devel] applied: [PATCH yew-widget-toolkit/yew-widget-toolkit-assets 0/2] fix style for secondary material style tabs In-Reply-To: <20260112120907.1947324-1-d.csapak@proxmox.com> References: <20260112120907.1947324-1-d.csapak@proxmox.com> Message-ID: applied -------------- next part -------------- An HTML attachment was scrubbed... URL: From dietmar at proxmox.com Fri Jan 16 10:01:02 2026 From: dietmar at proxmox.com (Dietmar Maurer) Date: Fri, 16 Jan 2026 09:01:02 +0000 Subject: [yew-devel] applied: [PATCH proxmox-yew-comp v2] fix: use IEC standared for showing the HD space In-Reply-To: <20251223103227.66777-1-s.shaji@proxmox.com> References: <20251223103227.66777-1-s.shaji@proxmox.com> Message-ID: applied -------------- next part -------------- An HTML attachment was scrubbed... URL: From dietmar at proxmox.com Fri Jan 16 10:02:17 2026 From: dietmar at proxmox.com (Dietmar Maurer) Date: Fri, 16 Jan 2026 09:02:17 +0000 Subject: [yew-devel] applied: [PATCH yew-comp] syslog: use new DateField for selecting the date In-Reply-To: <20260109131319.2631622-1-d.csapak@proxmox.com> References: <20260109131319.2631622-1-d.csapak@proxmox.com> Message-ID: applied -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.ebner at proxmox.com Fri Jan 16 11:07:56 2026 From: f.ebner at proxmox.com (Fiona Ebner) Date: Fri, 16 Jan 2026 11:07:56 +0100 Subject: [yew-devel] [pve-devel] [PATCH proxmox-yew-comp 1/1] fix #7141: set correct tz name for Kyiv In-Reply-To: <20251212100845.151116-1-m.sandoval@proxmox.com> References: <20251212100845.151116-1-m.sandoval@proxmox.com> Message-ID: CC-ing yew-devel, so this one doesn't get lost. I don't have push permissions for yew repos O:) Am 12.12.25 um 11:08 AM schrieb Maximiliano Sandoval: > See https://en.wikipedia.org/wiki/Time_in_Ukraine#IANA_time_zone_database. > > Signed-off-by: Maximiliano Sandoval > --- > src/time_zone_selector.rs | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/time_zone_selector.rs b/src/time_zone_selector.rs > index 1709761..757bcee 100644 > --- a/src/time_zone_selector.rs > +++ b/src/time_zone_selector.rs > @@ -395,7 +395,7 @@ static TIMEZONES: &[&str] = &[ > "Europe/Istanbul", > "Europe/Jersey", > "Europe/Kaliningrad", > - "Europe/Kiev", > + "Europe/Kyiv", > "Europe/Lisbon", > "Europe/Ljubljana", > "Europe/London",