Merge pull request #40 from searxng/link-to-stats

[mod] engine errors: link to the stats to create an github issue
This commit is contained in:
Alexandre Flament 2021-04-29 14:37:12 +02:00 committed by GitHub
commit e5bcc3cbbe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 54 additions and 23 deletions

View File

@ -2,11 +2,14 @@
{% if unresponsive_engines %}
<div class="alert alert-danger fade in" role="alert">
<p><strong class="lead">{{ icon('remove-sign') }} {{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results.') }}</p>
{%- for engine_name, error_type in unresponsive_engines -%}
<p>
{% for engine_name, error_type in unresponsive_engines %}
{{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}
{% endfor %}
{{- engine_name }} (
<a href="{{ url_for('stats', engine=engine_name|e) }}" title="{{ _('View error logs and submit a bug report') }}">
{{- error_type -}}
</a> ){{- '' -}}
</p>
{%- endfor -%}
<p><small>{{ _('Please, try again later or find another searx instance.') }} (<a href="{{ brand.PUBLIC_INSTANCES }}">{{ _('Public instances') }}</a>)</small></p>
</div>
{% else %}

View File

@ -12,6 +12,11 @@
{%- if stats[search_engine.name]['result_count'] -%}
<p>{{ _('Number of results') }}: {{ stats[search_engine.name]['result_count'] }} ( {{ _('Avg.') }} )</p>{{- "" -}}
{%- endif -%}
{%- if reliabilities[search_engine.name].errors -%}
<a href="{{ url_for('stats', engine=search_engine.name|e) }}" title="{{ _('View error logs and submit a bug report') }}">
{{ _('View error logs and submit a bug report') }}
</a>
{%- endif -%}
</div>
{%- endif -%}
{%- endmacro %}
@ -50,9 +55,11 @@
{% endif %}
{% if checker_result or errors %}
<td class="{{ css_align_class }} {{ label }}">{{- "" -}}
<a href="{{ url_for('stats', engine=engine_name|e) }}">{{- "" -}}
<span aria-labelledby="{{engine_name}}_reliablity">
{%- if reliabilities[engine_name].checker %}{{ icon('exclamation-sign', 'The checker fails on the some tests') }}{% endif %} {{ r -}}
{%- if reliabilities[engine_name].checker %}{{ icon('exclamation-sign', 'The checker fails on the some tests') }}{% endif %} {{ r -}}</a>
</span>{{- "" -}}
</a>{{- "" -}}
<div class="engine-tooltip text-left" role="tooltip" id="{{engine_name}}_reliablity">
{%- if checker_result -%}
<p>{{ _("Failed checker test(s): ") }} {{ ', '.join(checker_result) }}</p>

View File

@ -31,7 +31,12 @@
<div class="alert alert-danger fade in" role="alert">
<p>{{ _('Engines cannot retrieve results') }}:</p>
{%- for engine_name, error_type in unresponsive_engines -%}
{{- engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}{{- "" -}}
<p>{{- '' -}}
{{- engine_name }} (
<a href="{{ url_for('stats', engine=engine_name|e) }}" title="{{ _('View error logs and submit a bug report') }}">
{{- error_type -}}
</a> ){{- '' -}}
</p>
{%- endfor -%}
</div>
{%- endif %}

View File

@ -2,11 +2,15 @@
{% if unresponsive_engines %}
<div class="dialog-error" role="alert">
<p><strong>{{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results.') }}</p>
<p>
{% for engine_name, error_type in unresponsive_engines %}
{{ engine_name }} ({{ error_type }}){% if not loop.last %}, {% endif %}
{% endfor %}
<p>{{- '' -}}
{{- engine_name }} (
<a href="{{ url_for('stats', engine=engine_name|e) }}" title="{{ _('View error logs and submit a bug report') }}">
{{- error_type -}}
</a> ){{- '' -}}
</p>
{%- endfor %}
<p><small>{{ _('Please, try again later or find another searx instance.') }} (<a href="{{ brand.PUBLIC_INSTANCES }}">{{ _('Public instances') }}</a>) </small></p>
</div>
{% else %}

View File

@ -25,6 +25,12 @@
<p><a href="{{about.website}}" rel="noreferrer">{{about.website}}</a></p>
{%- if about.wikidata_id -%}<p><a href="https://www.wikidata.org/wiki/{{about.wikidata_id}}" rel="noreferrer">wikidata.org/wiki/{{about.wikidata_id}}</a></p>{%- endif -%}
{%- if search_engine.enable_http %}<p>{{ icon('exclamation-sign', 'No HTTPS') }}{{ _('No HTTPS')}}</p>{% endif -%}
{%- if reliabilities[search_engine.name].errors -%}
<a href="{{ url_for('stats', engine=search_engine.name|e) }}" title="{{ _('View error logs and submit a bug report') }}">
{{ _('View error logs and submit a bug report') }}
</a>
{%- endif -%}
</div>
{%- endif -%}
{%- endmacro %}
@ -63,9 +69,11 @@
{% endif %}
{% if checker_result or errors %}
<td class="{{ label }}">{{- "" -}}
<a href="{{ url_for('stats', engine=engine_name|e) }}">{{- "" -}}
<span aria-labelledby="{{engine_name}}_reliablity">
{%- if reliabilities[engine_name].checker %}{{ icon('warning', 'The checker fails on the some tests') }}{% endif %} {{ r -}}
</span>{{- "" -}}
</a>{{- "" -}}
<div class="engine-tooltip" style="right: 12rem;" role="tooltip" id="{{engine_name}}_reliablity">
{%- if checker_result -%}
<p>{{ _("The checker fails on this tests: ") }} {{ ', '.join(checker_result) }}</p>

View File

@ -43,9 +43,13 @@
{% if unresponsive_engines and results|length >= 1 %}
<div class="dialog-error" role="alert">
<p><strong>{{ _('Error!') }}</strong> {{ _('Engines cannot retrieve results') }}:</p>
<p>{% for engine_name, error_type in unresponsive_engines %}
{{- engine_name }} ({{- error_type -}}){% if not loop.last %}, {% endif %}
{% endfor %}</p>
{%- for engine_name, error_type in unresponsive_engines -%}
<p>{{- engine_name }} (
<a href="{{ url_for('stats', engine=engine_name|e) }}" title="{{ _('View error logs and submit a bug report') }}">
{{- error_type -}}
</a> ){{- '' -}}
</p>
{% endfor %}
</div>
{% endif %}