From 36f0e7c82a4babc539291b56f2852dd47488e3ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Sat, 1 Aug 2015 20:52:58 +0300 Subject: [PATCH] Transport column (http, https, email) in log --- static/js/checks.js | 8 ++++---- static/js/log.js | 3 +++ templates/front/log.html | 27 +++++++++++++++++++------- templates/front/my_checks_desktop.html | 2 +- 4 files changed, 28 insertions(+), 12 deletions(-) create mode 100644 static/js/log.js diff --git a/static/js/checks.js b/static/js/checks.js index 9d5b9036..d212e9dc 100644 --- a/static/js/checks.js +++ b/static/js/checks.js @@ -8,10 +8,10 @@ $(function () { var w = total; var result = ""; - if (w) result += w + (w == 1 ? " week " : " weeks "); - if (d) result += d + (d == 1 ? " day " : " days "); - if (h) result += h + (h == 1 ? " hour " : " hours "); - if (m) result += m + (m == 1 ? " minute " : " minutes "); + if (w) result += w + (w === 1 ? " week " : " weeks "); + if (d) result += d + (d === 1 ? " day " : " days "); + if (h) result += h + (h === 1 ? " hour " : " hours "); + if (m) result += m + (m === 1 ? " minute " : " minutes "); return result; } diff --git a/static/js/log.js b/static/js/log.js new file mode 100644 index 00000000..a7e89678 --- /dev/null +++ b/static/js/log.js @@ -0,0 +1,3 @@ +$(function () { + $('[data-toggle="tooltip"]').tooltip(); +}); \ No newline at end of file diff --git a/templates/front/log.html b/templates/front/log.html index 84ba0b33..b620b679 100644 --- a/templates/front/log.html +++ b/templates/front/log.html @@ -7,29 +7,35 @@ {% block content %}
-

Log for {{ check.name|default:check.code }}

+

Log for “{{ check.name|default:check.code }}”

{% if pings %}
+ - {% for ping in pings %} + - {% endfor %} @@ -42,3 +48,10 @@ {% endblock %} +{% block scripts %} +{% compress js %} + + + +{% endcompress %} +{% endblock %} \ No newline at end of file diff --git a/templates/front/my_checks_desktop.html b/templates/front/my_checks_desktop.html index b970143e..a34c75bd 100644 --- a/templates/front/my_checks_desktop.html +++ b/templates/front/my_checks_desktop.html @@ -53,7 +53,7 @@ {% if check.last_ping %} + title="{{ check.last_ping }} GMT"> {{ check.last_ping|naturaltime }} {% else %}
Transport Time Remote IPMethod User Agent
+ {% if ping.scheme == "email" %} + Email + {% elif ping.scheme == "http" %} + HTTP + {% elif ping.scheme == "https" %} + HTTPS + {% endif %} + - {{ ping.created }} + title="{{ ping.created }} GMT"> + {{ ping.created|naturaltime }} {{ ping.remote_addr }} - {{ ping.method }} - {{ ping.ua }}