diff --git a/server.py b/server.py index 4ff13b3..0909197 100644 --- a/server.py +++ b/server.py @@ -589,7 +589,7 @@ def convert_nodes_to_dict(nodes): # region API routes @app.route("/api/nodes") def api_nodes(): - node_status = check_nodes() + node_status = check_nodes_from_log() return jsonify(node_status) @@ -686,6 +686,15 @@ def index(): history_summary["nodes"] = convert_nodes_to_dict(history_summary["nodes"]) last_check = format_last_check(last_log) + # Replace true/false with up/down + for node in node_status: + for key in ["plain_dns", "doh", "dot"]: + if node[key]: + node[key] = "Up" + else: + node[key] = "Down" + + return render_template( "index.html", nodes=node_status, diff --git a/templates/assets/css/index.css b/templates/assets/css/index.css index 7a23aee..b3d67e7 100644 --- a/templates/assets/css/index.css +++ b/templates/assets/css/index.css @@ -2,7 +2,7 @@ margin: 25px; border: solid; border-radius: 20px; - padding-inline: 50px; + padding: 20px; max-width: 90%; } @@ -15,4 +15,11 @@ width: 1000px; max-width: 95%; margin-top: 20px; +} +.node-info { + margin-top: 5px; + margin-bottom: 5px; +} +.node-info > p{ + margin: 0; } \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 44ee4f3..5b9374d 100644 --- a/templates/index.html +++ b/templates/index.html @@ -42,23 +42,24 @@
{{ warning }}
- {% endfor %} -{{ warning }}
+ {% endfor %} +Plain DNS: {{history.overall.plain_dns.percentage}}% uptime (last down {{history.overall.plain_dns.last_down}})
-DNS over HTTPS: {{history.overall.doh.percentage}}% uptime (last down {{history.overall.doh.last_down}})
-DNS over TLS: {{history.overall.dot.percentage}}% uptime (last down {{history.overall.dot.last_down}})
-Plain DNS: {{node.plain_dns}}
-DNS over HTTPS: {{node.doh}}
-DNS over TLS: {{node.dot}}
-Certificate: {{node.cert.valid}} (expires {{node.cert.expires}})
-Plain DNS: {{history.nodes[node.name].plain_dns.percentage}}% uptime (last down {{history.nodes[node.name].plain_dns.last_down}})
-DNS over HTTPS: {{history.nodes[node.name].doh.percentage}}% uptime (last down {{history.nodes[node.name].doh.last_down}})
-DNS over TLS: {{history.nodes[node.name].dot.percentage}}% uptime (last down {{history.nodes[node.name].dot.last_down}})
-Plain DNS: {{history.overall.plain_dns.percentage}}% uptime (last down + {{history.overall.plain_dns.last_down}})
+DNS over HTTPS: {{history.overall.doh.percentage}}% uptime (last down + {{history.overall.doh.last_down}})
+DNS over TLS: {{history.overall.dot.percentage}}% uptime (last down + {{history.overall.dot.last_down}})
+Plain DNS: {{node.plain_dns}}
+DNS over HTTPS: {{node.doh}}
+DNS over TLS: {{node.dot}}
+Certificate: {% if node.cert.valid %} Valid {% else %} Invalid {% endif %} (expires + {{node.cert.expires}})
+Plain DNS: {{history.nodes[node.name].plain_dns.percentage}}% uptime (last down + {{history.nodes[node.name].plain_dns.last_down}})
+DNS over HTTPS: {{history.nodes[node.name].doh.percentage}}% uptime (last down + {{history.nodes[node.name].doh.last_down}})
+DNS over TLS: {{history.nodes[node.name].dot.percentage}}% uptime (last down + {{history.nodes[node.name].dot.last_down}})
+{{node.name}}: {{node.ip}}
+