forked from GithubBackups/healthchecks
/checks/status/ sends smaller payload.
This commit is contained in:
parent
8d6a694711
commit
639249a395
@ -35,8 +35,7 @@
|
|||||||
#checks-table .my-checks-name,
|
#checks-table .my-checks-name,
|
||||||
#checks-table .integrations,
|
#checks-table .integrations,
|
||||||
#checks-table .timeout-grace,
|
#checks-table .timeout-grace,
|
||||||
#checks-table .last-ping,
|
#checks-table .last-ping {
|
||||||
#checks-table .last-ping-never {
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0);
|
border: 1px solid rgba(0, 0, 0, 0);
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
}
|
}
|
||||||
|
@ -188,13 +188,21 @@ $(function () {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".last-ping-cell").on("click", ".last-ping", function() {
|
$(".last-ping").on("click", function() {
|
||||||
|
if (this.innerText == "Never") {
|
||||||
|
showUsage(this);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$("#ping-details-body").text("Updating...");
|
$("#ping-details-body").text("Updating...");
|
||||||
$('#ping-details-modal').modal("show");
|
$('#ping-details-modal').modal("show");
|
||||||
|
|
||||||
|
var code = $(this).closest("tr").data("code");
|
||||||
|
var url = "/checks/" + code + "/last_ping/";
|
||||||
|
|
||||||
var token = $('input[name=csrfmiddlewaretoken]').val();
|
var token = $('input[name=csrfmiddlewaretoken]').val();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: this.dataset.url,
|
url: url,
|
||||||
type: "post",
|
type: "post",
|
||||||
headers: {"X-CSRFToken": token},
|
headers: {"X-CSRFToken": token},
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
@ -270,15 +278,17 @@ $(function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".usage-examples").click(function(e) {
|
function showUsage(el) {
|
||||||
var a = e.target;
|
var tr = $(el).closest("tr");
|
||||||
var url = a.getAttribute("data-url");
|
|
||||||
var email = a.getAttribute("data-email");
|
|
||||||
|
|
||||||
$(".ex", "#show-usage-modal").text(url);
|
$(".ex", "#show-usage-modal").text(tr.data("url"));
|
||||||
$(".em", "#show-usage-modal").text(email);
|
$(".em", "#show-usage-modal").text(tr.data("email"));
|
||||||
|
|
||||||
$("#show-usage-modal").modal("show");
|
$("#show-usage-modal").modal("show");
|
||||||
|
}
|
||||||
|
|
||||||
|
$(".usage-examples").click(function(e) {
|
||||||
|
showUsage(e.target);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
{% load humanize %}
|
{% load humanize %}
|
||||||
|
|
||||||
{% if check.last_ping %}
|
{% if check.last_ping %}
|
||||||
<div class="last-ping" data-url="{% url 'hc-last-ping' check.code %}">
|
|
||||||
{{ check.last_ping|naturaltime }}
|
{{ check.last_ping|naturaltime }}
|
||||||
{% if check.has_confirmation_link %}
|
{% if check.has_confirmation_link %}
|
||||||
<br /><span class="label label-confirmation">confirmation link</span>
|
<br /><span class="label label-confirmation">confirmation link</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="last-ping-never">Never</div>
|
Never
|
||||||
{% endif %}
|
{% endif %}
|
@ -41,7 +41,12 @@
|
|||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for check in checks %}
|
{% for check in checks %}
|
||||||
<tr class="checks-row">
|
<tr
|
||||||
|
class="checks-row"
|
||||||
|
data-code="{{ check.code }}"
|
||||||
|
data-url="{{ check.url }}"
|
||||||
|
data-email="{{ check.email }}">
|
||||||
|
|
||||||
<td class="indicator-cell">
|
<td class="indicator-cell">
|
||||||
{% if check.in_grace_period %}
|
{% if check.in_grace_period %}
|
||||||
<span id="si-{{ check.code }}" class="status icon-grace" data-toggle="tooltip"></span>
|
<span id="si-{{ check.code }}" class="status icon-grace" data-toggle="tooltip"></span>
|
||||||
@ -108,8 +113,10 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td id="lpd-{{ check.code}}" class="last-ping-cell">
|
<td>
|
||||||
|
<div id="lpd-{{ check.code}}" class="last-ping">
|
||||||
{% include "front/last_ping_cell.html" with check=check %}
|
{% include "front/last_ping_cell.html" with check=check %}
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="check-menu dropdown">
|
<div class="check-menu dropdown">
|
||||||
@ -131,13 +138,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a href="#" class="usage-examples">Usage Examples</a>
|
||||||
href="#"
|
|
||||||
class="usage-examples"
|
|
||||||
data-url="{{ check.url }}"
|
|
||||||
data-email="{{ check.email }}">
|
|
||||||
Usage Examples
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
<li role="separator" class="divider"></li>
|
<li role="separator" class="divider"></li>
|
||||||
<li>
|
<li>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user