From f211e5cabbc5735ba3bdd1fd0b538403e0b8ee99 Mon Sep 17 00:00:00 2001 From: Hemna Date: Wed, 24 Mar 2021 10:45:03 -0400 Subject: [PATCH] Added aprsd web index page This patch adds an index page for the flask web server that users can hit at / --- aprsd/flask.py | 5 ++-- aprsd/web/templates/index.html | 42 +++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/aprsd/flask.py b/aprsd/flask.py index d6136b2..f0dbf39 100644 --- a/aprsd/flask.py +++ b/aprsd/flask.py @@ -40,8 +40,7 @@ class APRSDFlask(flask_classful.FlaskView): users = self.users def index(self): - return "Hello" - # return flask.render_template("index.html", message=msg) + return flask.render_template("index.html", message=self.stats()) @auth.login_required def messages(self): @@ -89,7 +88,7 @@ def init_flask(config): ) server = APRSDFlask() server.set_config(config) - # flask_app.route('/', methods=['GET'])(server.index) + flask_app.route("/", methods=["GET"])(server.index) flask_app.route("/stats", methods=["GET"])(server.stats) flask_app.route("/messages", methods=["GET"])(server.messages) flask_app.route("/save", methods=["GET"])(server.save) diff --git a/aprsd/web/templates/index.html b/aprsd/web/templates/index.html index dc09bc0..d016f1c 100644 --- a/aprsd/web/templates/index.html +++ b/aprsd/web/templates/index.html @@ -1,4 +1,44 @@ + + -

{{ message }}

+ + + + + + + + + + +
{{ stats }}
+ +