feat: Add system info display at startup and detailed system info menu option

This commit is contained in:
Developer
2026-03-19 19:54:58 -04:00
parent d36e668b0e
commit 7c57d21463
+72 -2
View File
@@ -80,6 +80,61 @@ run_module() {
read -p "Press Enter to continue..." read -p "Press Enter to continue..."
} }
#############################################################################
# SYSTEM INFO DISPLAY (Quick View)
#############################################################################
show_system_overview() {
# Only show if detection is complete
if [ -z "${SYS_DETECTION_COMPLETE:-}" ]; then
return
fi
echo ""
echo -e "${BOLD}🖥️ System Information:${NC}"
# Control Panel
if [ "$SYS_CONTROL_PANEL" != "none" ]; then
echo -n " Control Panel: ${CYAN}${SYS_CONTROL_PANEL^^}${NC}"
[ -n "$SYS_CONTROL_PANEL_VERSION" ] && echo -n " v${SYS_CONTROL_PANEL_VERSION}" || echo -n " (version unknown)"
echo ""
else
echo " Control Panel: ${CYAN}Standalone${NC} (no control panel)"
fi
# OS
echo " OS: ${CYAN}${SYS_OS_TYPE^^}${NC} ${SYS_OS_VERSION}"
[ "${SYS_CLOUDLINUX:-}" = "yes" ] && echo -e " ${CYAN}${NC} CloudLinux detected"
# Web Server
echo -n " Web Server: ${CYAN}${SYS_WEB_SERVER^^}${NC}"
[ -n "$SYS_WEB_SERVER_VERSION" ] && echo " v${SYS_WEB_SERVER_VERSION}" || echo ""
# Database
if [ "$SYS_DB_TYPE" != "none" ]; then
echo -n " Database: ${CYAN}${SYS_DB_TYPE^^}${NC}"
[ -n "$SYS_DB_VERSION" ] && echo " v${SYS_DB_VERSION}" || echo ""
fi
# PHP Versions
if [ ${#SYS_PHP_VERSIONS[@]} -gt 0 ]; then
echo -n " PHP Versions: ${CYAN}"
printf '%s, ' "${SYS_PHP_VERSIONS[@]}" | sed 's/, $//'
echo "${NC}"
fi
# Firewall
if [ "$SYS_FIREWALL" != "none" ]; then
echo -n " Firewall: ${CYAN}${SYS_FIREWALL^^}${NC}"
[ "$SYS_FIREWALL_ACTIVE" = "yes" ] && echo " (${GREEN}active${NC})" || echo " (${YELLOW}inactive${NC})"
fi
# Cloudflare
[ "$SYS_CLOUDFLARE_ACTIVE" = "yes" ] && echo " Cloudflare: ${YELLOW}Detected${NC}"
echo ""
}
############################################################################# #############################################################################
# MAIN MENU # MAIN MENU
############################################################################# #############################################################################
@@ -87,6 +142,9 @@ run_module() {
show_main_menu() { show_main_menu() {
show_banner show_banner
# Show quick system overview if detection is complete
[ -n "${SYS_DETECTION_COMPLETE:-}" ] && show_system_overview
echo -e "${BOLD}Quick Diagnostics:${NC}" echo -e "${BOLD}Quick Diagnostics:${NC}"
echo "" echo ""
echo -e " ${MAGENTA}1)${NC} 🏥 System Health Check - Full server diagnostics" echo -e " ${MAGENTA}1)${NC} 🏥 System Health Check - Full server diagnostics"
@@ -101,7 +159,8 @@ show_main_menu() {
echo "" echo ""
echo -e "${BOLD}System:${NC}" echo -e "${BOLD}System:${NC}"
echo "" echo ""
echo -e " ${YELLOW}7)${NC} 🗑️ Cleanup Toolkit Data - Clear cached data" echo -e " ${MAGENTA}7)${NC} 📋 System Information - Detailed platform info"
echo -e " ${YELLOW}8)${NC} 🗑️ Cleanup Toolkit Data - Clear cached data"
echo "" echo ""
echo -e " ${RED}0)${NC} Exit" echo -e " ${RED}0)${NC} Exit"
echo "" echo ""
@@ -576,6 +635,11 @@ init_directories() {
} }
startup_detection() { startup_detection() {
# Initialize system detection first (required for show_system_overview)
if [ -z "${SYS_DETECTION_COMPLETE:-}" ]; then
initialize_system_detection
fi
if ! db_is_fresh; then if ! db_is_fresh; then
clear clear
print_banner "Server Management Toolkit - Initializing" print_banner "Server Management Toolkit - Initializing"
@@ -634,7 +698,13 @@ main() {
4) handle_performance_menu ;; 4) handle_performance_menu ;;
5) handle_backup_menu ;; 5) handle_backup_menu ;;
6) handle_email_menu ;; 6) handle_email_menu ;;
7) run_module "maintenance" "cleanup-toolkit-data.sh" ;; 7)
clear
show_system_info
echo ""
read -p "Press Enter to continue..."
;;
8) run_module "maintenance" "cleanup-toolkit-data.sh" ;;
0) 0)
echo "" echo ""
read -p "Clean history and remove traces? (yes/no): " clean_hist read -p "Clean history and remove traces? (yes/no): " clean_hist