1
0
mirror of https://gitlab.com/JKANetwork/CheckServer.git synced 2026-02-22 21:13:46 +01:00

Optimize index and fix delete older checks from hist

This commit is contained in:
2017-12-16 20:17:00 +01:00
parent 1be1751a3d
commit a44f87cea4
24 changed files with 262 additions and 158 deletions

View File

@@ -32,16 +32,16 @@
{# "Switch" type #}
{% if check.ID_TC == 1 or check.ID_TC == 2 or check.ID_TC == 4 %} {# Ping, HttpCode, SQL DB #}
<td>
{#IF/SWITCH status text#}
{%if check.status == 0%}
{#IF/SWITCH uptime to text#}
{%if check.uptime <= 100 and check.uptime > 90 %}
<span class='green' data-tooltip='Type of check: {{check.nameCheck}}' data-tooltip-position='top'>{{T_.status_right}}</span>
{%elseif check.status == 1%}
{%elseif check.uptime <= 95 and check.uptime > 60 %}
<span class='blue' data-tooltip='Type of check: {{check.nameCheck}}' data-tooltip-position='top'>{{T_.status_lproblems}}</span>
{%elseif check.status == 2%}
{%elseif check.uptime <= 60 and check.uptime > 15 %}
<span class='orange' data-tooltip='Type of check: {{check.nameCheck}}' data-tooltip-position='top'>{{T_.status_problems}}</span>
{%elseif check.status == 3%}
{%elseif check.uptime <= 15 and check.uptime >= 0 %}
<span class='red' data-tooltip='Type of check: {{check.nameCheck}}' data-tooltip-position='top'>{{T_.status_outofserv}}</span>
{%elseif check.status == 4%}
{%elseif check.uptime == 255 %}
<span class='blue' data-tooltip='Type of check: {{check.nameCheck}}' data-tooltip-position='top'>{{T_.status_maintenance}}</span>
{%else%}
<span class='grey' data-tooltip='Type of check: {{check.nameCheck}}' data-tooltip-position='top'>{{T_.status_empty}}</span>
@@ -49,7 +49,7 @@
{#END IF/SWITCH#}
({{ check.uptime}}%)
</td>
{% if check.status is defined %}{#Only if records exists#}
{% if check.uptime != -1 %}{#Only if records exists#}
<td>
{{check.dateLastChk}} -
{% if check.failedLastChk == 0 %}

View File

@@ -38,10 +38,11 @@
<td>{{check.name}}</td>
<td>{{check.nameTCheck}} - {{check.URL}}</td>
<td>
<a href="?page=viewhist&ID_C={{check.ID_C}}" class="btn btn-info">{{T_.view_hist}}</a>
{% if you.fullRights == 1 %}
<a href="?page=editcheck&ID_C={{check.ID_C}}" class="btn btn-primary">{{T_.edit}}</a>
{% if check.ID_TC == 3 %}{#Visitas#}
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#countercode_{{check.ID_C}}">Código del contador</button>
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#countercode_{{check.ID_C}}">Código del contador</button>
{% elseif check.ID_TC == 4 %}{#Database#}
<a href="#" data-toggle="modal" data-target="#dbcode_{{check.ID_C}}" class="btn btn-info">Codigo para check database</a>

View File

@@ -10,18 +10,18 @@
<div class="col-lg-12">
<div class="card">
<div class="card-block">
<form class="form-horizontal" method="POST" action="?page=saveopts">
<form class="form-horizontal" method="POST" action="?page=savesettings">
<div class="form-group row">
<label class="col-sm-2">Nombre de la web</label>
<div class="col-sm-10">
<input name="name" type="text" placeholder="Nombre del check" value="{{sys.name}}" class="form-control form-control-success"><small class="form-text">Nombre para sacar en titulos.</small>
<input name="name" type="text" placeholder="Nombre de la web" value="{{sys.name}}" class="form-control form-control-success"><small class="form-text">Nombre para sacar en titulos.</small>
</div>
</div>
<div class="form-group row">
<label class="col-sm-2">Cantidad de resultados (Individuales) a guardar en historial por cada check</label>
<label class="col-sm-2">Cantidad de tiempo a guardar historial de resultados en días.</label>
<div class="col-sm-10">
<input name="maxChecksSave" type="numeric" placeholder="Nombre del check" value="{{sys.maxChecksSave}}" class="form-control form-control-success"><small class="form-text">300 es un buen numero</small>
<input name="maxTimeSave" type="numeric" placeholder="Nombre del check" value="{{sys.maxTimeSave}}" class="form-control form-control-success"><small class="form-text">Por defecto, dos semanas</small>
</div>
</div>

View File

@@ -37,4 +37,5 @@ $T_['HTTP_CODE'] = 'Http code';
$T_['VISIT_COUNT'] = 'Visit counter';
$T_['DATABASE'] = 'Database check';
$T_['add_grp_to_add_chk'] = 'Add a group for start adding checks';
$T_['view_hist'] = 'View history';
?>

View File

@@ -37,4 +37,5 @@ $T_['HTTP_CODE'] = 'Código HTTP';
$T_['VISIT_COUNT'] = 'Contador de visitas';
$T_['DATABASE'] = 'Conexión a base de datos';
$T_['add_grp_to_add_chk'] = 'Añade un grupo para empezar a añadir checks';
$T_['view_hist'] = 'Ver histórico';
?>