Skip to content

Commit

Permalink
[Fix #155965538] add support for unresolved checks in mobile template
Browse files Browse the repository at this point in the history
  • Loading branch information
younggeeks committed Apr 5, 2018
1 parent 2403fb4 commit 8814861
Showing 1 changed file with 104 additions and 1 deletion.
105 changes: 104 additions & 1 deletion templates/front/my_checks_mobile.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,105 @@
{% load hc_extras humanize %}
<div class="tab-content">
<div class="tab-pane active" id="ok">
{% if up %}
<ul id="checks-list" class="visible-xs">
{% for check in up %}
<li>
<h2>
<span class="{% if not check.name %}unnamed{% endif %}">
{{ check.name|default:"unnamed" }}
</span>

<code>{{ check.code }}</code>
</h2>

<a
href="#"
class="btn remove-link check-menu-remove"
data-name="{{ check.name_then_code }}"
data-url="{% url 'hc-remove-check' check.code %}">
<span class="icon-close"></span>
</a>

<table class="table">
<tr>
<th>Status</th>
<td>
{% if check.get_status == "new" %}
<span class="label label-default">NEW</span>
{% elif check.get_status == "paused" %}
<span class="label label-default">PAUSED</span>
{% elif check.in_grace_period %}
<span class="label label-warning">LATE</span>
{% elif check.get_status == "up" %}
<span class="label label-success">UP</span>
{% elif check.get_status == "down" %}
<span class="label label-danger">DOWN</span>
{% endif %}
</td>
</tr>
{% if check.tags %}
<tr>
<th>Tags</th>
<td>
{% for tag in check.tags_list %}
<span class="label label-tag">{{ tag }}</span>
{% endfor %}
</td>
</tr>
{% endif %}
<tr>
<th>Period</th>
<td>{{ check.timeout|hc_duration }}</td>
</tr>
<tr>
<th>Grace Time</th>
<td>{{ check.grace|hc_duration }}</td>
</tr>
<tr>
<th>Last Ping</th>
<td>
{% if check.last_ping %}
{{ check.last_ping|naturaltime }}
{% else %}
Never
{% endif %}
</td>
</tr>
</table>


<div>
<a
href="#"
data-name="{{ check.name }}"
data-tags="{{ check.tags }}"
data-url="{% url 'hc-update-name' check.code %}"
class="btn btn-default my-checks-name">
Rename
</a>

<a
href="#"
data-url="{% url 'hc-update-timeout' check.code %}"
data-timeout="{{ check.timeout.total_seconds }}"
data-grace="{{ check.grace.total_seconds }}"
class="btn btn-default timeout-grace">Change Period</a>

<a href="{% url 'hc-log' check.code %}" class="btn btn-default">Log</a>
</div>

</li>
{% endfor %}
</ul>
{% else %}
<div class="alert alert-info">You don't have any running checks.</div>
{% endif %}
</div>
<div class="tab-pane" id="unresolved">
{% if unresolved %}
<ul id="checks-list" class="visible-xs">
{% for check in checks %}
{% for check in unresolved %}
<li>
<h2>
<span class="{% if not check.name %}unnamed{% endif %}">
Expand Down Expand Up @@ -90,3 +188,8 @@ <h2>
</li>
{% endfor %}
</ul>
{% else %}
<div class="alert alert-info">You don't have any running checks.</div>
{% endif %}
</div>
</div>

0 comments on commit 8814861

Please sign in to comment.