1
0
mirror of https://gitlab.com/JKANetwork/CheckServer.git synced 2026-02-21 20:43:47 +01:00

Fix for new tests at index

This commit is contained in:
2018-01-09 23:34:50 +01:00
parent 5e33adbbaf
commit 0aeaada922
2 changed files with 24 additions and 23 deletions

View File

@@ -31,11 +31,12 @@
{# "Switch" type #} {# "Switch" type #}
{% if check.ID_TC == 1 or check.ID_TC == 2 or check.ID_TC == 4 %} {# Ping, HttpCode, SQL DB #} {% if check.ID_TC == 1 or check.ID_TC == 2 or check.ID_TC == 4 %} {# Ping, HttpCode, SQL DB #}
{% if check.uptime != -1 %}{#Only if records exists#}
<td> <td>
<span class='{{check.statusColor}}' data-tooltip='Type of check: {{check.nameCheck}}' data-tooltip-position='top'>{{check.statusText}}</span> <span class='{{check.statusColor}}' data-tooltip='Type of check: {{check.nameCheck}}' data-tooltip-position='top'>{{check.statusText}}</span>
({{ check.uptime}}%) ({{ check.uptime}}%)
</td> </td>
{% if check.uptime != -1 %}{#Only if records exists#}
<td> <td>
{{check.dateLastChk}} - {{check.dateLastChk}} -
{% if check.failedLastChk == 0 %} {% if check.failedLastChk == 0 %}
@@ -44,8 +45,8 @@
<span style="color:red">{{T_.failed}}</span> <span style="color:red">{{T_.failed}}</span>
{% endif %} {% endif %}
</td> </td>
{%else%} {%else%} {#If not records yet#}
<td>Dame tiempo para recopilar estadísticas</td> <td colspan="2">Dame tiempo para recopilar estadísticas</td>
{%endif%} {%endif%}
<td> <td>
{%if check.dateLastErr is not null%} {%if check.dateLastErr is not null%}
@@ -54,7 +55,6 @@
{{T_.no_errs}} {{T_.no_errs}}
{%endif%} {%endif%}
</td> </td>
{% endif %} {% endif %}
{% if check.ID_TC == 3 %} {% if check.ID_TC == 3 %}
<td colspan="3"> <td colspan="3">

View File

@@ -14,8 +14,9 @@ while ($onechk = dbw_fetch_array($db_conn,$results)){
$idchk = $onechk['ID_C']; $idchk = $onechk['ID_C'];
$chks[$idchk] = $onechk; //First array data $chks[$idchk] = $onechk; //First array data
$chks[$idchk]['nameGroup'] = $groups[$onechk['ID_G']]; //Know group of this check $chks[$idchk]['nameGroup'] = $groups[$onechk['ID_G']]; //Know group of this check
$ID_TC = $chks[$idchk]['ID_TC']; //Type of Check
switch ($chks[$idchk]['ID_TC']){ switch ($ID_TC){
// Case 1 and 2 are normal status, case 3 (Visits) is numeric, not status // Case 1 and 2 are normal status, case 3 (Visits) is numeric, not status
case 1: //Ping case 1: //Ping
case 2: //HttpCode case 2: //HttpCode
@@ -34,7 +35,6 @@ while ($onechk = dbw_fetch_array($db_conn,$results)){
$chks[$idchk]['dateLastErr'] = date('d/m H:i',$lastErr); $chks[$idchk]['dateLastErr'] = date('d/m H:i',$lastErr);
} }
$ID_TC = $chks[$idchk]['ID_TC'];
$chks[$idchk]['nameCheck'] = textTypeChk($ID_TC); $chks[$idchk]['nameCheck'] = textTypeChk($ID_TC);
if ($onechk['manStatus'] != ''){ if ($onechk['manStatus'] != ''){
@@ -43,7 +43,8 @@ while ($onechk = dbw_fetch_array($db_conn,$results)){
$chks[$idchk]['uptime'] = getUptime($idchk); $chks[$idchk]['uptime'] = getUptime($idchk);
} }
list($chks[$idchk]['statusText'],$chks[$idchk]['statusColor']) = getStatus($idchk); list($chks[$idchk]['statusText'],$chks[$idchk]['statusColor']) = getStatus($idchk);
}else{
$chks[$idchk]['uptime'] = -1; //Anything collected yet
} }
break; break;