From ea8e08acd215a1387d886b03093d5135a531c880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Fri, 17 Aug 2018 11:40:45 +0300 Subject: [PATCH] Log page redesign WIP --- hc/front/views.py | 5 + static/css/log.css | 71 ++++++++++++ templates/front/log.html | 150 +++++++++++++++++++++---- templates/front/my_checks_desktop.html | 7 +- 4 files changed, 209 insertions(+), 24 deletions(-) diff --git a/hc/front/views.py b/hc/front/views.py index 63f00e60..1fb886fc 100644 --- a/hc/front/views.py +++ b/hc/front/views.py @@ -336,8 +336,13 @@ def log(request, code): events = pings + list(alerts) events.sort(key=lambda el: el.created, reverse=True) + channels = Channel.objects.filter(user=request.team.user) + channels = list(channels.order_by("created")) + ctx = { "check": check, + "ping_endpoint": settings.PING_ENDPOINT, + "channels": channels, "events": events, "num_pings": min(num_pings, limit), "limit": limit, diff --git a/static/css/log.css b/static/css/log.css index 485d2062..2e4f6f9d 100644 --- a/static/css/log.css +++ b/static/css/log.css @@ -1,3 +1,74 @@ +#details-head h1 { + margin-bottom: 4px; +} + +#details-head { + margin-bottom: 24px; +} + +#details-head-actions { + text-align: right; + vertical-align: middle; + +} + +.details-block .status { + font-size: 32px; + width: 40px; +} + +.details-block { + margin-bottom: 36px; + border: 1px #aaa; + border-radius: 3px; +} + +.details-block code { + display: block; + padding: 8px; + margin-bottom: 8px; + background: #f5f5f5; +} + + +#details-status td { + padding: 8px; +} + +#log-schedule th { + padding-top: 4px; +} + +#details-integrations th { + width: 40px; + text-align: center; +} + +#log-schedule td { + padding: 4px 0 4px 8px; +} + +#log-schedule th { + vertical-align: top; + font-weight: normal; + text-align: right; +} + +#log-schedule .value { + font-weight: bold; +} + +#log-schedule .subtitle { + color: #999; +} + +#details-remove-check { + border-color: #d43f3a; + color: #d43f3a; + background: #FFF; +} + + #format-switcher-container:before { content: " "; } diff --git a/templates/front/log.html b/templates/front/log.html index a7f78bf6..5d61b981 100644 --- a/templates/front/log.html +++ b/templates/front/log.html @@ -7,28 +7,138 @@ {% block content %}
-
- +
+

+ {{ check.name_then_code }} + +

+ {% for tag in check.tags_list %} + {{ tag }} + {% endfor %} +
+ +
+
+

Description + edit +

+

This is for monitoring our fancy backup script.

+

The script runs on a $5 VM and sometimes runs out of memory and crashes. + If this happens, contact Ed and ask him to restart it.

+
+ +
+

How To Ping

+
+

Keep this check up by making HTTP requests to this URL:

+ {{ check.url }} +

Or by sending emails to this address:

+ {{ check.email }} +
+
+ + + +
+
+ +
+

Current Status

+ + + + + +
+ + + This check is down. Last ping was {{ check.last_ping|naturaltime }}. +
+
+ + +
+
+ +
+

Schedule

+ + + + + + + + + +
Period + {{ check.timeout|hc_duration }} +
+ (Expected time between pings) +
+
Grace Time + {{ check.grace|hc_duration }} +
+ (When a check is late, how long to wait until an alert is sent) +
+
+
+ +
+
+ +
+

Notification Methods

+ + {% for channel in channels %} + + + + + {% endfor %} +
+ {% if channel in check.channel_set.all %} + ON + {% else %} + OFF + {% endif %} + + + {{ channel }} +
+
+ +
+

Remove

+

Permanently remove this check from your account.

+
+ +
+
+ +
+ + + +
{% if events %} +

+ Log + Click on individual items for details +
+ + + +
+

+
{% for event in events %} diff --git a/templates/front/my_checks_desktop.html b/templates/front/my_checks_desktop.html index 81f77c02..a2c8b103 100644 --- a/templates/front/my_checks_desktop.html +++ b/templates/front/my_checks_desktop.html @@ -113,13 +113,12 @@