[pdm-devel] [PATCH datacenter-manager v3 08/18] ui: dashboard: prepare view for editing custom views
Dominik Csapak
d.csapak at proxmox.com
Mon Nov 24 11:32:39 CET 2025
On 11/17/25 3:58 PM, Shannon Sterz wrote:
> comments in-line.
>
> On Mon Nov 17, 2025 at 1:44 PM CET, Dominik Csapak wrote:
[snip]
>> }
>> None => {}
>> }
>> @@ -490,6 +517,7 @@ async fn load_template() -> Result<ViewTemplate, Error> {
>> \"leaderboard-type\": \"node-memory\"
>> }
>> ],
>> + [],
>
> this is removed again in the very next commit (it's masked a bit because
> of an indent change). is this intentional?
no, this slipped in at some point i guess, i'll remove it
>
>> [
>> {
>> \"flex\": 5.0,
>> diff --git a/ui/src/dashboard/view/row_element.rs b/ui/src/dashboard/view/row_element.rs
>> new file mode 100644
>> index 00000000..d242195c
>> --- /dev/null
>> +++ b/ui/src/dashboard/view/row_element.rs
>> @@ -0,0 +1,130 @@
>> +use yew::html::IntoEventCallback;
>> +
>> +use pwt::css;
>> +use pwt::prelude::*;
>> +use pwt::props::RenderFn;
>> +use pwt::widget::{ActionIcon, Card, Fa, Panel, Row};
>> +use pwt_macros::{builder, widget};
>> +
>> +use crate::dashboard::types::RowWidget;
>> +
>> +#[widget(comp=RowElementComp, @element)]
>> +#[derive(PartialEq, Properties, Clone)]
>> +#[builder]
>> +pub struct RowElement {
>> + item: RowWidget,
>> + widget_renderer: RenderFn<RowWidget>,
>> +
>> + #[builder]
>> + #[prop_or_default]
>> + edit_mode: bool,
>> +
>> + #[builder]
>> + #[prop_or_default]
>> + is_dragging: bool,
>> +
>> + #[builder_cb(IntoEventCallback, into_event_callback, ())]
>> + #[prop_or_default]
>> + on_remove: Option<Callback<()>>,
>> +
>> + #[builder_cb(IntoEventCallback, into_event_callback, u32)]
>> + #[prop_or_default]
>> + on_flex_change: Option<Callback<u32>>,
>> +}
>> +
>> +impl RowElement {
>> + pub fn new(item: RowWidget, widget_renderer: impl Into<RenderFn<RowWidget>>) -> Self {
>> + let widget_renderer = widget_renderer.into();
>> + yew::props!(Self {
>> + item,
>> + widget_renderer
>> + })
>> + }
>> +}
>> +
>> +pub enum Msg {
>
> is this `pub` intentionally?
yes, an associated type of a public trait must also be public, see e.g.
this example that does not compile:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=29cd3ee5b2d1d0ca090e1c394c03b40a
> [snip]
>> +pub enum Msg {
>> + DragEvent(DragMsg),
>> + AddRow,
>> + RemoveRow(usize), // idx
>> + EditFlex(Position, u32),
>> + AddWidget(Position, WidgetType),
>> + RemoveWidget(Position),
>> + MoveRow(usize, MoveDirection), // idx
>> + HandleEditMessages,
>> +}
>
> are these intentionally `pub`?
same here
More information about the pdm-devel
mailing list