mirror of
https://github.com/searxng/searxng
synced 2024-01-01 19:24:07 +01:00
[mod] /stats : detail per engine
allow to submit a github issue including the technical details (exceptions, errors, warning, checker result)
This commit is contained in:
parent
0603b043ce
commit
df41b77121
7 changed files with 227 additions and 20 deletions
|
|
@ -1,12 +1,15 @@
|
|||
{% from 'simple/macros.html' import icon %}
|
||||
{% from '__common__/new_issue.html' import new_issue %}
|
||||
|
||||
{% extends "simple/base.html" %}
|
||||
|
||||
{%- macro th_sort(column_order, column_name) -%}
|
||||
{% if column_order==sort_order %}
|
||||
{% if selected_engine_name %}
|
||||
{{ column_name }}
|
||||
{% elif column_order==sort_order %}
|
||||
{{ column_name }} {{ icon('arrow-dropdown') }}
|
||||
{% else %}
|
||||
<a href="{{ url_for('stats', sort=column_order) }}">{{ column_name }}
|
||||
<a href="{{ url_for('stats', sort=column_order) }}">{{ column_name }}</a>
|
||||
{% endif %}
|
||||
{%- endmacro -%}
|
||||
|
||||
|
|
@ -15,12 +18,12 @@
|
|||
|
||||
<a href="{{ url_for('index') }}"><h1><span>searx</span></h1></a>
|
||||
|
||||
<h2>{{ _('Engine stats') }}</h2>
|
||||
<h2>{{ _('Engine stats') }}{% if selected_engine_name %} - {{ selected_engine_name }}{% endif %}</h2>
|
||||
|
||||
{% if not engine_stats.get('time') %}
|
||||
{{ _('There is currently no data available. ') }}
|
||||
{% else %}
|
||||
<table style="max-width: 1280px; margin: 0 auto;">
|
||||
<table style="max-width: 1280px; margin: 0 auto 0 0;">
|
||||
<tr>
|
||||
<th scope="col" style="width:20rem;">{{ th_sort('name', _("Engine name")) }}</th>
|
||||
<th scope="col" style="width:7rem; text-align: right;">{{ th_sort('score', _('Scores')) }}</th>
|
||||
|
|
@ -30,7 +33,7 @@
|
|||
</tr>
|
||||
{% for engine_stat in engine_stats.get('time', []) %}
|
||||
<tr>
|
||||
<td>{{ engine_stat.name }}</td>
|
||||
<td><a href="{{ url_for('stats', engine=engine_stat.name|e) }}">{{ engine_stat.name }}</a></td>
|
||||
<td style="text-align: right;">
|
||||
{% if engine_stat.score %}
|
||||
<span aria-labelledby="{{engine_stat.name}}_score" >{{ engine_stat.score|round(1) }}</span>
|
||||
|
|
@ -90,4 +93,61 @@
|
|||
</table>
|
||||
{% endif %}
|
||||
|
||||
<div>
|
||||
{% if selected_engine_name %}
|
||||
{% for secondary in [False, True] %}
|
||||
{% set ns = namespace(first=true) %}
|
||||
{% for error in engine_reliabilities[selected_engine_name].errors %}
|
||||
{% if secondary == error.secondary %}
|
||||
{% if ns.first %}
|
||||
{% set ns.first = false %}
|
||||
<h3>{% if secondary %}{{ _('Warnings') }}{% else %}{{ _('Errors and exceptions') }}{% endif %}</h3>
|
||||
{% endif %}
|
||||
<table style="max-width: 1280px; margin: 1rem; border: 1px solid gray;">
|
||||
<tbody style="padding-top: 1rem;">
|
||||
<tr>
|
||||
{%- if error.exception_classname -%}
|
||||
<th scope="row" style="width: 10rem">{{ _('Exception') }}</th><td>{{ error.exception_classname }}</td>
|
||||
{%- elif error.log_message -%}
|
||||
<th scope="row" style="width: 10rem">{{ _('Message') }}</th><td>{{ error.log_message }}</td>
|
||||
{%- endif -%}
|
||||
<th scope="row" style="width: 10rem">{{ _('Percentage') }}</th><td style="width: 10rem">{{ error.percentage }}</td>
|
||||
</tr>
|
||||
{% if error.log_parameters and error.log_parameters != (None, None, None) %}<tr><th scope="row">{{ _('Parameter') }}</th>{{- '' -}}
|
||||
<td colspan="3">
|
||||
{%- for param in error.log_parameters -%}
|
||||
<span style="border-right: 1px solid gray; padding: 0 1rem 0 0; margin: 0 0 0 0.5rem;">{{ param }}</span>
|
||||
{%- endfor -%}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr><th scope="row">{{ _('Filename') }}</th><td colspan="3">{{ error.filename }}:{{ error.line_no }}</td></tr>
|
||||
<tr><th scope="row">{{ _('Function') }}</th><td colspan="3">{{ error.function }}</td></tr>
|
||||
<tr><th scope="row">{{ _('Code') }}</th><td colspan="3">{{ error.code }}</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endfor %}
|
||||
{% if engine_reliabilities[selected_engine_name].checker %}
|
||||
<h3>{{ _('Checker') }}</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th scope="col" style="width: 10rem">{{ _('Failed test') }}</th>
|
||||
<th scope="col">{{ _('Comment(s)') }}</th>
|
||||
</tr>
|
||||
{% for test_name, results in engine_reliabilities[selected_engine_name].checker.items() %}
|
||||
<tr>
|
||||
<td>{{ test_name }}</td>
|
||||
<td>
|
||||
{% for r in results %}<p>{{ r }}</p>{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
{{ new_issue(brand.NEW_ISSUE_URL, selected_engine_name, engine_reliabilities[selected_engine_name]) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue