mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2025-06-28 04:06:54 +00:00
Update config_menu.sh
This commit is contained in:
parent
9b5c605dec
commit
f0dd00aa2c
@ -93,28 +93,21 @@ change_language() {
|
|||||||
# ==========================================================
|
# ==========================================================
|
||||||
|
|
||||||
show_version_info() {
|
show_version_info() {
|
||||||
|
local version info_message temp_file
|
||||||
local version
|
|
||||||
version=$(<"$LOCAL_VERSION_FILE")
|
version=$(<"$LOCAL_VERSION_FILE")
|
||||||
|
|
||||||
# Prepare the information message
|
info_message+="$(translate "Current ProxMenux version:") $version\n\n"
|
||||||
local info_message="$(translate "Current ProxMenux version:") $version\n\n"
|
|
||||||
info_message+="$(translate "Installed components:")\n"
|
info_message+="$(translate "Installed components:")\n"
|
||||||
|
|
||||||
# Check and add information about installed components
|
|
||||||
if [ -f "$CONFIG_FILE" ]; then
|
if [ -f "$CONFIG_FILE" ]; then
|
||||||
while IFS=': ' read -r component value; do
|
while IFS=': ' read -r component value; do
|
||||||
if [ "$component" = "language" ]; then
|
[ "$component" = "language" ] && continue
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
local status
|
local status
|
||||||
if echo "$value" | jq -e '.status' >/dev/null 2>&1; then
|
if echo "$value" | jq -e '.status' >/dev/null 2>&1; then
|
||||||
status=$(echo "$value" | jq -r '.status')
|
status=$(echo "$value" | jq -r '.status')
|
||||||
else
|
else
|
||||||
status="$value"
|
status="$value"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local translated_status=$(translate "$status")
|
local translated_status=$(translate "$status")
|
||||||
case "$status" in
|
case "$status" in
|
||||||
"installed"|"already_installed"|"created"|"already_exists"|"upgraded")
|
"installed"|"already_installed"|"created"|"already_exists"|"upgraded")
|
||||||
@ -129,7 +122,6 @@ show_version_info() {
|
|||||||
info_message+="$(translate "No installation information available.")\n"
|
info_message+="$(translate "No installation information available.")\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Add information about ProxMenu files with paths
|
|
||||||
info_message+="\n$(translate "ProxMenu files:")\n"
|
info_message+="\n$(translate "ProxMenu files:")\n"
|
||||||
[ -f "$INSTALL_DIR/$MENU_SCRIPT" ] && info_message+="✓ $MENU_SCRIPT → $INSTALL_DIR/$MENU_SCRIPT\n" || info_message+="✗ $MENU_SCRIPT\n"
|
[ -f "$INSTALL_DIR/$MENU_SCRIPT" ] && info_message+="✓ $MENU_SCRIPT → $INSTALL_DIR/$MENU_SCRIPT\n" || info_message+="✗ $MENU_SCRIPT\n"
|
||||||
[ -f "$CACHE_FILE" ] && info_message+="✓ cache.json → $CACHE_FILE\n" || info_message+="✗ cache.json\n"
|
[ -f "$CACHE_FILE" ] && info_message+="✓ cache.json → $CACHE_FILE\n" || info_message+="✗ cache.json\n"
|
||||||
@ -137,29 +129,26 @@ show_version_info() {
|
|||||||
[ -f "$CONFIG_FILE" ] && info_message+="✓ config.json → $CONFIG_FILE\n" || info_message+="✗ config.json\n"
|
[ -f "$CONFIG_FILE" ] && info_message+="✓ config.json → $CONFIG_FILE\n" || info_message+="✗ config.json\n"
|
||||||
[ -f "$LOCAL_VERSION_FILE" ] && info_message+="✓ version.txt → $LOCAL_VERSION_FILE\n" || info_message+="✗ version.txt\n"
|
[ -f "$LOCAL_VERSION_FILE" ] && info_message+="✓ version.txt → $LOCAL_VERSION_FILE\n" || info_message+="✗ version.txt\n"
|
||||||
|
|
||||||
# Add information about the virtual environment with path
|
|
||||||
info_message+="\n$(translate "Virtual Environment:")\n"
|
info_message+="\n$(translate "Virtual Environment:")\n"
|
||||||
if [ -d "$VENV_PATH" ] && [ -f "$VENV_PATH/bin/activate" ]; then
|
if [ -d "$VENV_PATH" ] && [ -f "$VENV_PATH/bin/activate" ]; then
|
||||||
info_message+="✓ $(translate "Installed") → $VENV_PATH\n"
|
info_message+="✓ $(translate "Installed") → $VENV_PATH\n"
|
||||||
if [ -f "$VENV_PATH/bin/pip" ]; then
|
[ -f "$VENV_PATH/bin/pip" ] && info_message+="✓ pip: $(translate "Installed") → $VENV_PATH/bin/pip\n" || info_message+="✗ pip: $(translate "Not installed")\n"
|
||||||
info_message+="✓ pip: $(translate "Installed") → $VENV_PATH/bin/pip\n"
|
|
||||||
else
|
|
||||||
info_message+="✗ pip: $(translate "Not installed")\n"
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
info_message+="✗ $(translate "Virtual Environment"): $(translate "Not installed")\n"
|
info_message+="✗ $(translate "Virtual Environment"): $(translate "Not installed")\n"
|
||||||
info_message+="✗ pip: $(translate "Not installed")\n"
|
info_message+="✗ pip: $(translate "Not installed")\n"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Display the current language (without path)
|
current_language=$(jq -r '.language // "en"' "$CONFIG_FILE")
|
||||||
local current_language=$(jq -r '.language // "en"' "$CONFIG_FILE")
|
info_message+="\n$(translate "Current language:")\n$current_language\n"
|
||||||
info_message+="\n$(translate "Current language:")\n"
|
|
||||||
info_message+="$current_language\n"
|
|
||||||
|
|
||||||
# Display the information using whiptail
|
# Mostrar con dialog usando un archivo temporal
|
||||||
whiptail --title "$(translate "ProxMenux Information")" \
|
if command -v dialog >/dev/null 2>&1; then
|
||||||
--scrolltext \
|
tmpfile=$(mktemp)
|
||||||
--msgbox "$info_message" 20 70
|
echo -e "$info_message" > "$tmpfile"
|
||||||
|
dialog --title "$(translate "ProxMenux Information")" --clear --textbox "$tmpfile" 20 70
|
||||||
|
rm -f "$tmpfile"
|
||||||
|
fi
|
||||||
|
show_proxmenux_logo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user