From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 55A1E1FF165 for ; Thu, 23 Oct 2025 13:44:30 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 8F96D8B4F; Thu, 23 Oct 2025 13:44:57 +0200 (CEST) Message-ID: Date: Thu, 23 Oct 2025 13:44:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta To: Shannon Sterz References: <20251023083253.1038119-1-d.csapak@proxmox.com> <20251023083253.1038119-16-d.csapak@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1761219885827 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.029 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pdm-devel] [RFC PATCH datacenter-manager v2 15/16] ui: dashboard: implement 'View' X-BeenThere: pdm-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Datacenter Manager development discussion Cc: Proxmox Datacenter Manager development discussion Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: pdm-devel-bounces@lists.proxmox.com Sender: "pdm-devel" On 10/23/25 1:19 PM, Shannon Sterz wrote: > On Thu Oct 23, 2025 at 10:28 AM CEST, Dominik Csapak wrote: [snip] >> + >> +struct ViewComp { >> + template: LoadResult, >> + >> + // various api call results >> + status: LoadResult, >> + top_entities: LoadResult, >> + statistics: LoadResult, > > this is fine, but i just had an idea, maybe this isn't too useful right > now, but might be worth exploring: we could turn this into a HashMap > with something like this: > > HashMap> > > then loading could become iterating over the keys and calling a function > on them. with a wrapper type we could even implement a getter that > transforms the ApiResponseData to a concrete type. might cut down on the > loading logic below and make this more easily extensible in the future. > > the required_api_calls below could then just return such a hashmap with > only the necessary keys. what do you think (note i haven't tested any of > this)? i don't think this will work, since ApiResponseData itself takes a generic parameter too, and we can't use different ones for different values of the same hashmap AFAIK but yeah, we should think about how we could generalize this instead of just adding on new members... [snip] >> + match self.template.data.as_ref().map(|template| &template.layout) { >> + Some(ViewLayout::Rows { rows }) => { >> + for items in rows { >> + let mut row = Row::new() >> + .gap(4) >> + .padding_top(0) >> + .class("pwt-content-spacer") > > since this is used here quite extensively, might make sense to also give > that a type in the `css` module, but that's unrelated to this series yes, i agree (we have quite some classes that would IMHO benefit from that) > >> + .class(css::FlexDirection::Row) > > just something i'm curious about, but is this necessary? shouldn't a > `Row` already be `FlexDirection::Row`? or more accurately, isn't it by > default? you're right, this seems to be a leftover from some older versions i had _______________________________________________ pdm-devel mailing list pdm-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel