Changed history display method

This commit is contained in:
Davide Bongiovanni
2016-11-02 09:45:16 +01:00
parent b8bff45bec
commit af95bfa4d3
8 changed files with 1132 additions and 26 deletions
+13 -8
View File
@@ -26,13 +26,13 @@ def index():
@app.route('/status')
@requires_auth
def somehtml():
history = []
with open('history.json', 'r') as json_data:
history = json.load(json_data)
history = history[-15:]
for event in history:
event['time'] = epochFormat(event['time'])
return render_template('status.html', events = history[::-1])
#history = []
#with open('history.json', 'r') as json_data:
# history = json.load(json_data)
#history = history[-15:]
#for event in history:
# event['time'] = epochFormat(event['time'])
return render_template('status.html')
@app.route('/users')
@requires_auth
@@ -42,7 +42,12 @@ def users():
@app.route('/history')
@requires_auth
def history():
return 'You have reached history'
return render_template('history.html')
@app.route('/gethistory')
@requires_auth
def getHistory():
return send_from_directory('.', 'history.json')
@app.route('/getcardinfo/<cardID>')
@requires_auth