summaryrefslogtreecommitdiffstats
path: root/ogcp/templates
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp/templates')
-rw-r--r--ogcp/templates/dashboard.html12
1 files changed, 10 insertions, 2 deletions
diff --git a/ogcp/templates/dashboard.html b/ogcp/templates/dashboard.html
index 257cfe3..bc89128 100644
--- a/ogcp/templates/dashboard.html
+++ b/ogcp/templates/dashboard.html
@@ -30,14 +30,22 @@
<td>{{ server.images | length }}</td>
<td>
{% set disk = server.disk %}
+ {% if disk['total'] != 0 %}
{% set used = (((disk['total'] - disk['free']) / disk['total']) * 100)|int %}
+ {% else %}
+ {% set used = 0 %}
+ {% endif %}
<div class="progress progress-lg">
<div class="progress-bar bg-primary" style="width: {{used}}%"></div>
</div>
</td>
<td>
{% set memory = server.stats.memory %}
+ {% if memory['size'] != 0 %}
{% set used = (((memory['size'] - memory['free']) / memory['size']) * 100)|int %}
+ {% else %}
+ {% set used = 0 %}
+ {% endif %}
<div class="progress progress-lg">
<div class="progress-bar bg-primary" style="width: {{used}}%"></div>
</div>
@@ -64,7 +72,7 @@
<hr />
<ul class="nav nav-tabs" id="serversTab" role="tablist">
-{% for id, server in servers.items() %}
+{% for id, server in servers.items() if server.online %}
<li class="nav-item" role="presentation">
<button class="nav-link {% if loop.first %}active{% endif %}" id="{{ id }}-tab" data-toggle="tab" data-target="#{{ id }}" type="button" role="tab" aria-controls="{{ id }}" aria-selected="true">
{{ server.name }}
@@ -74,7 +82,7 @@
</ul>
<div class="tab-content" id="serversTabContent">
-{% for id, server in servers.items() %}
+{% for id, server in servers.items() if server.online %}
{% set stats = server.stats %}
{% set time_dict = server.time_dict %}
{% set images = server.images %}