mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-06-15 14:28:21 +00:00
Update 1.2.2.2 bate
This commit is contained in:
582
lang/es.json
582
lang/es.json
File diff suppressed because it is too large
Load Diff
@@ -667,13 +667,6 @@ _rs_extract_pbs() {
|
|||||||
# form (`YYYY-MM-DDTHH:MM:SSZ`) that `snapshot files` and
|
# form (`YYYY-MM-DDTHH:MM:SSZ`) that `snapshot files` and
|
||||||
# `restore` actually accept as the snapshot path.
|
# `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 < <(
|
mapfile -t snapshots < <(
|
||||||
PBS_PASSWORD="$HB_PBS_SECRET" \
|
PBS_PASSWORD="$HB_PBS_SECRET" \
|
||||||
PBS_FINGERPRINT="${HB_PBS_FINGERPRINT:-}" \
|
PBS_FINGERPRINT="${HB_PBS_FINGERPRINT:-}" \
|
||||||
@@ -2450,7 +2443,6 @@ restore_menu() {
|
|||||||
# ==========================================================
|
# ==========================================================
|
||||||
main_menu() {
|
main_menu() {
|
||||||
while true; do
|
while true; do
|
||||||
show_proxmenux_logo
|
|
||||||
local choice
|
local choice
|
||||||
choice=$(dialog --backtitle "ProxMenux" \
|
choice=$(dialog --backtitle "ProxMenux" \
|
||||||
--title "$(translate "Host Config Backup / Restore")" \
|
--title "$(translate "Host Config Backup / Restore")" \
|
||||||
|
|||||||
@@ -254,6 +254,32 @@ format_menu_item() {
|
|||||||
echo "${description}${spacing}${source}"
|
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() {
|
show_menu() {
|
||||||
while true; do
|
while true; do
|
||||||
@@ -276,10 +302,8 @@ show_menu() {
|
|||||||
# above "Uninstall optimizations" so it sits next to the
|
# above "Uninstall optimizations" so it sits next to the
|
||||||
# related rollback action and not buried in the middle.
|
# related rollback action and not buried in the middle.
|
||||||
if [[ "$name" == "Uninstall optimizations" && "$update_count" -gt 0 ]]; then
|
if [[ "$name" == "Uninstall optimizations" && "$update_count" -gt 0 ]]; then
|
||||||
local update_label
|
|
||||||
update_label="Apply available updates ($update_count)"
|
|
||||||
local translated_update
|
local translated_update
|
||||||
translated_update="$(translate "$update_label")"
|
translated_update="$(translate "Apply available updates") ($update_count)"
|
||||||
local formatted_update
|
local formatted_update
|
||||||
formatted_update=$(format_menu_item "$translated_update" "ProxMenux")
|
formatted_update=$(format_menu_item "$translated_update" "ProxMenux")
|
||||||
menu_items+=("$counter" "$formatted_update")
|
menu_items+=("$counter" "$formatted_update")
|
||||||
@@ -287,7 +311,8 @@ show_menu() {
|
|||||||
((counter++))
|
((counter++))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local translated_name="$(translate "$name")"
|
local translated_name
|
||||||
|
translated_name="$(post_install_label "$name")"
|
||||||
local formatted_item
|
local formatted_item
|
||||||
formatted_item=$(format_menu_item "$translated_name" "$source")
|
formatted_item=$(format_menu_item "$translated_name" "$source")
|
||||||
menu_items+=("$counter" "$formatted_item")
|
menu_items+=("$counter" "$formatted_item")
|
||||||
@@ -297,13 +322,14 @@ show_menu() {
|
|||||||
|
|
||||||
|
|
||||||
menu_items+=("" "")
|
menu_items+=("" "")
|
||||||
menu_items+=("-" "───────────────────── Community Scripts ──────────────────────")
|
menu_items+=("-" "───────────────────── $(post_install_label "Community Scripts") ──────────────────────")
|
||||||
menu_items+=("" "")
|
menu_items+=("" "")
|
||||||
|
|
||||||
|
|
||||||
for script in "${COMMUNITY_SCRIPTS[@]}"; do
|
for script in "${COMMUNITY_SCRIPTS[@]}"; do
|
||||||
IFS='|' read -r name source command <<< "$script"
|
IFS='|' read -r name source command <<< "$script"
|
||||||
local translated_name="$(translate "$name")"
|
local translated_name
|
||||||
|
translated_name="$(post_install_label "$name")"
|
||||||
local formatted_item
|
local formatted_item
|
||||||
formatted_item=$(format_menu_item "$translated_name" "$source")
|
formatted_item=$(format_menu_item "$translated_name" "$source")
|
||||||
menu_items+=("$counter" "$formatted_item")
|
menu_items+=("$counter" "$formatted_item")
|
||||||
|
|||||||
@@ -1184,6 +1184,56 @@ format_menu_item() {
|
|||||||
echo "${description}${spacing}${source}"
|
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() {
|
show_menu() {
|
||||||
while true; do
|
while true; do
|
||||||
@@ -1195,7 +1245,8 @@ show_menu() {
|
|||||||
|
|
||||||
for script in "${PROXMENUX_SCRIPTS[@]}"; do
|
for script in "${PROXMENUX_SCRIPTS[@]}"; do
|
||||||
IFS='|' read -r name source command <<< "$script"
|
IFS='|' read -r name source command <<< "$script"
|
||||||
local translated_name="$(translate "$name")"
|
local translated_name
|
||||||
|
translated_name="$(network_menu_label "$name")"
|
||||||
local formatted_item
|
local formatted_item
|
||||||
formatted_item=$(format_menu_item "$translated_name" "$source")
|
formatted_item=$(format_menu_item "$translated_name" "$source")
|
||||||
menu_items+=("$counter" "$formatted_item")
|
menu_items+=("$counter" "$formatted_item")
|
||||||
@@ -1211,7 +1262,8 @@ show_menu() {
|
|||||||
|
|
||||||
for script in "${COMMUNITY_SCRIPTS[@]}"; do
|
for script in "${COMMUNITY_SCRIPTS[@]}"; do
|
||||||
IFS='|' read -r name source command <<< "$script"
|
IFS='|' read -r name source command <<< "$script"
|
||||||
local translated_name="$(translate "$name")"
|
local translated_name
|
||||||
|
translated_name="$(network_menu_label "$name")"
|
||||||
local formatted_item
|
local formatted_item
|
||||||
formatted_item=$(format_menu_item "$translated_name" "$source")
|
formatted_item=$(format_menu_item "$translated_name" "$source")
|
||||||
menu_items+=("$counter" "$formatted_item")
|
menu_items+=("$counter" "$formatted_item")
|
||||||
|
|||||||
@@ -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 function
|
||||||
main_menu() {
|
main_menu() {
|
||||||
|
local header_line
|
||||||
local HEADER
|
local HEADER
|
||||||
if [[ "$LANGUAGE" == "es" ]]; then
|
if [[ "$LANGUAGE" == "es" ]]; then
|
||||||
HEADER="Seleccione las opciones a configurar:\n\n Descripción | Categoría"
|
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"
|
HEADER="$(translate "Choose options to configure:")\n\n Description | Category"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
header_line="$(format_custom_post_header)"
|
||||||
|
HEADER="$(translate "Choose options to configure:")\n\n${header_line}"
|
||||||
|
|
||||||
declare -A category_order=(
|
declare -A category_order=(
|
||||||
["Basic Settings"]=1 ["System"]=2 ["Hardware"]=3 ["Virtualization"]=4
|
["Basic Settings"]=1 ["System"]=2 ["Hardware"]=3 ["Virtualization"]=4
|
||||||
["Network"]=5 ["Storage"]=6 ["Security"]=7 ["Customization"]=8
|
["Network"]=5 ["Storage"]=6 ["Security"]=7 ["Customization"]=8
|
||||||
@@ -2969,24 +3091,19 @@ main_menu() {
|
|||||||
done | sort -n | cut -d'|' -f2-))
|
done | sort -n | cut -d'|' -f2-))
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
local max_desc_length=0
|
|
||||||
local temp_descriptions=()
|
local temp_descriptions=()
|
||||||
|
local temp_categories=()
|
||||||
|
|
||||||
for option in "${sorted_options[@]}"; do
|
for option in "${sorted_options[@]}"; do
|
||||||
IFS='|' read -r category description function_name <<< "$option"
|
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")
|
temp_descriptions+=("$desc_translated")
|
||||||
|
temp_categories+=("$category_translated")
|
||||||
local desc_length=${#desc_translated}
|
|
||||||
if [ $desc_length -gt $max_desc_length ]; then
|
|
||||||
max_desc_length=$desc_length
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $max_desc_length -gt 50 ]; then
|
|
||||||
max_desc_length=50
|
|
||||||
fi
|
|
||||||
|
|
||||||
local checklist_items=()
|
local checklist_items=()
|
||||||
local i=1
|
local i=1
|
||||||
local desc_index=0
|
local desc_index=0
|
||||||
@@ -3001,21 +3118,11 @@ main_menu() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local desc_translated="${temp_descriptions[$desc_index]}"
|
local desc_translated="${temp_descriptions[$desc_index]}"
|
||||||
|
local category_translated="${temp_categories[$desc_index]}"
|
||||||
desc_index=$((desc_index + 1))
|
desc_index=$((desc_index + 1))
|
||||||
|
|
||||||
|
local line
|
||||||
if [ ${#desc_translated} -gt $max_desc_length ]; then
|
line="$(format_custom_post_line "$desc_translated" "$category_translated")"
|
||||||
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}"
|
|
||||||
|
|
||||||
checklist_items+=("$i" "$line" "off")
|
checklist_items+=("$i" "$line" "off")
|
||||||
i=$((i + 1))
|
i=$((i + 1))
|
||||||
@@ -3026,7 +3133,7 @@ main_menu() {
|
|||||||
selected_indices=$(dialog --clear \
|
selected_indices=$(dialog --clear \
|
||||||
--backtitle "ProxMenux" \
|
--backtitle "ProxMenux" \
|
||||||
--title "$(translate "Post-Installation Options")" \
|
--title "$(translate "Post-Installation Options")" \
|
||||||
--checklist "$HEADER" 22 80 15 \
|
--checklist "$HEADER" 22 88 15 \
|
||||||
"${checklist_items[@]}" \
|
"${checklist_items[@]}" \
|
||||||
2>&1 1>&3)
|
2>&1 1>&3)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user