From c3f185cea6b9d0baf822c0d40cce9991d4c0a354 Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Fri, 4 May 2018 13:20:46 +0200 Subject: [PATCH] Add minimal admin interface --- at.py | 9 ++++++++- templates/admin.html | 13 +++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 templates/admin.html diff --git a/at.py b/at.py index 05d78a0..6839c60 100644 --- a/at.py +++ b/at.py @@ -15,7 +15,7 @@ from time import sleep, time, mktime from collections import namedtuple from urllib import urlencode -from spaceauth import SpaceAuth, login_required, current_user +from spaceauth import SpaceAuth, login_required, current_user, cap_required app = Flask('at') app.config.from_pyfile('at.cfg') @@ -356,6 +356,13 @@ def device(id, action): return redirect(url_for('account')) +@app.route('/admin') +@cap_required('staff') +def admin(): + data = now_at() + return render_template('admin.html', data=data) + + @app.before_first_request def setup(): updater = DhcpdUpdater(app.config['LEASE_FILE'], app.config['TIMEOUT'], diff --git a/templates/admin.html b/templates/admin.html new file mode 100644 index 0000000..c2fcb4b --- /dev/null +++ b/templates/admin.html @@ -0,0 +1,13 @@ +{% extends "basic.html" %} +{% block content %} + + + + + + {% for key, l in data.items() %} + {% for item in l %} + + {% endfor %} + {% endfor %} +{% endblock %}
MACDevice type
{{ item }}{{ key }}