summaryrefslogtreecommitdiffstats
path: root/mirrors
diff options
context:
space:
mode:
Diffstat (limited to 'mirrors')
-rw-r--r--mirrors/static/mirror_status.js5
-rw-r--r--mirrors/utils.py3
-rw-r--r--mirrors/views.py2
3 files changed, 6 insertions, 4 deletions
diff --git a/mirrors/static/mirror_status.js b/mirrors/static/mirror_status.js
index 1c352a9..decc8fb 100644
--- a/mirrors/static/mirror_status.js
+++ b/mirrors/static/mirror_status.js
@@ -25,7 +25,7 @@ function mirror_status(chart_id, data_url) {
d3.max(data, function(c) { return d3.max(c.logs, function(v) { return v.check_time; }); })
]).nice(d3.time.hour);
y.domain([
- d3.min(data, function(c) { return d3.min(c.logs, function(v) { return v.duration; }); }),
+ 0,
d3.max(data, function(c) { return d3.max(c.logs, function(v) { return v.duration; }); })
]).nice();
@@ -111,6 +111,9 @@ function mirror_status(chart_id, data_url) {
return {
url: url.url,
logs: jQuery.map(url.logs, function(log, j) {
+ if (!log.is_success) {
+ return null;
+ }
return {
duration: log.duration,
check_time: new Date(log.check_time)
diff --git a/mirrors/utils.py b/mirrors/utils.py
index ba027c9..85e4ee9 100644
--- a/mirrors/utils.py
+++ b/mirrors/utils.py
@@ -41,7 +41,8 @@ def get_mirror_statuses(cutoff=DEFAULT_CUTOFF, mirror_ids=None):
success_count=Count('logs__duration'),
last_sync=Max('logs__last_sync'),
last_check=Max('logs__check_time'),
- duration_avg=Avg('logs__duration'))
+ duration_avg=Avg('logs__duration')).order_by(
+ 'mirror', 'url')
if mirror_ids:
urls = urls.filter(mirror_id__in=mirror_ids)
diff --git a/mirrors/views.py b/mirrors/views.py
index be01e91..5e374b4 100644
--- a/mirrors/views.py
+++ b/mirrors/views.py
@@ -189,8 +189,6 @@ def mirror_details_json(request, name):
status_info = get_mirror_statuses(mirror_ids=[mirror.id])
data = status_info.copy()
data['version'] = 3
- # include only URLs for this particular mirror
- data['urls'] = [url for url in data['urls'] if url.mirror_id == mirror.id]
to_json = json.dumps(data, ensure_ascii=False,
cls=ExtendedMirrorStatusJSONEncoder)
response = HttpResponse(to_json, mimetype='application/json')