Permalink
Browse files

Remove Check.last_ping_body field. CSS tweaks for the "Ping Details" …

…modal.
  • Loading branch information...
cuu508 committed Mar 18, 2018
1 parent 282412f commit 218d0c6873e9a7094768ed7e61ab5700c7174853
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-03-18 13:33
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('api', '0038_auto_20180318_1306'),
]

operations = [
migrations.RemoveField(
model_name='check',
name='last_ping_body',
),
]
@@ -70,7 +70,6 @@ class Check(models.Model):
tz = models.CharField(max_length=36, default="UTC")
n_pings = models.IntegerField(default=0)
last_ping = models.DateTimeField(null=True, blank=True)
last_ping_body = models.CharField(max_length=10000, blank=True)
has_confirmation_link = models.BooleanField(default=False)
alert_after = models.DateTimeField(null=True, blank=True, editable=False)
status = models.CharField(max_length=6, choices=STATUSES, default="new")
@@ -21,10 +21,9 @@ def test_it_requires_user(self):

def test_it_accepts_n(self):
check = Check(user=self.alice)
check.last_ping_body = "this is body"
check.save()

# remote_addr, scheme, method, ua, body):
# remote_addr, scheme, method, ua, body:
check.ping("1.2.3.4", "http", "post", "tester", "foo-123")
check.ping("1.2.3.4", "http", "post", "tester", "bar-456")

@@ -43,6 +43,10 @@
font-size: 11px;
}

#log td.actions {
white-space: nowrap;
}

#log .ok {
color: #5cb85c;
}
@@ -18,7 +18,7 @@
}

@media (min-width: 992px) {
#update-timeout-modal .modal-dialog, #last-ping-modal .modal-dialog {
#update-timeout-modal .modal-dialog, #ping-details-modal .modal-dialog {
width: 800px;
}
}
@@ -68,7 +68,7 @@
{{ event.ua }}
</td>

<td>
<td class="actions">
{% if event.body %}
<a href="#" class="details-btn" data-url="{% url 'hc-ping-details' check.code event.n %}">show body</a>
{% endif %}
@@ -86,7 +86,7 @@
<span class="time"></span>
</div>
</td>
<td colspan="3" class="alert-info">
<td colspan="4" class="alert-info">
{% if event.channel.kind == "email" %}
Sent email alert to {{ event.channel.value }}
{% elif event.channel.kind == "slack" %}
@@ -7,23 +7,49 @@ <h3>Ping #{{ ping.n }}</h3>
<strong>Time Received</strong>
<code>{{ ping.created.isoformat }}</code>
</p>
</div>
{% if ping.remote_addr %}
<div class="col-sm-6">
<p>
<strong>Source</strong>
{% if ping.scheme == "email" %}
{{ ping.ua }}
{% else %}
{{ ping.scheme|upper }} {{ ping.method }} from {{ ping.remote_addr }}
{% endif %}
<strong>Client IP</strong>
{{ ping.remote_addr }}
</p>
</div>
{% endif %}

{% if ping.scheme %}
<div class="col-sm-6">
<p>
<strong>Protocol</strong>
{{ ping.scheme }}
</p>
</div>
{% if ping.scheme != "email" %}
{% endif %}

{% if ping.method %}
<div class="col-sm-6">
<p>
<strong>Method</strong>
{{ ping.method }}
</p>
</div>
{% endif %}

{% if ping.scheme == "email" %}
<div class="col-sm-6">
<p>
<strong>From</strong>
{{ ping.ua }}
</p>
</div>
{% else %}
<div class="col-sm-12">
<p>
<strong>User Agent</strong>
<span class="ua">{{ ping.ua }}</span>
</p>
</div>

{% endif %}
</div>
{% if ping.body %}

0 comments on commit 218d0c6

Please sign in to comment.