Update 1.2.2.2 bate

This commit is contained in:
MacRimi
2026-06-13 11:03:48 +02:00
parent d9fee64c35
commit d66dc07ae1
5 changed files with 494 additions and 363 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -667,13 +667,6 @@ _rs_extract_pbs() {
# form (`YYYY-MM-DDTHH:MM:SSZ`) that `snapshot files` and
# `restore` actually accept as the snapshot path.
#
# Use dialog --infobox (not msg_info/msg_ok) so the "Listing…"
# placeholder lives inside the dialog system and disappears the
# moment the next dialog draws — no terminal text leaks between
# menus.
dialog --backtitle "ProxMenux" \
--title "$(translate "Listing snapshots from PBS")" \
--infobox "\n$(translate "Querying repository:") $HB_PBS_REPOSITORY" 7 78
mapfile -t snapshots < <(
PBS_PASSWORD="$HB_PBS_SECRET" \
PBS_FINGERPRINT="${HB_PBS_FINGERPRINT:-}" \
@@ -2450,7 +2443,6 @@ restore_menu() {
# ==========================================================
main_menu() {
while true; do
show_proxmenux_logo
local choice
choice=$(dialog --backtitle "ProxMenux" \
--title "$(translate "Host Config Backup / Restore")" \

View File

@@ -254,6 +254,32 @@ format_menu_item() {
echo "${description}${spacing}${source}"
}
post_install_label() {
case "$1" in
"Automated post-installation script")
translate "Automated post-installation script"
;;
"Customizable post-installation script")
translate "Customizable post-installation script"
;;
"Uninstall optimizations")
translate "Uninstall optimizations"
;;
"Proxmox VE Post Install")
echo "Proxmox VE Post Install"
;;
"Proxmox VE Microcode")
echo "Proxmox VE Microcode"
;;
"Community Scripts")
translate "Community Scripts"
;;
*)
translate "$1"
;;
esac
}
# ==========================================================
show_menu() {
while true; do
@@ -276,10 +302,8 @@ show_menu() {
# above "Uninstall optimizations" so it sits next to the
# related rollback action and not buried in the middle.
if [[ "$name" == "Uninstall optimizations" && "$update_count" -gt 0 ]]; then
local update_label
update_label="Apply available updates ($update_count)"
local translated_update
translated_update="$(translate "$update_label")"
translated_update="$(translate "Apply available updates") ($update_count)"
local formatted_update
formatted_update=$(format_menu_item "$translated_update" "ProxMenux")
menu_items+=("$counter" "$formatted_update")
@@ -287,7 +311,8 @@ show_menu() {
((counter++))
fi
local translated_name="$(translate "$name")"
local translated_name
translated_name="$(post_install_label "$name")"
local formatted_item
formatted_item=$(format_menu_item "$translated_name" "$source")
menu_items+=("$counter" "$formatted_item")
@@ -297,13 +322,14 @@ show_menu() {
menu_items+=("" "")
menu_items+=("-" "───────────────────── Community Scripts ──────────────────────")
menu_items+=("-" "───────────────────── $(post_install_label "Community Scripts") ──────────────────────")
menu_items+=("" "")
for script in "${COMMUNITY_SCRIPTS[@]}"; do
IFS='|' read -r name source command <<< "$script"
local translated_name="$(translate "$name")"
local translated_name
translated_name="$(post_install_label "$name")"
local formatted_item
formatted_item=$(format_menu_item "$translated_name" "$source")
menu_items+=("$counter" "$formatted_item")

View File

@@ -1184,6 +1184,56 @@ format_menu_item() {
echo "${description}${spacing}${source}"
}
network_menu_label() {
case "$1" in
"Real-time network usage (iftop)")
translate "Real-time network usage (iftop)"
;;
"Network monitoring tool (iptraf-ng)")
translate "Network monitoring tool (iptraf-ng)"
;;
"Bandwidth test (iperf3)")
translate "Bandwidth test (iperf3)"
;;
"Show Routing Table")
translate "Show Routing Table"
;;
"Test Connectivity")
translate "Test Connectivity"
;;
"Advanced Diagnostics")
translate "Advanced Diagnostics"
;;
"Analyze Bridge Configuration")
translate "Analyze Bridge Configuration"
;;
"Analyze Network Configuration")
translate "Analyze Network Configuration"
;;
"Setup Persistent Network Names")
translate "Setup Persistent Network Names"
;;
"Restart Network Service")
translate "Restart Network Service"
;;
"Show Network Config File")
translate "Show Network Config File"
;;
"Create Network Backup")
translate "Create Network Backup"
;;
"Restore Network Backup")
translate "Restore Network Backup"
;;
"Disable NIC Offloading (Intel e1000e)")
translate "Disable NIC Offloading (Intel e1000e)"
;;
*)
translate "$1"
;;
esac
}
# ==========================================================
show_menu() {
while true; do
@@ -1195,7 +1245,8 @@ show_menu() {
for script in "${PROXMENUX_SCRIPTS[@]}"; do
IFS='|' read -r name source command <<< "$script"
local translated_name="$(translate "$name")"
local translated_name
translated_name="$(network_menu_label "$name")"
local formatted_item
formatted_item=$(format_menu_item "$translated_name" "$source")
menu_items+=("$counter" "$formatted_item")
@@ -1211,7 +1262,8 @@ show_menu() {
for script in "${COMMUNITY_SCRIPTS[@]}"; do
IFS='|' read -r name source command <<< "$script"
local translated_name="$(translate "$name")"
local translated_name
translated_name="$(network_menu_label "$name")"
local formatted_item
formatted_item=$(format_menu_item "$translated_name" "$source")
menu_items+=("$counter" "$formatted_item")

View File

@@ -2910,8 +2910,127 @@ install_system_utils() {
custom_post_category_label() {
case "$1" in
"Basic Settings") translate "Basic Settings" ;;
"System") translate "System" ;;
"Hardware") translate "Hardware" ;;
"Virtualization") translate "Virtualization" ;;
"Network") translate "Network" ;;
"Storage") translate "Storage" ;;
"Security") translate "Security" ;;
"Customization") translate "Customization" ;;
"Monitoring") translate "Monitoring" ;;
"Performance") translate "Performance" ;;
"Optional") translate "Optional" ;;
*) echo "$1" ;;
esac
}
custom_post_description_label() {
case "$1" in
"Update and upgrade system") translate "Update and upgrade system" ;;
"Synchronize time automatically") translate "Synchronize time automatically" ;;
"Skip downloading additional languages") translate "Skip downloading additional languages" ;;
"Install common system utilities") translate "Install common system utilities" ;;
"Optimize journald") translate "Optimize journald" ;;
"Optimize logrotate") translate "Optimize logrotate" ;;
"Increase various system limits") translate "Increase various system limits" ;;
"Optimize Memory") translate "Optimize Memory" ;;
"Enable fast reboots") translate "Enable fast reboots" ;;
"Enable restart on kernel panic") translate "Enable restart on kernel panic" ;;
"Apply AMD CPU fixes") translate "Apply AMD CPU fixes" ;;
"Install relevant guest agent") translate "Install relevant guest agent" ;;
"Enable VFIO IOMMU support") translate "Enable VFIO IOMMU support" ;;
"Force APT to use IPv4") translate "Force APT to use IPv4" ;;
"Apply network optimizations") translate "Apply network optimizations" ;;
"Install Open vSwitch") translate "Install Open vSwitch" ;;
"Enable TCP BBR/Fast Open control") translate "Enable TCP BBR/Fast Open control" ;;
"Interface Names (persistent)") translate "Interface Names (persistent)" ;;
"Optimize ZFS ARC size") translate "Optimize ZFS ARC size" ;;
"Install ZFS auto-snapshot") translate "Install ZFS auto-snapshot" ;;
"Enable ZFS autotrim (SSD/NVMe pools)") translate "Enable ZFS autotrim (SSD/NVMe pools)" ;;
"Increase vzdump backup speed") translate "Increase vzdump backup speed" ;;
"Disable portmapper/rpcbind") translate "Disable portmapper/rpcbind" ;;
"Customize bashrc") translate "Customize bashrc" ;;
"Set up custom MOTD banner") translate "Set up custom MOTD banner" ;;
"Remove subscription banner") translate "Remove subscription banner" ;;
"Install OVH Real Time Monitoring") translate "Install OVH Real Time Monitoring" ;;
"Use pigz for faster gzip compression") translate "Use pigz for faster gzip compression" ;;
"Install and configure Fastfetch") translate "Install and configure Fastfetch" ;;
"Update Proxmox VE Appliance Manager") translate "Update Proxmox VE Appliance Manager" ;;
"Add latest Ceph support") translate "Add latest Ceph support" ;;
"Enable High Availability services") translate "Enable High Availability services" ;;
"Install Figurine") translate "Install Figurine" ;;
"Install and configure Log2RAM") translate "Install and configure Log2RAM" ;;
*) echo "$1" ;;
esac
}
format_custom_post_line() {
local description="$1"
local category="$2"
local max_description_length=52
if command -v python3 >/dev/null 2>&1; then
python3 - "$description" "$category" "$max_description_length" <<'PY'
import sys
import unicodedata
description = sys.argv[1]
category = sys.argv[2]
max_width = int(sys.argv[3])
def display_width(text):
width = 0
for char in text:
if unicodedata.combining(char):
continue
width += 2 if unicodedata.east_asian_width(char) in ("F", "W") else 1
return width
def fit_text(text, width):
result = ""
used = 0
for char in text:
char_width = 0 if unicodedata.combining(char) else (2 if unicodedata.east_asian_width(char) in ("F", "W") else 1)
if used + char_width > width:
break
result += char
used += char_width
return result, used
if display_width(description) > max_width:
description, used_width = fit_text(description, max_width - 3)
description += "..."
used_width += 3
else:
used_width = display_width(description)
print(f"{description}{' ' * (max_width - used_width)} | {category}")
PY
return
fi
if [ ${#description} -gt $max_description_length ]; then
description="${description:0:$((max_description_length - 3))}..."
fi
printf '%-*s | %s' "$max_description_length" "$description" "$category"
}
format_custom_post_header() {
local description_label
local category_label
local checklist_prefix=" "
description_label="$(translate "Description")"
category_label="$(translate "Category")"
printf '%s%s' "$checklist_prefix" "$(format_custom_post_line "$description_label" "$category_label")"
}
# Main menu function
main_menu() {
local header_line
local HEADER
if [[ "$LANGUAGE" == "es" ]]; then
HEADER="Seleccione las opciones a configurar:\n\n Descripción | Categoría"
@@ -2919,6 +3038,9 @@ main_menu() {
HEADER="$(translate "Choose options to configure:")\n\n Description | Category"
fi
header_line="$(format_custom_post_header)"
HEADER="$(translate "Choose options to configure:")\n\n${header_line}"
declare -A category_order=(
["Basic Settings"]=1 ["System"]=2 ["Hardware"]=3 ["Virtualization"]=4
["Network"]=5 ["Storage"]=6 ["Security"]=7 ["Customization"]=8
@@ -2969,23 +3091,18 @@ main_menu() {
done | sort -n | cut -d'|' -f2-))
unset IFS
local max_desc_length=0
local temp_descriptions=()
local temp_categories=()
for option in "${sorted_options[@]}"; do
IFS='|' read -r category description function_name <<< "$option"
local desc_translated="$(translate "$description")"
local desc_translated
local category_translated
desc_translated="$(custom_post_description_label "$description")"
category_translated="$(custom_post_category_label "$category")"
temp_descriptions+=("$desc_translated")
local desc_length=${#desc_translated}
if [ $desc_length -gt $max_desc_length ]; then
max_desc_length=$desc_length
fi
temp_categories+=("$category_translated")
done
if [ $max_desc_length -gt 50 ]; then
max_desc_length=50
fi
local checklist_items=()
local i=1
@@ -3001,21 +3118,11 @@ main_menu() {
fi
local desc_translated="${temp_descriptions[$desc_index]}"
local category_translated="${temp_categories[$desc_index]}"
desc_index=$((desc_index + 1))
if [ ${#desc_translated} -gt $max_desc_length ]; then
desc_translated="${desc_translated:0:$((max_desc_length-3))}..."
fi
local spaces_needed=$((max_desc_length - ${#desc_translated}))
local padding=""
for ((j=0; j<spaces_needed; j++)); do
padding+=" "
done
local line="${desc_translated}${padding} | ${category}"
local line
line="$(format_custom_post_line "$desc_translated" "$category_translated")"
checklist_items+=("$i" "$line" "off")
i=$((i + 1))
@@ -3026,7 +3133,7 @@ main_menu() {
selected_indices=$(dialog --clear \
--backtitle "ProxMenux" \
--title "$(translate "Post-Installation Options")" \
--checklist "$HEADER" 22 80 15 \
--checklist "$HEADER" 22 88 15 \
"${checklist_items[@]}" \
2>&1 1>&3)