Disabled Debug

This commit is contained in:
Kekskurse 2019-07-09 15:32:37 +02:00
parent b942305a81
commit 2491981f4d
2 changed files with 42 additions and 1 deletions

View file

@ -196,7 +196,16 @@ def function_updateAccountsAtFunk():
@app.route("/") @app.route("/")
@requires_auth @requires_auth
def hello(): def hello():
return render_template("base.html") resData = function_getAccounts()
plans = {}
plans["1 GB"] = 0;
plans["Unlimit"] = 0;
plans["Unlimit - First Day"] = 0;
plans["Break"] = 0
for account in resData:
plans[account["currentPlan"]["name"]] = plans[account["currentPlan"]["name"]] + 1;
return render_template("dashboard.html", debug=app.debug, plans=plans)
@app.route('/setup', methods=['GET']) @app.route('/setup', methods=['GET'])
@requires_auth @requires_auth

32
templates/dashboard.html Normal file
View file

@ -0,0 +1,32 @@
{% extends "base.html" %}
{% block content %}
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
<h3>Dashboard</h3>
<div class="row">
<div class="col-md-6">
<h4>Funk Manager</h4>
<p>Manage unlimit Frenet Funk Sim-Cards.</p>
</div>
<div class="col-md-6">
<h4>Sim Cards</h4>
<canvas id="doughnut-chart"></canvas>
</div>
</div>
<script>
new Chart(document.getElementById("doughnut-chart"), {
type: 'doughnut',
data: {
labels: [{% for p in plans %}'{{ p }}',{% endfor %}],
datasets: [
{
label: "Population (millions)",
backgroundColor: ["#3e95cd", "#8e5ea2","#3cba9f","#e8c3b9","#c45850"],
data: [{% for p in plans %}{{ plans[p] }},{% endfor %}]
}
]
},
options: {
}
});
</script>
{% endblock %}