[pdm-devel] [PATCH datacenter-manager 4/5] ui: views: add message on empty layouts

Lukas Wagner l.wagner at proxmox.com
Thu Dec 4 16:18:49 CET 2025


On Thu Dec 4, 2025 at 3:20 PM CET, Dominik Csapak wrote:
> so users know better what to do.
>
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
>  ui/src/dashboard/view/row_view.rs | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/ui/src/dashboard/view/row_view.rs b/ui/src/dashboard/view/row_view.rs
> index e0b295c1..0571398c 100644
> --- a/ui/src/dashboard/view/row_view.rs
> +++ b/ui/src/dashboard/view/row_view.rs
> @@ -336,6 +336,19 @@ impl Component for RowViewComp {
>              .class("pwt-content-spacer-colors")
>              .class(css::FlexDirection::Row)
>              .class(css::FlexWrap::Wrap);
> +
> +        if layout.is_empty() && !self.edit_mode {
> +            let icon = "<i class=\"fa fa-pencil\"></i>";
> +            let message = tr!("Layout is empty, you can add widgets in edit mode. You can enable editing with the '{0}' icon.", icon);
> +            let message = Html::from_html_unchecked(message.into());
> +            row.add_child(
> +                Container::new()
> +                    .flex(1.0)
> +                    .padding(4)
> +                    .class(css::TextAlign::Center)
> +                    .with_child(message),
> +            );
> +        }
>          for (row_idx, items) in layout.iter().enumerate() {
>              let flex_sum: f32 = items
>                  .iter()


I wonder, should we also show this message if the layout only contains
*empty* rows? I accidentally had it in a state like this and was
confused why I didn't see the message, since in non-edit mode they look
the same. What do you think?

Also, how about:

"Layout is empty. Click the '{0} icon to to add widgets."

I think this would be a bit more straight-to-the-point - but no hard
feelings.




More information about the pdm-devel mailing list