summaryrefslogtreecommitdiffstats
path: root/mirrors/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2013-04-14 15:08:25 -0500
committerDan McGee <dan@archlinux.org>2013-04-14 15:08:25 -0500
commit9b07cb1ebdc8c5cc5dff66a7edb02e0ddc9f4733 (patch)
tree438a53173e4fd3e33ec8bb3ff60fda836bd1b7c2 /mirrors/views.py
parente4e88638b68ca34cc15ea5551f0e8a1a4c2e03d5 (diff)
downloadarchweb-9b07cb1ebdc8c5cc5dff66a7edb02e0ddc9f4733.tar.gz
archweb-9b07cb1ebdc8c5cc5dff66a7edb02e0ddc9f4733.zip
Draw one mirror status graph per check location
Rather than lump it all together and have odd spikes depending on which side of the Atlantic checked a mirror in a given timeslot, draw a chart per check location. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'mirrors/views.py')
-rw-r--r--mirrors/views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mirrors/views.py b/mirrors/views.py
index 30f96b63..9311fb8f 100644
--- a/mirrors/views.py
+++ b/mirrors/views.py
@@ -304,6 +304,7 @@ class LocationJSONEncoder(DjangoJSONEncoder):
return list(obj)
if isinstance(obj, CheckLocation):
return {
+ 'id': obj.pk,
'hostname': obj.hostname,
'source_ip': obj.source_ip,
'country': unicode(obj.country.name),
@@ -316,7 +317,7 @@ class LocationJSONEncoder(DjangoJSONEncoder):
def locations_json(request):
data = {}
data['version'] = 1
- data['locations'] = CheckLocation.objects.all()
+ data['locations'] = CheckLocation.objects.all().order_by('pk')
to_json = json.dumps(data, ensure_ascii=False, cls=LocationJSONEncoder)
response = HttpResponse(to_json, content_type='application/json')
return response