From 93b355d6c55703f37a5c71ebf74de6b314943e80 Mon Sep 17 00:00:00 2001 From: pika Date: Sun, 30 Mar 2025 15:43:11 +0200 Subject: [PATCH] add: dev branch + caddy && nginx display properly on dashboard --- app.py | 12 ++-- templates/dashboard.html | 133 ++++++++++++++++++++++++++++++++------- 2 files changed, 116 insertions(+), 29 deletions(-) diff --git a/app.py b/app.py index c6d5325..d3e9d25 100644 --- a/app.py +++ b/app.py @@ -208,11 +208,11 @@ def index(): # Calculate stats caddy_servers = len(caddy_proxies) nginx_servers = len(nginx_proxies) - + # Calculate total domains total_domains = 0 domain_list = [] - + # Build the domain list for both Caddy and Nginx for server, domains in caddy_proxies.items(): for domain, target in domains.items(): @@ -223,7 +223,7 @@ def index(): "server_type": "caddy" }) total_domains += 1 - + for server, domains in nginx_proxies.items(): for domain, target in domains.items(): domain_list.append({ @@ -233,17 +233,17 @@ def index(): "server_type": "nginx" }) total_domains += 1 - + # Sort domains by name domain_list.sort(key=lambda x: x["domain"]) - + # Get the latest update time last_update = "Never" if timestamps: # Find the most recent timestamp latest_time = max(timestamps.values()) last_update = latest_time - + return render_template('dashboard.html', caddy_count=caddy_servers, nginx_count=nginx_servers, diff --git a/templates/dashboard.html b/templates/dashboard.html index 27abf5e..40f8fb6 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -1,25 +1,33 @@ - + - - + + Caddy Dashboard - +