From: Dominik Csapak <d.csapak@proxmox.com>
To: pdm-devel@lists.proxmox.com
Subject: [pdm-devel] [PATCH datacenter-manager 1/4] ui: dashboard: use builtin types and methods for styles
Date: Fri, 6 Jun 2025 09:27:17 +0200 [thread overview]
Message-ID: <20250606072720.664054-3-d.csapak@proxmox.com> (raw)
In-Reply-To: <20250606072720.664054-1-d.csapak@proxmox.com>
by using the rust types instead of a string for the classes, it's not
possible to mistype it, otherwise the compiler will error out.
Same with the styling of specifying e.g. padding. Just using the built-in
padding methods makes it impossible to mistype.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
ui/src/dashboard/mod.rs | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ui/src/dashboard/mod.rs b/ui/src/dashboard/mod.rs
index 23ff6b7..0832ced 100644
--- a/ui/src/dashboard/mod.rs
+++ b/ui/src/dashboard/mod.rs
@@ -9,7 +9,7 @@ use yew::{
use proxmox_yew_comp::{http_get, Status};
use pwt::{
- css::{AlignItems, FlexFit, FlexWrap, JustifyContent},
+ css::{AlignItems, FlexDirection, FlexFit, FlexWrap, JustifyContent},
prelude::*,
widget::{error_message, Button, Column, Container, Fa, Panel, Row},
AsyncPool,
@@ -243,7 +243,7 @@ impl Component for PdmDashboard {
.with_child(
Container::new()
.class("pwt-content-spacer")
- .class("pwt-flex-direction-row")
+ .class(FlexDirection::Row)
.class(FlexWrap::Wrap)
.with_child(
Panel::new()
@@ -336,10 +336,10 @@ impl Component for PdmDashboard {
.with_child(
Container::new()
.class("pwt-content-spacer")
- .class("pwt-flex-direction-row")
+ .class(FlexDirection::Row)
.class("pwt-align-content-start")
.class(pwt::css::Flex::Fill)
- .style("padding-top", "0")
+ .padding_top(0)
.class(FlexWrap::Wrap)
//.min_height(175)
.with_child(self.create_top_entities_panel(
--
2.39.5
_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel
next prev parent reply other threads:[~2025-06-06 7:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 7:27 [pdm-devel] [PATCH datacenter-manager/yew-widget-toolkit-assets 0/5] make dashboard refreshable Dominik Csapak
2025-06-06 7:27 ` [pdm-devel] [PATCH yew-widget-toolkit-assets 1/1] content-spacer: add helper class for color Dominik Csapak
2025-06-06 7:27 ` Dominik Csapak [this message]
2025-06-06 7:27 ` [pdm-devel] [PATCH datacenter-manager 2/4] ui: dashboard: introduce DashboardConfig Dominik Csapak
2025-06-06 7:27 ` [pdm-devel] [PATCH datacenter-manager 3/4] ui: dashboard: refactor loading logic Dominik Csapak
2025-06-06 7:27 ` [pdm-devel] [PATCH datacenter-manager 4/4] ui: dashboard: add status row and configuration window Dominik Csapak
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=20250606072720.664054-3-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