IW4M-Admin/Master/master/views.py

22 lines
644 B
Python
Raw Normal View History

2018-04-18 16:46:53 -04:00
"""
Routes and views for the flask application.
"""
from datetime import datetime
from flask import render_template
from master import app
2018-04-21 18:18:20 -04:00
from master.resources.history_graph import HistoryGraph
2018-04-18 16:46:53 -04:00
@app.route('/')
def home():
_history_graph = HistoryGraph().get(2880)
2018-04-18 16:46:53 -04:00
return render_template(
'index.html',
2018-04-21 18:18:20 -04:00
title='API Overview',
history_graph = _history_graph[0]['message'],
data_points = _history_graph[0]['data_points'],
instance_count = _history_graph[0]['instance_count'],
client_count = _history_graph[0]['client_count'],
server_count = _history_graph[0]['server_count']
2018-04-21 18:18:20 -04:00
)