diff --git a/xmrnodes/app.py b/xmrnodes/app.py index efa4f74..9583273 100644 --- a/xmrnodes/app.py +++ b/xmrnodes/app.py @@ -5,6 +5,7 @@ import re import logging import click from os import makedirs +from random import shuffle from datetime import datetime, timedelta from flask import Flask, request, redirect from flask import render_template, flash, url_for @@ -27,18 +28,9 @@ app.secret_key = app.config["SECRET_KEY"] @app.route("/", methods=["GET", "POST"]) def index(): form = SubmitNode() - itp = 10 - page = request.args.get("page", 1) - try: - page = int(page) - except: - flash("Wow, wtf hackerman. Cool it.") - page = 1 - nettype = request.args.get("nettype", "mainnet") crypto = request.args.get("crypto", "monero") onion = request.args.get("onion", False) - nodes = Node.select().where( Node.validated==True ).where( @@ -51,13 +43,12 @@ def index(): if onion: nodes = nodes.where(Node.is_tor==True) - paginated = nodes.paginate(page, itp) - total_pages = int(nodes.count() / itp) + 1 + nodes = [n for n in nodes] + shuffle(nodes) + return render_template( "index.html", - nodes=paginated, - page=page, - total_pages=total_pages, + nodes=nodes, form=form ) diff --git a/xmrnodes/static/css/style.css b/xmrnodes/static/css/style.css index ccfa420..d965ce5 100644 --- a/xmrnodes/static/css/style.css +++ b/xmrnodes/static/css/style.css @@ -69,3 +69,13 @@ input[type="text"] { .current-page-btn { background-color: #b8b8b8; } + +.xmrnodes { + width: 95%; + margin: auto; + font-size: .83em; +} + +#nodes { + padding-top: 1em; +} diff --git a/xmrnodes/templates/base.html b/xmrnodes/templates/base.html index 86e8cf0..dc299e3 100644 --- a/xmrnodes/templates/base.html +++ b/xmrnodes/templates/base.html @@ -41,16 +41,21 @@ {% endif %} {% endwith %} +
+
+ Contact me + - + Source Code + - + Resources +
+ {% block content %} {% endblock %} diff --git a/xmrnodes/templates/index.html b/xmrnodes/templates/index.html index 888f9bc..da96d33 100644 --- a/xmrnodes/templates/index.html +++ b/xmrnodes/templates/index.html @@ -29,61 +29,56 @@

Find a Node

-
- {% if nodes %} - - - - - - - - - - - - - {% for node in nodes %} - - - - - - - - - {% endfor %} - -
URLAvailableNetworkHeightLast CheckedHistory
{% if node.is_tor %}{% endif %}{{ node.url }} - {% if node.available %} - - {% else %} - - {% endif %} - {{ node.nettype }}{{ node.last_height }}{{ node.datetime_checked | humanize }}{% for hc in node.healthchecks %} - {% if loop.index > loop.length - 6 %} - - {% endif %} - {% endfor %} -
-
- {% for p in range(1, total_pages + 1) %} - {{ p }} - {% endfor %} -
- {% else %} -

No nodes in the database yet...

- {% endif %} -
{% if 'onion' not in request.args %}{% endif %} -
- +
+
+ {% if nodes %} +
+ + + + + + + + + + + + + {% for node in nodes %} + + + + + + + + + {% endfor %} + +
URLAvailableNetworkHeightLast CheckedHistory
{% if node.is_tor %}{% endif %}{{ node.url }} + {% if node.available %} + + {% else %} + + {% endif %} + {{ node.nettype }}{{ node.last_height }}{{ node.datetime_checked | humanize }}{% for hc in node.healthchecks %} + {% if loop.index > loop.length - 6 %} + + {% endif %} + {% endfor %} +
+
+ {% else %} +

No nodes in the database yet...

+ {% endif %}
diff --git a/xmrnodes/templates/resources.html b/xmrnodes/templates/resources.html index 9c470c8..5ca03fe 100644 --- a/xmrnodes/templates/resources.html +++ b/xmrnodes/templates/resources.html @@ -15,8 +15,8 @@ Try out these popular Monero projects: