mirror of
https://github.com/searxng/searxng
synced 2024-11-05 06:01:05 +00:00
[fix] offline engines: fix templates /stats and /preferences
This commit is contained in:
parent
3014463fed
commit
99aaf86b73
@ -25,11 +25,13 @@
|
|||||||
<td class="{{ label }}" style="padding: 2px">{{- "" -}}
|
<td class="{{ label }}" style="padding: 2px">{{- "" -}}
|
||||||
{%- if stats[engine_name].time != None -%}
|
{%- if stats[engine_name].time != None -%}
|
||||||
<span class="stacked-bar-chart-value">{{- stats[engine_name].time -}}</span>{{- "" -}}
|
<span class="stacked-bar-chart-value">{{- stats[engine_name].time -}}</span>{{- "" -}}
|
||||||
<span class="stacked-bar-chart" aria-labelledby="{{engine_name}}_chart" aria-hidden="true">{{- "" -}}
|
<span class="stacked-bar-chart" aria-labelledby="{{engine_name}}_chart" aria-hidden="true">
|
||||||
|
{%- if max_rate95 is not none and max_rate95 > 0 -%}
|
||||||
<span style="width: calc(max(2px, 100%*{{ (stats[engine_name].time / max_rate95)|round(3) }}))" class="stacked-bar-chart-median"></span>{{- "" -}}
|
<span style="width: calc(max(2px, 100%*{{ (stats[engine_name].time / max_rate95)|round(3) }}))" class="stacked-bar-chart-median"></span>{{- "" -}}
|
||||||
<span style="width: calc(100%*{{ ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate80"></span>{{- "" -}}
|
<span style="width: calc(100%*{{ ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate80"></span>{{- "" -}}
|
||||||
<span style="width: calc(100%*{{ ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate95"></span>{{- "" -}}
|
<span style="width: calc(100%*{{ ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate95"></span>{{- "" -}}
|
||||||
<span class="stacked-bar-chart-rate100"></span>{{- "" -}}
|
<span class="stacked-bar-chart-rate100"></span>
|
||||||
|
{%- endif -%}
|
||||||
</span>{{- "" -}}
|
</span>{{- "" -}}
|
||||||
<div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_graph">{{- "" -}}
|
<div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_graph">{{- "" -}}
|
||||||
<p>{{ _('Median') }}: {{ stats[engine_name].time }}</p>{{- "" -}}
|
<p>{{ _('Median') }}: {{ stats[engine_name].time }}</p>{{- "" -}}
|
||||||
|
@ -52,11 +52,11 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</td>
|
</td>
|
||||||
<td class="response-time">
|
<td class="response-time">
|
||||||
{%- if engine_stat.total -%}
|
{%- if engine_stat.total is not none -%}
|
||||||
<div class="bar-chart-value">{{- engine_stat.total | round(1) -}}</div>{{- "" -}}
|
<div class="bar-chart-value">{{- engine_stat.total | round(1) -}}</div>{{- "" -}}
|
||||||
<div class="bar-chart-graph" aria-labelledby="{{engine_stat.name}}_time" aria-hidden="true">{{- "" -}}
|
<div class="bar-chart-graph" aria-labelledby="{{engine_stat.name}}_time" aria-hidden="true">{{- "" -}}
|
||||||
<div class="bar-chart-serie1 bar{{ (100 * engine_stat.http / engine_stats.max_time)|round }}"></div>{{- "" -}}
|
{% if engine_stat.http is not none and engine_stats.max_time %}<div class="bar-chart-serie1 bar{{ (100 * engine_stat.http / engine_stats.max_time)|round }}"></div>{%- endif -%}
|
||||||
<div class="bar-chart-serie2 bar{{ (100 * engine_stat.processing / engine_stats.max_time)|round }}"></div>{{- "" -}}
|
{% if engine_stat.processing is not none and engine_stats.max_time %}<div class="bar-chart-serie2 bar{{ (100 * engine_stat.processing / engine_stats.max_time)|round }}"></div>{%- endif -%}
|
||||||
</div>
|
</div>
|
||||||
<div class="engine-tooltip text-left" role="tooltip" id="{{engine_stat.name}}_time">{{- "" -}}
|
<div class="engine-tooltip text-left" role="tooltip" id="{{engine_stat.name}}_time">{{- "" -}}
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
@ -69,19 +69,19 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="col">{{ _('Median') }}</th>
|
<th scope="col">{{ _('Median') }}</th>
|
||||||
<td>{{ engine_stat.total }}</td>
|
<td>{{ engine_stat.total }}</td>
|
||||||
<td>{{ engine_stat.http }}</td>
|
<td>{{ engine_stat.http or '' }}</td>
|
||||||
<td>{{ engine_stat.processing }}</td>
|
<td>{{ engine_stat.processing }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">{{ _('P80') }}</th>
|
<th scope="col">{{ _('P80') }}</th>
|
||||||
<td>{{ engine_stat.total_p80 }}</td>
|
<td>{{ engine_stat.total_p80 }}</td>
|
||||||
<td>{{ engine_stat.http_p80 }}</td>
|
<td>{{ engine_stat.http_p80 or '' }}</td>
|
||||||
<td>{{ engine_stat.processing_p80 }}</td>
|
<td>{{ engine_stat.processing_p80 }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">{{ _('P95') }}</th>
|
<th scope="col">{{ _('P95') }}</th>
|
||||||
<td>{{ engine_stat.total_p95 }}</td>
|
<td>{{ engine_stat.total_p95 }}</td>
|
||||||
<td>{{ engine_stat.http_p95 }}</td>
|
<td>{{ engine_stat.http_p95 or '' }}</td>
|
||||||
<td>{{ engine_stat.processing_p95 }}</td>
|
<td>{{ engine_stat.processing_p95 }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
@ -39,11 +39,13 @@
|
|||||||
<td class="{{ label }}" style="padding: 2px; width: 13rem;">{{- "" -}}
|
<td class="{{ label }}" style="padding: 2px; width: 13rem;">{{- "" -}}
|
||||||
{%- if stats[engine_name].time != None -%}
|
{%- if stats[engine_name].time != None -%}
|
||||||
<span class="stacked-bar-chart-value">{{- stats[engine_name].time -}}</span>{{- "" -}}
|
<span class="stacked-bar-chart-value">{{- stats[engine_name].time -}}</span>{{- "" -}}
|
||||||
<span class="stacked-bar-chart" aria-labelledby="{{engine_name}}_chart" aria-hidden="true">{{- "" -}}
|
<span class="stacked-bar-chart" aria-labelledby="{{engine_name}}_chart" aria-hidden="true">
|
||||||
|
{%- if max_rate95 is not none and max_rate95 > 0 -%}
|
||||||
<span style="width: calc(max(2px, 100%*{{ (stats[engine_name].time / max_rate95)|round(3) }}))" class="stacked-bar-chart-median"></span>{{- "" -}}
|
<span style="width: calc(max(2px, 100%*{{ (stats[engine_name].time / max_rate95)|round(3) }}))" class="stacked-bar-chart-median"></span>{{- "" -}}
|
||||||
<span style="width: calc(100%*{{ ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate80"></span>{{- "" -}}
|
<span style="width: calc(100%*{{ ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate80"></span>{{- "" -}}
|
||||||
<span style="width: calc(100%*{{ ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate95"></span>{{- "" -}}
|
<span style="width: calc(100%*{{ ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate95"></span>{{- "" -}}
|
||||||
<span class="stacked-bar-chart-rate100"></span>{{- "" -}}
|
<span class="stacked-bar-chart-rate100"></span>
|
||||||
|
{%- endif -%}
|
||||||
</span>{{- "" -}}
|
</span>{{- "" -}}
|
||||||
<div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_graph">{{- "" -}}
|
<div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_graph">{{- "" -}}
|
||||||
<p>{{ _('Median') }}: {{ stats[engine_name].time }}</p>{{- "" -}}
|
<p>{{ _('Median') }}: {{ stats[engine_name].time }}</p>{{- "" -}}
|
||||||
|
@ -52,12 +52,11 @@
|
|||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</td>
|
</td>
|
||||||
<td class="response-time">
|
<td class="response-time">
|
||||||
{%- if engine_stat.total -%}
|
{%- if engine_stat.total is not none -%}
|
||||||
|
|
||||||
<div class="bar-chart-value">{{- engine_stat.total | round(1) -}}</div>{{- "" -}}
|
<div class="bar-chart-value">{{- engine_stat.total | round(1) -}}</div>{{- "" -}}
|
||||||
<div class="bar-chart-graph" aria-labelledby="{{engine_stat.name}}_time" aria-hidden="true">
|
<div class="bar-chart-graph" aria-labelledby="{{engine_stat.name}}_time" aria-hidden="true">
|
||||||
<div class="bar-chart-serie1 bar{{ (100 * engine_stat.http / engine_stats.max_time)|round }}"></div>{{- "" -}}
|
{% if engine_stat.http is not none and engine_stats.max_time %}<div class="bar-chart-serie1 bar{{ (100 * engine_stat.http / engine_stats.max_time)|round }}"></div>{%- endif -%}
|
||||||
<div class="bar-chart-serie2 bar{{ (100 * engine_stat.processing / engine_stats.max_time)|round }}"></div>{{- "" -}}
|
{% if engine_stat.processing is not none and engine_stats.max_time %}<div class="bar-chart-serie2 bar{{ (100 * engine_stat.processing / engine_stats.max_time)|round }}"></div>{%- endif -%}
|
||||||
</div>
|
</div>
|
||||||
<div class="engine-tooltip" role="tooltip" id="{{engine_stat.name}}_time">{{- "" -}}
|
<div class="engine-tooltip" role="tooltip" id="{{engine_stat.name}}_time">{{- "" -}}
|
||||||
<table>
|
<table>
|
||||||
@ -70,19 +69,19 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th scope="col">{{ _('Median') }}</th>
|
<th scope="col">{{ _('Median') }}</th>
|
||||||
<td>{{ engine_stat.total }}</td>
|
<td>{{ engine_stat.total }}</td>
|
||||||
<td>{{ engine_stat.http }}</td>
|
<td>{{ engine_stat.http or ''}}</td>
|
||||||
<td>{{ engine_stat.processing }}</td>
|
<td>{{ engine_stat.processing }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">{{ _('P80') }}</th>
|
<th scope="col">{{ _('P80') }}</th>
|
||||||
<td>{{ engine_stat.total_p80 }}</td>
|
<td>{{ engine_stat.total_p80 }}</td>
|
||||||
<td>{{ engine_stat.http_p80 }}</td>
|
<td>{{ engine_stat.http_p80 or '' }}</td>
|
||||||
<td>{{ engine_stat.processing_p80 }}</td>
|
<td>{{ engine_stat.processing_p80 }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">{{ _('P95') }}</th>
|
<th scope="col">{{ _('P95') }}</th>
|
||||||
<td>{{ engine_stat.total_p95 }}</td>
|
<td>{{ engine_stat.total_p95 }}</td>
|
||||||
<td>{{ engine_stat.http_p95 }}</td>
|
<td>{{ engine_stat.http_p95 or '' }}</td>
|
||||||
<td>{{ engine_stat.processing_p95 }}</td>
|
<td>{{ engine_stat.processing_p95 }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
Loading…
Reference in New Issue
Block a user