Add colors to status page to make it easy to spot problems
authorChristian Weiske <cweiske@cweiske.de>
Fri, 21 Apr 2017 15:15:53 +0000 (17:15 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 21 Apr 2017 15:19:53 +0000 (17:19 +0200)
Resolves: https://github.com/cweiske/phinde/issues/30

data/templates/status.htm

index fb8daf3..b4cf71d 100644 (file)
@@ -12,7 +12,7 @@
   <div class="span6 offset3">
 
 <h1>phinde status</h1>
-<table class="table table-striped">
+<table class="table">
  <thead>
   <tr>
    <th>Group</th>
@@ -22,7 +22,7 @@
  </thead>
  <tbody>
   <tr>
-   <td rowspan="2">Elasticsearch</td>
+   <th rowspan="2">Elasticsearch</th>
    <td>Documents</td>
    <td style="text-align: right">{{esStatus.documents_human}}</td>
   </tr>
@@ -31,8 +31,8 @@
    <td style="text-align: right">{{esStatus.size_human}}</td>
   </tr>
 
-  <tr>
-   <td rowspan="3">Gearman</td>
+  <tr class="{%if 0 > gearStatus.tasks %}warning{%endif%}">
+   <th rowspan="3">Gearman</th>
    <td>Open tasks</td>
    <td style="text-align: right">{{gearStatus.tasks}}</td>
   </tr>
    <td>Tasks being processed</td>
    <td style="text-align: right">{{gearStatus.processing}}</td>
   </tr>
-  <tr>
+  <tr class="{%if 0 >= gearStatus.workers %}error{%endif%}">
    <td>Task workers</td>
    <td style="text-align: right">{{gearStatus.workers}}</td>
   </tr>
 
   <tr>
-   <td rowspan="{{subCount|length + 1}}">Subscriptions</td>
+   <th rowspan="{{subCount|length + 1}}">Subscriptions</th>
    <td>Total</td>
    <td style="text-align: right">{{subSum}}</td>
   </tr>
   {% for key, number in subCount %}
-  <tr>
+  <tr class="{%if key == 'subscribing' and number > 0 %}warning{%endif%}">
    <td>{{key}}</td>
    <td style="text-align: right">{{number}}</td>
   </tr>