From 09e7ecdce22733be82bb141355c646ddec538714 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Thu, 22 Apr 2021 17:47:53 +0200 Subject: [mod] /stats : add reliability column and sort by column links --- searx/templates/oscar/stats.html | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'searx/templates') diff --git a/searx/templates/oscar/stats.html b/searx/templates/oscar/stats.html index 0851343ce..149522226 100644 --- a/searx/templates/oscar/stats.html +++ b/searx/templates/oscar/stats.html @@ -1,6 +1,5 @@ {% extends "oscar/base.html" %} {% block styles %} - {% endblock %} {% block title %}{{ _('stats') }} - {% endblock %} + +{%- macro th_sort(column_order, column_name) -%} + {% if column_order==sort_order %} + {{ column_name }} {{ icon('chevron-down') }} + {% else %} + {{ column_name }} + {% endif %} +{%- endmacro -%} + {% block content %}

{{ _('Engine stats') }}

@@ -25,27 +33,33 @@ {% else %} - - - - + + + + + {% for engine_stat in engine_stats.get('time', []) %}
{{ _("Engine name") }}{{ _('Scores') }}{{ _('Number of results') }}{{ _('Response time') }}{{ th_sort('name', _("Engine name")) }}{{ th_sort('score', _('Scores')) }}{{ th_sort('result_count', _('Result count')) }}{{ th_sort('time', _('Response time')) }}{{ th_sort('reliability', _('Reliability')) }}
{{ engine_stat.name }} + {% if engine_stat.score %} {{ engine_stat.score|round(1) }} + {% endif %} + {%- if engine_stat.result_count -%} {{- engine_stat.result_count | int -}}{{- "" -}} {{- "" -}} + + {%- endif -%} + {%- if engine_stat.total -%} {{- engine_stat.total | round(1) -}}{{- "" -}}
+ {%- endif -%} + {{ engine_reliabilities.get(engine_stat.name, {}).get('reliablity') }} {% endfor %} -- cgit v1.2.3