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 @@
- | Name | +Name | Code | Frequency | Last Ping | @@ -16,26 +16,13 @@
---|---|---|---|---|---|
- {% 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 |