* [pdm-devel] [PATCH yew-comp/datacenter-manager] improve rendering running tasks @ 2025-03-18 14:32 Dominik Csapak 2025-03-18 14:32 ` [pdm-devel] [PATCH yew-comp 1/2] tasks: don't mark running tasks from pve with 'error' color Dominik Csapak ` (2 more replies) 0 siblings, 3 replies; 8+ messages in thread From: Dominik Csapak @ 2025-03-18 14:32 UTC (permalink / raw) To: pdm-devel render a loading spinner for running tasks and don't mark them as an error anymore for PVE tasks. proxmox-yew-comp: Dominik Csapak (2): tasks: don't mark running tasks from pve with 'error' color tasks: add loading animation for running tasks src/tasks.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) proxmox-datacenter-manager: Dominik Csapak (1): ui: remote tasks: add loading animation for running tasks ui/src/remotes/tasks.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) -- 2.39.5 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* [pdm-devel] [PATCH yew-comp 1/2] tasks: don't mark running tasks from pve with 'error' color 2025-03-18 14:32 [pdm-devel] [PATCH yew-comp/datacenter-manager] improve rendering running tasks Dominik Csapak @ 2025-03-18 14:32 ` Dominik Csapak 2025-03-20 6:25 ` Dietmar Maurer 2025-03-18 14:32 ` [pdm-devel] [PATCH yew-comp 2/2] tasks: add loading animation for running tasks Dominik Csapak 2025-03-18 14:32 ` [pdm-devel] [PATCH datacenter-manager 1/1] ui: remote " Dominik Csapak 2 siblings, 1 reply; 8+ messages in thread From: Dominik Csapak @ 2025-03-18 14:32 UTC (permalink / raw) To: pdm-devel running tasks from the PVE tasks API have 'RUNNING' in their status field (in contrast to e.g. the PBS API) instead of nothing. To not mark them with an error color, we have to make an exception for this here. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> --- src/tasks.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tasks.rs b/src/tasks.rs index 1b65c8e..499f5b9 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -172,7 +172,7 @@ impl LoadableComponent for ProxmoxTasks { if status != "OK" { if status.starts_with("WARNINGS:") { args.add_class("pwt-color-warning"); - } else { + } else if status != "RUNNING" { args.add_class("pwt-color-error"); } } -- 2.39.5 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [pdm-devel] [PATCH yew-comp 1/2] tasks: don't mark running tasks from pve with 'error' color 2025-03-18 14:32 ` [pdm-devel] [PATCH yew-comp 1/2] tasks: don't mark running tasks from pve with 'error' color Dominik Csapak @ 2025-03-20 6:25 ` Dietmar Maurer 2025-03-20 8:10 ` Dominik Csapak 0 siblings, 1 reply; 8+ messages in thread From: Dietmar Maurer @ 2025-03-20 6:25 UTC (permalink / raw) To: Proxmox Datacenter Manager development discussion, Dominik Csapak > running tasks from the PVE tasks API have 'RUNNING' in their status > field (in contrast to e.g. the PBS API) instead of nothing. Instead of nothing? Would it be more clear to use: if !(status == "OK" /* PBS */ || status == "RUNNING" /* PVE */)) { } > To not mark > them with an error color, we have to make an exception for this here. > > Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> > --- > src/tasks.rs | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/tasks.rs b/src/tasks.rs > index 1b65c8e..499f5b9 100644 > --- a/src/tasks.rs > +++ b/src/tasks.rs > @@ -172,7 +172,7 @@ impl LoadableComponent for ProxmoxTasks { > if status != "OK" { > if status.starts_with("WARNINGS:") { > args.add_class("pwt-color-warning"); > - } else { > + } else if status != "RUNNING" { > args.add_class("pwt-color-error"); > } > } > -- > 2.39.5 > > > > _______________________________________________ > pdm-devel mailing list > pdm-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [pdm-devel] [PATCH yew-comp 1/2] tasks: don't mark running tasks from pve with 'error' color 2025-03-20 6:25 ` Dietmar Maurer @ 2025-03-20 8:10 ` Dominik Csapak 2025-03-20 9:03 ` [pdm-devel] applied: " Dietmar Maurer 0 siblings, 1 reply; 8+ messages in thread From: Dominik Csapak @ 2025-03-20 8:10 UTC (permalink / raw) To: Dietmar Maurer, Proxmox Datacenter Manager development discussion On 3/20/25 07:25, Dietmar Maurer wrote: >> running tasks from the PVE tasks API have 'RUNNING' in their status >> field (in contrast to e.g. the PBS API) instead of nothing. > > Instead of nothing? > > Would it be more clear to use: > > if !(status == "OK" /* PBS */ || status == "RUNNING" /* PVE */)) { > > } yeah looks fine to me too alternatively we could maybe do (untested): match status { "RUNNING" | "OK" => {}, status if status.starts_with("WARNINGS:") => { .. warning .. } _ => { .. error .. } } > >> To not mark >> them with an error color, we have to make an exception for this here. >> >> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> >> --- >> src/tasks.rs | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/src/tasks.rs b/src/tasks.rs >> index 1b65c8e..499f5b9 100644 >> --- a/src/tasks.rs >> +++ b/src/tasks.rs >> @@ -172,7 +172,7 @@ impl LoadableComponent for ProxmoxTasks { >> if status != "OK" { >> if status.starts_with("WARNINGS:") { >> args.add_class("pwt-color-warning"); >> - } else { >> + } else if status != "RUNNING" { >> args.add_class("pwt-color-error"); >> } >> } >> -- >> 2.39.5 >> >> >> >> _______________________________________________ >> pdm-devel mailing list >> pdm-devel@lists.proxmox.com >> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* [pdm-devel] applied: [PATCH yew-comp 1/2] tasks: don't mark running tasks from pve with 'error' color 2025-03-20 8:10 ` Dominik Csapak @ 2025-03-20 9:03 ` Dietmar Maurer 0 siblings, 0 replies; 8+ messages in thread From: Dietmar Maurer @ 2025-03-20 9:03 UTC (permalink / raw) To: Dominik Csapak, Proxmox Datacenter Manager development discussion applied with minor changes > yeah looks fine to me too > > alternatively we could maybe do (untested): > > match status { > "RUNNING" | "OK" => {}, > status if status.starts_with("WARNINGS:") => { .. warning .. } > _ => { .. error .. } > } changed this to: match record.status.as_deref() { Some("RUNNING" | "OK") | None => {} Some(status) if status.starts_with("WARNINGS:") => { args.add_class("pwt-color-warning") } _ => args.add_class("pwt-color-error"), } _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* [pdm-devel] [PATCH yew-comp 2/2] tasks: add loading animation for running tasks 2025-03-18 14:32 [pdm-devel] [PATCH yew-comp/datacenter-manager] improve rendering running tasks Dominik Csapak 2025-03-18 14:32 ` [pdm-devel] [PATCH yew-comp 1/2] tasks: don't mark running tasks from pve with 'error' color Dominik Csapak @ 2025-03-18 14:32 ` Dominik Csapak 2025-03-20 9:08 ` Dietmar Maurer 2025-03-18 14:32 ` [pdm-devel] [PATCH datacenter-manager 1/1] ui: remote " Dominik Csapak 2 siblings, 1 reply; 8+ messages in thread From: Dominik Csapak @ 2025-03-18 14:32 UTC (permalink / raw) To: pdm-devel when there is no endtime and the status is either empty or "RUNNING" (for PVE), render a spinning loading icon, like we do in the ExtJS UI. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> --- src/tasks.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/tasks.rs b/src/tasks.rs index 499f5b9..1d3b0bf 100644 --- a/src/tasks.rs +++ b/src/tasks.rs @@ -17,7 +17,7 @@ use pwt::state::{PersistentState, Selection, Store}; use pwt::widget::data_table::{ DataTable, DataTableColumn, DataTableHeader, DataTableRowRenderCallback, }; -use pwt::widget::{Button, Column, Toolbar}; +use pwt::widget::{Button, Column, Fa, Row, Toolbar}; use crate::utils::{format_upid, render_epoch_short}; @@ -122,7 +122,11 @@ impl ProxmoxTasks { .width("130px") .render(|item: &TaskListItem| match item.endtime { Some(endtime) => render_epoch_short(endtime).into(), - None => html! {}, + None => Row::new() + .with_flex_spacer() + .with_child(Fa::new("").class("pwt-loading-icon")) + .with_flex_spacer() + .into(), }) .into(), DataTableColumn::new(tr!("User name")) @@ -139,7 +143,14 @@ impl ProxmoxTasks { .width("200px") .render(|item: &TaskListItem| { let text = item.status.as_deref().unwrap_or(""); - html! {text} + match text { + "" | "RUNNING" => Row::new() + .with_flex_spacer() + .with_child(Fa::new("").class("pwt-loading-icon")) + .with_flex_spacer() + .into(), + text => html! {text}, + } }) .into(), ]) -- 2.39.5 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [pdm-devel] [PATCH yew-comp 2/2] tasks: add loading animation for running tasks 2025-03-18 14:32 ` [pdm-devel] [PATCH yew-comp 2/2] tasks: add loading animation for running tasks Dominik Csapak @ 2025-03-20 9:08 ` Dietmar Maurer 0 siblings, 0 replies; 8+ messages in thread From: Dietmar Maurer @ 2025-03-20 9:08 UTC (permalink / raw) To: Proxmox Datacenter Manager development discussion, Dominik Csapak comments inline > On 18.3.2025 15:32 CET Dominik Csapak <d.csapak@proxmox.com> wrote: > > > when there is no endtime and the status is either empty or "RUNNING" > (for PVE), render a spinning loading icon, like we do in the ExtJS UI. > > Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> > --- > src/tasks.rs | 17 ++++++++++++++--- > 1 file changed, 14 insertions(+), 3 deletions(-) > > diff --git a/src/tasks.rs b/src/tasks.rs > index 499f5b9..1d3b0bf 100644 > --- a/src/tasks.rs > +++ b/src/tasks.rs > @@ -17,7 +17,7 @@ use pwt::state::{PersistentState, Selection, Store}; > use pwt::widget::data_table::{ > DataTable, DataTableColumn, DataTableHeader, DataTableRowRenderCallback, > }; > -use pwt::widget::{Button, Column, Toolbar}; > +use pwt::widget::{Button, Column, Fa, Row, Toolbar}; > > use crate::utils::{format_upid, render_epoch_short}; > > @@ -122,7 +122,11 @@ impl ProxmoxTasks { > .width("130px") > .render(|item: &TaskListItem| match item.endtime { > Some(endtime) => render_epoch_short(endtime).into(), > - None => html! {}, > + None => Row::new() > + .with_flex_spacer() > + .with_child(Fa::new("").class("pwt-loading-icon")) > + .with_flex_spacer() > + .into(), Don't we have a simpler way to center things? RTow is a flex layout, so you can easily center children. > }) > .into(), > DataTableColumn::new(tr!("User name")) > @@ -139,7 +143,14 @@ impl ProxmoxTasks { > .width("200px") > .render(|item: &TaskListItem| { > let text = item.status.as_deref().unwrap_or(""); > - html! {text} > + match text { > + "" | "RUNNING" => Row::new() > + .with_flex_spacer() > + .with_child(Fa::new("").class("pwt-loading-icon")) > + .with_flex_spacer() > + .into(), > + text => html! {text}, > + } match should be one level above... _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* [pdm-devel] [PATCH datacenter-manager 1/1] ui: remote tasks: add loading animation for running tasks 2025-03-18 14:32 [pdm-devel] [PATCH yew-comp/datacenter-manager] improve rendering running tasks Dominik Csapak 2025-03-18 14:32 ` [pdm-devel] [PATCH yew-comp 1/2] tasks: don't mark running tasks from pve with 'error' color Dominik Csapak 2025-03-18 14:32 ` [pdm-devel] [PATCH yew-comp 2/2] tasks: add loading animation for running tasks Dominik Csapak @ 2025-03-18 14:32 ` Dominik Csapak 2 siblings, 0 replies; 8+ messages in thread From: Dominik Csapak @ 2025-03-18 14:32 UTC (permalink / raw) To: pdm-devel when there is no endtime and the status is either empty or "RUNNING" (for PVE), render a spinning loading icon, like we do in the ExtJS UI. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> --- ui/src/remotes/tasks.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ui/src/remotes/tasks.rs b/ui/src/remotes/tasks.rs index 99bb243..ef9a8bf 100644 --- a/ui/src/remotes/tasks.rs +++ b/ui/src/remotes/tasks.rs @@ -20,7 +20,7 @@ use pwt::{ tr, widget::{ data_table::{DataTableColumn, DataTableHeader}, - Column, + Column, Fa, Row, }, }; @@ -47,7 +47,11 @@ fn columns() -> Rc<Vec<DataTableHeader<TaskListItem>>> { .width("130px") .render(|item: &TaskListItem| match item.endtime { Some(endtime) => render_epoch_short(endtime).into(), - None => html! {}, + None => Row::new() + .with_flex_spacer() + .with_child(Fa::new("").class("pwt-loading-icon")) + .with_flex_spacer() + .into(), }) .into(), DataTableColumn::new(tr!("User name")) @@ -91,7 +95,14 @@ fn columns() -> Rc<Vec<DataTableHeader<TaskListItem>>> { .width("minmax(200px, 1fr)") .render(|item: &TaskListItem| { let text = item.status.as_deref().unwrap_or(""); - html! {text} + match text { + "" | "RUNNING" => Row::new() + .with_flex_spacer() + .with_child(Fa::new("").class("pwt-loading-icon")) + .with_flex_spacer() + .into(), + text => html! {text}, + } }) .into(), ]) -- 2.39.5 _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-03-20 9:08 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2025-03-18 14:32 [pdm-devel] [PATCH yew-comp/datacenter-manager] improve rendering running tasks Dominik Csapak 2025-03-18 14:32 ` [pdm-devel] [PATCH yew-comp 1/2] tasks: don't mark running tasks from pve with 'error' color Dominik Csapak 2025-03-20 6:25 ` Dietmar Maurer 2025-03-20 8:10 ` Dominik Csapak 2025-03-20 9:03 ` [pdm-devel] applied: " Dietmar Maurer 2025-03-18 14:32 ` [pdm-devel] [PATCH yew-comp 2/2] tasks: add loading animation for running tasks Dominik Csapak 2025-03-20 9:08 ` Dietmar Maurer 2025-03-18 14:32 ` [pdm-devel] [PATCH datacenter-manager 1/1] ui: remote " Dominik Csapak
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inboxService provided by Proxmox Server Solutions GmbH | Privacy | Legal