Commit 3d076aba authored by Praibait's avatar Praibait

Fix bugs stats_pot

parent bee24896
......@@ -339,14 +339,17 @@ def toggle_transaction(request):
def stats_pot(request, idpot = None):
if (request.method == "GET") or (request.session.get("logged", None) != "ok"):
return HttpResponse("Get the fuck out of here", status=44)
return HttpResponse("Get the fuck out of here", status=444)
else:
success, sock_ou_response = nk.socket_still_alive(request)
if success:
sock = sock_ou_response
sock.write(json.dumps(["stats_entree_pot", idpot]))
out = nk.full_read(sock)["msg"]
out = [ [l[0], l[1]] for l in out]
return HttpResponse(json.dumps(out))
if out:
out = [ [l[0], l[1]] for l in out]
return HttpResponse(json.dumps(out))
else:
return HttpResponse(u'"Bad request"', status=400)
else:
return HttpResponse(u'"Erreur"')
......@@ -25,8 +25,7 @@
<h3>Graphiques d'entrées</h3>
{% endif %}
<select id="selecteur">
<option value=-1 selected></option>
<option value=1790>1790</option>
<option value=1790 selected>1790</option>
<option value=1754>1754</option>
<select/>
<div id="container" style="width:50%; height:400px;"></div>
......@@ -101,6 +100,8 @@ function change_pot() {
}
change_pot();
function affiche_stats(liste) {
var max = liste[liste.length-1][1];
$(function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment