From 28848e0c52df2c93c73f677ae93c282162e415b8 Mon Sep 17 00:00:00 2001 From: lukedzwoniarek Date: Sat, 22 Aug 2026 20:37:14 +0000 Subject: [PATCH] feat: add advanced settings app hook --- docs/ui.md | 7 +++++++ ui/advanced.func | 15 +++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/docs/ui.md b/docs/ui.md index 5b41ffb..bbf01ee 100644 --- a/docs/ui.md +++ b/docs/ui.md @@ -36,6 +36,13 @@ saved default no longer matches what the script wants. `advanced_settings` — one function, the full interactive configuration path. +Application scripts may optionally define `advanced_settings_app_configure` and +`advanced_settings_app_summary`. The first runs before the confirmation dialog +in the Advanced wizard; the second returns a text block appended to that +dialog. This keeps application-specific settings in the script without +replacing or parsing the shared wizard. Both callbacks are optional and are +never called by default or silent installs. + ## [`menu.func`](../ui/menu.func) The entry points and the menus: diff --git a/ui/advanced.func b/ui/advanced.func index a2d8faf..e090ae9 100644 --- a/ui/advanced.func +++ b/ui/advanced.func @@ -1097,6 +1097,13 @@ Leave empty to skip." else _verbose="no" fi + + # Applications may add their own advanced settings without replacing this + # wizard. The optional callbacks are defined by the application script. + if declare -f advanced_settings_app_configure >/dev/null 2>&1; then + advanced_settings_app_configure + fi + # Build summary local ct_type_desc="Unprivileged" [[ "$_ct_type" == "0" ]] && ct_type_desc="Privileged" @@ -1150,6 +1157,14 @@ Advanced: Verbose: $_verbose Post-Install Script: ${post_install_display}${post_install_warn}" + if declare -f advanced_settings_app_summary >/dev/null 2>&1; then + local app_summary + app_summary="$(advanced_settings_app_summary)" + [[ -n "$app_summary" ]] && summary="${summary} + +${app_summary}" + fi + if whiptail --backtitle "Proxmox VE Helper Scripts [Step $STEP/$MAX_STEP]" \ --title "CONFIRM SETTINGS" \ --ok-button "Create LXC" --cancel-button "Back" \