From e6733cd93907465bf232c9a25a47990a29303bda Mon Sep 17 00:00:00 2001 From: lza_menace Date: Sun, 11 Jun 2023 00:36:54 -0700 Subject: [PATCH] electric banana --- xmrnodes/cli.py | 16 ++-- xmrnodes/routes/meta.py | 10 +++ xmrnodes/static/css/main.css | 6 +- xmrnodes/templates/index.html | 139 ++++++++++++++++++---------------- 4 files changed, 97 insertions(+), 74 deletions(-) diff --git a/xmrnodes/cli.py b/xmrnodes/cli.py index 67830b7..71172e0 100644 --- a/xmrnodes/cli.py +++ b/xmrnodes/cli.py @@ -79,14 +79,14 @@ def check_node(_node): node.datetime_checked = now node.save() hc.save() - if ( - node.get_failed_checks().count() == node.get_all_checks().count() - and node.get_all_checks().count() > 5 - ): - print("this node fails all of its health checks - deleting it!") - for _hc in node.get_all_checks(): - _hc.delete_instance() - node.delete_instance() + # if ( + # node.get_failed_checks().count() == node.get_all_checks().count() + # and node.get_all_checks().count() > 5 + # ): + # print("this node fails all of its health checks - deleting it!") + # for _hc in node.get_all_checks(): + # _hc.delete_instance() + # node.delete_instance() @bp.cli.command("get_peers") diff --git a/xmrnodes/routes/meta.py b/xmrnodes/routes/meta.py index c51c49b..e78b392 100644 --- a/xmrnodes/routes/meta.py +++ b/xmrnodes/routes/meta.py @@ -55,6 +55,15 @@ def index(): nodes = [n for n in nodes] shuffle(nodes) + countries = {} + for node in nodes: + c = node.country_code + if c is None: + c = '??' + if c not in countries: + countries[c] = 0 + countries[c] += 1 + return render_template( "index.html", nodes=nodes, @@ -64,6 +73,7 @@ def index(): crypto=crypto, form=form, web_compatible=web_compatible, + countries=countries ) diff --git a/xmrnodes/static/css/main.css b/xmrnodes/static/css/main.css index f7084c2..24f979b 100644 --- a/xmrnodes/static/css/main.css +++ b/xmrnodes/static/css/main.css @@ -5,6 +5,10 @@ body { font-size: 14px; } +.checkbox:hover, .radio:hover { + color: #f9f9f9; +} + .media-content .title { color: #1B2432; } @@ -59,7 +63,7 @@ body { } #addNodeForm { - width: 50%; + width: 80%; } #webCompat { diff --git a/xmrnodes/templates/index.html b/xmrnodes/templates/index.html index 82c1cef..2d59fd2 100644 --- a/xmrnodes/templates/index.html +++ b/xmrnodes/templates/index.html @@ -3,72 +3,82 @@ {% block content %} -
- -
-

Add A Node

-
- {{ form.csrf_token }} +
+ +
+
+

Add A Node

+ + {{ form.csrf_token }} +
+
+ +
+
+
+
+ +
+
+
    + {% for field, errors in form.errors.items() %} +
  • {{ form[field].label }}: {{ ', '.join(errors) }}
  • + {% endfor %} +
+ +
+
+

Find a Node

+
- +
+ +
+
+ +
+ + +
+
+ Cancel +
-
    - {% for field, errors in form.errors.items() %} -
  • {{ form[field].label }}: {{ ', '.join(errors) }}
  • - {% endfor %} -
-
-
- -
-

Find a Node

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - -
+
- {% if nodes %} -
+
+ {% if (nodes | length) == 0 %} +
+

No nodes in the database yet...

+
+ {% else %} +
+

Nodes

{% if web_compatible %}

@@ -76,7 +86,7 @@ The more nodes there are running with these settings the more robust web clients will be in the future.
{% endif %} - Download HAProxy config

+ Tracking {{ nodes_all }} {{ nettype }} {{ crypto | capitalize }} nodes in the database.
Of those, {{ nodes_unhealthy }} nodes failed their last check-in (unresponsive to ping or over 500 blocks away from highest reported block). @@ -88,11 +98,18 @@ Show Active {% endif %}

+ + {% for country in countries %} + + + {{ country }} + ({{ countries[country] }}) + + {% endfor %} +
-
-
{% for node in nodes %}
@@ -200,17 +217,9 @@
-
- - - -
- {% else %} -

No nodes in the database yet...

{% endif %}