From 0d1d319657e7362bbb87df1973b803967fe1c132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Wed, 17 Jun 2015 13:36:56 +0300 Subject: [PATCH] Nicer indicators --- hc/front/views.py | 4 +++- static/css/style.css | 29 +++++++++++++++++++++++++++++ templates/front/index.html | 29 +++++++++-------------------- 3 files changed, 41 insertions(+), 21 deletions(-) diff --git a/hc/front/views.py b/hc/front/views.py index 9a5176bd..5503cfdf 100644 --- a/hc/front/views.py +++ b/hc/front/views.py @@ -1,5 +1,6 @@ from django.contrib.auth.decorators import login_required from django.shortcuts import redirect, render +from django.utils import timezone from hc.api.models import Check @@ -14,7 +15,8 @@ def checks(request): checks = Check.objects.filter(user=request.user).order_by("created") ctx = { - "checks": checks + "checks": checks, + "now": timezone.now } return render(request, "front/index.html", ctx) diff --git a/static/css/style.css b/static/css/style.css index 1906b7de..32633c83 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -2,6 +2,22 @@ html, body { background: #EEE; } +.glyphicon.up, .glyphicon.new, .glyphicon.down { + font-size: 22px; +} + +.glyphicon.up { + color: #5cb85c; +} + +.glyphicon.new { + color: #AAA; +} + +.glyphicon.down { + color: #d9534f; +} + #login_dialog { background: #FFF; padding: 2em; @@ -12,10 +28,23 @@ html, body { margin: 0; } +/* Checks */ + +table.table tr > th.th-name { + padding-left: 21px; +} + .setup-link { opacity: 0; } +.indicator-cell { + vertical-align: middle; +} +table.table tr.checks-row > td { + vertical-align: middle; +} + .checks-row:hover .setup-link { opacity: 1; } diff --git a/templates/front/index.html b/templates/front/index.html index e8a11386..365d203e 100644 --- a/templates/front/index.html +++ b/templates/front/index.html @@ -8,7 +8,7 @@ - + @@ -16,26 +16,13 @@ {% for check in checks %} -
NameName Code Frequency Last Ping
- {% if check.status == "up" %} -   - {% endif %} - - {% if check.status == "down" %} -   - {% endif %} - + {% if check.status == "new" %} -   + + {% elif now < check.alert_after %} + + {% else %} + {% endif %} @@ -94,4 +81,6 @@ + + {% endblock %} \ No newline at end of file