A free, open, self-hosted app platform (GNU AGPLv3): one-click app deploys, Traefik reverse proxy with automatic SSL, rootless Docker support, gluetun VPN routing, and a web dashboard to manage it all. Free & open forever to self-host; optional paid hosted services fund it. See PROMISE.md. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
49 lines
2.2 KiB
Bash
Executable File
49 lines
2.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Show network statistics
|
|
port_show_network_statistics()
|
|
{
|
|
echo ""
|
|
echo "📊 Network Statistics"
|
|
echo "====================="
|
|
echo ""
|
|
|
|
# Overall statistics
|
|
local total_services=$(sqlite3 "$docker_dir/$db_file" "SELECT COUNT(*) FROM network_services;" 2>/dev/null)
|
|
local active_services=$(sqlite3 "$docker_dir/$db_file" "SELECT COUNT(*) FROM network_services WHERE status = 'active';" 2>/dev/null)
|
|
local inactive_services=$(sqlite3 "$docker_dir/$db_file" "SELECT COUNT(*) FROM network_services WHERE status = 'inactive';" 2>/dev/null)
|
|
local conflict_services=$(sqlite3 "$docker_dir/$db_file" "SELECT COUNT(*) FROM network_services WHERE status = 'conflict';" 2>/dev/null)
|
|
|
|
echo "📈 Service Statistics:"
|
|
echo " Total Services: $total_services"
|
|
echo " Active Services: $active_services"
|
|
echo " Inactive Services: $inactive_services"
|
|
echo " Conflicted Services: $conflict_services"
|
|
echo ""
|
|
|
|
# Port statistics
|
|
local external_ports=$(sqlite3 "$docker_dir/$db_file" "SELECT COUNT(*) FROM network_services WHERE external_port IS NOT NULL AND status = 'active';" 2>/dev/null)
|
|
local internal_only=$(sqlite3 "$docker_dir/$db_file" "SELECT COUNT(*) FROM network_services WHERE external_port IS NULL AND status = 'active';" 2>/dev/null)
|
|
|
|
echo "🔌 Port Statistics:"
|
|
echo " External Ports: $external_ports"
|
|
echo " Internal Only: $internal_only"
|
|
echo ""
|
|
|
|
# Service type statistics
|
|
echo "🏷️ Service Types:"
|
|
local sql="SELECT service_type, COUNT(*) as count FROM network_services WHERE status = 'active' GROUP BY service_type ORDER BY count DESC;"
|
|
while IFS='|' read -r service_type count; do
|
|
echo " $service_type: $count"
|
|
done < <(sqlite3 "$docker_dir/$db_file" "$sql" 2>/dev/null)
|
|
echo ""
|
|
|
|
# Category statistics
|
|
echo "📂 Categories:"
|
|
local sql="SELECT category, COUNT(*) as count FROM network_services WHERE status = 'active' GROUP BY category ORDER BY count DESC;"
|
|
while IFS='|' read -r category count; do
|
|
echo " $category: $count"
|
|
done < <(sqlite3 "$docker_dir/$db_file" "$sql" 2>/dev/null)
|
|
echo ""
|
|
}
|