public inbox for pdm-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Christoph Heiss" <c.heiss@proxmox.com>
To: "Lukas Wagner" <l.wagner@proxmox.com>
Cc: Proxmox Datacenter Manager development discussion
	<pdm-devel@lists.proxmox.com>
Subject: Re: [pdm-devel] [PATCH datacenter-manager v2 13/14] ui: auto-installer: add prepared answer configuration panel
Date: Tue, 16 Dec 2025 15:28:26 +0100	[thread overview]
Message-ID: <DEZPN49Z4PXS.15L2E0CDWE0OP@proxmox.com> (raw)
In-Reply-To: <DETPELECLMGM.1TWRKAIUWYCZF@proxmox.com>

Thanks for the review!

(Trimming messages would be greatly appreciated btw, makes finding the
inline comments a lot easier!)

On Tue Dec 9, 2025 at 2:01 PM CET, Lukas Wagner wrote:
[..]
>> +pub async fn submit(
>> +    url: &str,
>> +    existing_id: Option<&str>,
>> +    mut config: serde_json::Value,
>> +) -> Result<()> {
>> +    let obj = config.as_object_mut().expect("always an object");
>> +
>> +    let fs_opts = collect_fs_options_into_propstring(obj);
>> +    obj.insert("filesystem-options".to_owned(), json!(fs_opts));
>> +
>> +    let root_ssh_keys = collect_lines_into_array(obj.remove("root-ssh-keys"));
>> +    let target_filter = collect_lines_into_array(obj.remove("target-filter"));
>> +    let disk_filter = collect_lines_into_array(obj.remove("disk-filter-text"));
>> +    let netdev_filter = collect_lines_into_array(obj.remove("netdev-filter-text"));
>> +
>> +    config["root-ssh-keys"] = root_ssh_keys;
>> +    config["target-filter"] = target_filter;
>> +    config["disk-filter"] = disk_filter;
>> +    config["netdev-filter"] = netdev_filter;
>> +
>> +    if let Some(id) = existing_id {
>> +        config["id"] = json!(id);
>> +        let data = delete_empty_values(
>> +            &config,
>> +            &[
>> +                "root-ssh-keys",
>> +                "post-hook-base-url",
>> +                "post-hook-cert-fp",
>> +                "disk-filter",
>> +                "netdev-filter",
>> +            ],
>> +            true,
>> +        );
>> +        proxmox_yew_comp::http_put(url, Some(data)).await
>> +    } else {
>> +        proxmox_yew_comp::http_post(url, Some(config)).await
>> +    }
>> +}
>
> In general, I think it would be better to add bindings for these new
> APIs in the pdm_client crate and then use the actual PDM client here, as
> we do in most other places in the GUI.

Should the PdmClient method then just receive as `serde_json::Value` as
we already have here? Doing an entire round-trip through serde just for
having type-safety (although nice, of course) at this bit seems rather a
bit excessive.

[..]
>> +        .with_field(
>> +            tr!("PDM API base URL"),
>> +            Field::new()
>> +                .name("post-hook-base-url")
>> +                .tip(tr!(
>> +                    "Base URL this PDM instance is reachable from the target host"
>> +                ))
>> +                .value(
>> +                    config
>> +                        .post_hook_base_url
>> +                        .clone()
>> +                        .or_else(|| pdm_origin().map(|s| format!("{s}/api2"))),
>
> I think this is lacking a `/json` at the end - anyways, the /api2/json
> part could probably be added automatically, right? So that the user just
> needs to provide the base URL? (e.g. https://somehost:8443)

Yeah, probably. TBH I wasn't if we want to support different
base-/sub-paths for the API, but guess that's rather out-of-scope then.

>> diff --git a/ui/src/auto_installer/edit_window.rs b/ui/src/auto_installer/edit_window.rs
>> new file mode 100644
>> index 0000000..7054eea
>> --- /dev/null
>> +++ b/ui/src/auto_installer/edit_window.rs
>> @@ -0,0 +1,105 @@
>> +//! Implements the configuration dialog UI for the auto-installer integration.
>> +
[..]
>> +pub struct EditAnswerWindowComponent {}
>
> This also could be private, I think.

Ack, some for all the other instances.

[..]
>> +async fn delete_entry(key: Key) -> Result<()> {
>> +    let url = format!(
>> +        "/auto-install/prepared/{}",
>> +        percent_encode_component(&key.to_string())
>> +    );
>> +    proxmox_yew_comp::http_delete(&url, None).await
>> +}
>
> Here as well, I think it would be nicer to implement this in the
> pdm_client crate.

Will do.


_______________________________________________
pdm-devel mailing list
pdm-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pdm-devel


  reply	other threads:[~2025-12-16 14:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-05 11:25 [pdm-devel] [PATCH proxmox/datacenter-manager v2 00/14] initial auto-installer integration Christoph Heiss
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 01/14] api-macro: allow $ in identifier name Christoph Heiss
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 02/14] network-types: move `Fqdn` type from proxmox-installer-common Christoph Heiss
2025-12-09  9:13   ` Lukas Wagner
2025-12-09 12:26     ` Christoph Heiss
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 03/14] network-types: implement api type for Fqdn Christoph Heiss
2025-12-09  9:13   ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 04/14] network-types: add api wrapper type for std::net::IpAddr Christoph Heiss
2025-12-09  9:16   ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 05/14] installer-types: add common types used by the installer Christoph Heiss
2025-12-09  9:35   ` Lukas Wagner
2025-12-09 12:17     ` Christoph Heiss
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 06/14] installer-types: add types used by the auto-installer Christoph Heiss
2025-12-09  9:44   ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH proxmox v2 07/14] installer-types: implement api type for all externally-used types Christoph Heiss
2025-12-09  9:52   ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 08/14] api-types: add api types for auto-installer integration Christoph Heiss
2025-12-09 10:03   ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 09/14] config: add auto-installer configuration module Christoph Heiss
2025-12-09 10:22   ` Lukas Wagner
2025-12-09 12:10     ` Christoph Heiss
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 10/14] acl: wire up new /system/auto-installation acl path Christoph Heiss
2025-12-09 10:23   ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 11/14] server: api: add auto-installer integration module Christoph Heiss
2025-12-09 11:01   ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 12/14] ui: auto-installer: add installations overview panel Christoph Heiss
2025-12-09 12:35   ` Lukas Wagner
2025-12-16 13:55     ` Christoph Heiss
2025-12-17  9:09       ` Lukas Wagner
2025-12-17  9:42         ` Thomas Lamprecht
2025-12-17 14:00           ` Christoph Heiss
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 13/14] ui: auto-installer: add prepared answer configuration panel Christoph Heiss
2025-12-09 13:01   ` Lukas Wagner
2025-12-16 14:28     ` Christoph Heiss [this message]
2025-12-16 14:57       ` Lukas Wagner
2025-12-05 11:25 ` [pdm-devel] [PATCH datacenter-manager v2 14/14] docs: add documentation for auto-installer integration Christoph Heiss
2025-12-09 13:12   ` Lukas Wagner
2025-12-05 11:53 ` [pdm-devel] [PATCH proxmox/datacenter-manager v2 00/14] initial " Thomas Lamprecht
2025-12-05 15:50   ` Christoph Heiss
2025-12-05 15:57     ` Thomas Lamprecht
2025-12-09 13:38 ` Lukas Wagner

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=DEZPN49Z4PXS.15L2E0CDWE0OP@proxmox.com \
    --to=c.heiss@proxmox.com \
    --cc=l.wagner@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