refactor(nav): use exit code 75 to suppress redundant "Press Enter" prompt
- app submenus return 75 on back/exit instead of 0 - index menus capture child exit code and skip pause when rc is 75 - applies to apps (coolify, pterodactyl, uptime-kuma, cloudpanel, proxmox) and tools (server-benchmark, system-infos) indexes
This commit is contained in:
+15
-17
@@ -16,21 +16,21 @@ export LXS_LOG_FILE="/tmp/lxs_system_infos.log"
|
||||
menu_system_infos() {
|
||||
while true; do
|
||||
clear
|
||||
echo -e "${WHITE}╔═══════════════════════════════════════════════════════╗${NC}"
|
||||
echo -e "${WHITE}║ SYSTEM INFOS ║${NC}"
|
||||
echo -e "${WHITE}╚═══════════════════════════════════════════════════════╝${NC}"
|
||||
show_box_top "SYSTEM INFOS"
|
||||
echo ""
|
||||
echo -e " ${CYAN}[1]${NC} View system informations"
|
||||
echo -e " ${CYAN}[2]${NC} Check disk space"
|
||||
echo -e " ${CYAN}[3]${NC} Check memory usage"
|
||||
echo -e " ${CYAN}[4]${NC} Check CPU load"
|
||||
echo -e " ${CYAN}[5]${NC} Check network"
|
||||
echo -e " ${CYAN}[6]${NC} View system logs (last 50 lines)"
|
||||
echo -e " ${CYAN}[7]${NC} Show top resource-consuming processes"
|
||||
echo -e " ${CYAN}[8]${NC} Check disk health (SMART)"
|
||||
echo -e " ${RED}[0]${NC} Exit"
|
||||
show_menu_item "1" "View system informations"
|
||||
show_menu_item "2" "Check disk space"
|
||||
show_menu_item "3" "Check memory usage"
|
||||
show_menu_item "4" "Check CPU load"
|
||||
show_menu_item "5" "Check network"
|
||||
show_menu_item "6" "View system logs (last 50 lines)"
|
||||
show_menu_item "7" "Show top resource-consuming processes"
|
||||
show_menu_item "8" "Check disk health (SMART)"
|
||||
show_menu_item "0" "Exit" "" exit
|
||||
echo ""
|
||||
echo -e -n "${BOLD}Choice [0-8]: ${NC}"
|
||||
show_box_bottom
|
||||
echo ""
|
||||
show_prompt
|
||||
read -r choice
|
||||
|
||||
echo ""
|
||||
@@ -39,9 +39,7 @@ menu_system_infos() {
|
||||
1)
|
||||
# View system informations
|
||||
clear
|
||||
echo -e "${WHITE}╔═══════════════════════════════════════════════════════╗${NC}"
|
||||
echo -e "${WHITE}║ SYSTEM INFORMATION ║${NC}"
|
||||
echo -e "${WHITE}╚═══════════════════════════════════════════════════════╝${NC}"
|
||||
show_box_top "SYSTEM INFORMATION"
|
||||
echo ""
|
||||
|
||||
echo -e "${CYAN}${BOLD}Operating System:${NC}"
|
||||
@@ -267,7 +265,7 @@ menu_system_infos() {
|
||||
fi
|
||||
;;
|
||||
0)
|
||||
exit 0
|
||||
exit 75
|
||||
;;
|
||||
*)
|
||||
echo -e "${RED}[✗] Invalid option. Please select 0-8.${NC}"
|
||||
|
||||
Reference in New Issue
Block a user