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