Add optimization status indicators to domain selection
- Show [NEEDS OPTIMIZATION] or [OK] status next to each domain - Helps users quickly identify which domains require work - Uses detect_php_config_issues to check critical/high severity issues - Provides visual cues for faster domain selection - Only shows status for optimize action to reduce processing overhead Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -110,7 +110,7 @@ select_domain() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Display numbered list
|
||||
# Display numbered list with optimization status
|
||||
cecho "${CYAN}Available domains:${NC}"
|
||||
echo ""
|
||||
|
||||
@@ -120,7 +120,22 @@ select_domain() {
|
||||
local php_version
|
||||
php_version=$(detect_php_version_for_domain "$username" "$domain" 2>/dev/null || echo "unknown")
|
||||
|
||||
printf " ${GREEN}%-3d${NC}) %-40s ${CYAN}[${username}]${NC} ${YELLOW}(${php_version})${NC}\n" "$index" "$domain"
|
||||
# Check optimization status (only for optimize action to reduce noise)
|
||||
local status_indicator=""
|
||||
if [[ "$action" == "optimize" ]]; then
|
||||
local issues
|
||||
issues=$(detect_php_config_issues "$username" "$domain" 2>/dev/null || echo "NONE|NONE|None")
|
||||
local has_high_issues
|
||||
has_high_issues=$(echo "$issues" | grep -cE "^[^|]*\|(CRITICAL|HIGH)\|" 2>/dev/null || echo "0")
|
||||
|
||||
if [ "$has_high_issues" -gt 0 ]; then
|
||||
status_indicator="${YELLOW}[NEEDS OPTIMIZATION]${NC}"
|
||||
else
|
||||
status_indicator="${GREEN}[OK]${NC}"
|
||||
fi
|
||||
fi
|
||||
|
||||
printf " ${GREEN}%-3d${NC}) %-40s ${CYAN}[${username}]${NC} ${YELLOW}(${php_version})${NC} %s\n" "$index" "$domain" "$(echo -e "$status_indicator")"
|
||||
index=$((index + 1))
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user