Commit Graph

194 Commits (master)

Author SHA1 Message Date
Alexandre Flament 26d47fe587
Merge pull request #975 from return42/fix-723
[fix] remove unmaintained searx/templates/simple/simple.spec.txt
2 years ago
Markus Heiser 3922612775 [fix] remove unmaintained searx/templates/simple/simple.spec.txt
Files hasn't been updated since it initial commit in 2017

Closes: https://github.com/searxng/searxng/issues/723
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Alexandre Flament dbe3eaabc9 Info: code refactoring & bug fixes 2 years ago
Alexandre Flament 1157462ff9 Various change on PR 930 2 years ago
Markus Heiser b1912607ae [mod] replace /help by /info pages and include pages in project docs
This patch implements a bolierplate to share content from info-pages of the
SearXNG instance (URL /info) with the project documentation (path /docs/user).

The info pages are using Markdown (CommonMark), to include them in the project
documentation (reST) the myst-parser [1] is used in the Sphinx-doc build chain.

If base_url is known (defined in settings.yml) links to the instance are also
inserted into the project documentation::

    searxng_extra/docs_prebuild

[1] https://www.sphinx-doc.org/en/master/usage/markdown.html

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Alexandre Flament d597f36e07 [fix] simple: the clear button works without javascript
related to #928
2 years ago
Alexandre Flament a250ddadb9 [enh] simple: basic ARIA fixes 2 years ago
Alexandre Flament 3d9e48b84e [simple] checkboxes can get the focusable
Do note that checkboxes in the engine tab are displayed reversed.
See: 3408d061aa/searx/templates/simple/preferences.html (L313)
A checkbox for an engine is checked when the engine is disabled.
2 years ago
Alexandre Flament 56bb1443c4 [fix] simple: display "Click on the magnifier..." only the mouse over the categories 2 years ago
mrpaulblack 21e3c40516 [simple theme] replace Image_layout.js with flexbox CS impl.
* drop image_layout.js from simple theme
* move image_layout.js to oscar theme and delete common js dir (since its empty now)
* align top position of image detail modal with bottom position of search header
* use flexbox to display images; row height can be set via @results-image-row-height in defenitions.less
* display span title underneath each image with a max width of 12rem
* increase margin and padding around image article on desktop and tablet
* make article height smaller on phone layout (height of 6rem) to display more content on current view
* remove content from result, if the title and content matches
* use a group that cotains the flex image article, if images are mixed with other categories
* fix pylint issues in webapp.py
* use the default.html result template in unit tests (thanks @return42)
2 years ago
Alexandre Flament 56e34947a6 [mod] infinite_scroll as preference
* oscar theme: code from searx/plugins/infinite_scroll.py
* simple theme: new implementation

Co-authored-by: Markus Heiser <markus.heiser@darmarIT.de>
2 years ago
Markus Heiser 16d05ca285 [mod] simple theme: define a '.show-content-button'
With LESS function '.show-content-button' all the *Show-Media* links becomes
bottons.

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Markus Heiser 7352c6bc79 [mod] templates: rename field for <iframe> URL to iframe_src
Rename result field data_src to iframe_src

Suggested-by: @dalf https://github.com/searxng/searxng/pull/882#issuecomment-1037997402
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Markus Heiser 98cab4cf75 [mod] result_templates/default.html replace embedded HTML by data_src audio_src
Embedded HTML breaks SearXNG architecture.  To modularize, HTML is generated in
the templates (oscar & simple) and result parameter 'embedded' is replaced by
'data_src' (and 'audio_src'), an URL for embedded content (<iframe>).

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Markus Heiser 46e131fdad [mod] result_templates/videos.html: replace embedded HTML by data_src
Embedded HTML breaks SearXNG architecture.  To modularize, HTML is generated in
the templates (oscar & simple) and result parameter 'embedded' is replaced by
'data_src', an URL for embedded content (<iframe>).

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Alexandre Flament bf987bb608
Merge pull request #848 from not-my-profile/help-route
Introduce `/help` route
2 years ago
Martin Fischer 91527fbd6b [enh] avoid /about redirect in template links 2 years ago
Martin Fischer 07936060d1 preferences: Set autocomplete=off for form
Otherwise you can change the value of a select,
refresh the page and the preferences stay changed,
leaving the wrong impression that they were saved.
2 years ago
Martin Fischer 14338e2c3b [enh] generate navigation for help pages 2 years ago
Martin Fischer fb9eedbf40 [enh] introduce /help route
Translation will be implemented in the future.
For now the "en" in /help/en/<pagename> is hardcoded.
2 years ago
Martin Fischer 743353dd09 [simple] add aria-label to preferences link 2 years ago
Martin Fischer e7c0f4e877 [simple] link preferences on /about and /stats
We want to link the preferences from every page
(except of course the preferences page).
2 years ago
Martin Fischer 6f0ec7e58f [simple] introduce page_with_header.html template
Previously the preferences & stats templates contained the markup:

<a href="{{ url_for('index') }}"><h1><span>SearXNG</span></h1></a>

There are many things wrong with this:

1. the markup was duplicated

2. the CSS needed to be changed whenever a new page wanted to use this
   header (since the CSS used page-specific selectors)

3. h1 should be reserved for the actual page title
   (e.g. Preferences or Engine stats)

4. the image was set via CSS which also set:

       span { visibility: hidden; }

   which however removes the alternative text from the accessibility
   tree (meaning screen readers will ignore it).

This commit fixes all these problems.
2 years ago
Paul Braeuning 2c6bd2adf6
Merge pull request #825 from MontyQI/ui-changes
Simple theme uppercase buttons
2 years ago
Monty f59afc8dd2 Uppercase buttons 2 years ago
Alexandre Flament dfb9ca527d [fix] simple theme: don't crash when the checker is enabled
The macro "checkbox" in macros.html uses the macro "icon_small"
from icons.html

The commit imports icon_small in macros.html to fix the issue.
It works because the macros in macros.html are imported with the Jinja2 context.

See https://jinja.palletsprojects.com/en/3.0.x/templates/#import-visibility

close #819
2 years ago
Alexandre Flament 576eab04d2
Merge pull request #802 from MontyQI/Icon-update
Changed preferences icon to settings icon in gruntfile
2 years ago
Martin Fischer 105c5a6a98 [help] stop rendering documentation with Jinja2
To facilitate translation of the user documentation we move
the templating logic outside of the user documentation.
2 years ago
Martin Fischer 05149db4c1 [help] render user documentation once on startup
Currently we have two kinds of user documentation:

* the about page[1] which is written in HTML and part of the web
  application and can therefore link instance-specific pages
  (like e.g. the preferences) via Jinja variables

* the Sphinx documentation[2] which is written in reStructuredText
  and cannot link instance-specific pages since it doesn't know
  which instance the user is using

The plan is to integrate the user documentation currently in Sphinx
into the application, so that it can also link instance specific pages.
We also want to enable the user documentation to be translated.

This commit implements the first step in this endeavor (see #722).

[1]: searx/templates/__common__/about.html
[2]: docs/user/ (currently served at https://docs.searxng.org/user/)
2 years ago
Monty 80530befdc [build] /static 2 years ago
Markus Heiser 08b38a8bfd [fix] simple theme: description of HTTP method
Suggested-by: @not-my-profile https://github.com/searxng/searxng/pull/754#issuecomment-1012921096
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Markus Heiser e45dfb334b [theme] /preferences: rename "Method" to "HTTP Method"
Closes: https://github.com/searxng/searxng/issues/751
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
2 years ago
Martin Fischer cd8ce22f86 [themes] add comma before "but" in new sentence
Closes #739.
2 years ago
Martin Fischer abe53946d4 [enh] display help text for "Other" engines tab in preferences 2 years ago
Martin Fischer ab90e2ac49 [enh] show categories not in any tab category in "Other" preferences tab
Previously we didn't have a good place to put search engines that don't
fit into any of the tab categories. This commit automatically puts
search engines that don't belong to any tab category in an "other"
category, that is only displayed in the user preferences (and not above
search results).
2 years ago
Martin Fischer a12cb6a807 [simple] improve styling of subcategory table headers in preferences 2 years ago
Martin Fischer 20a5e43e35 [enh] display language of engines in preferences 2 years ago
Martin Fischer 31e206361f [enh] group engines in preference tabs 2 years ago
Martin Fischer 8e9ad1ccc2 [enh] introduce categories_as_tabs
Previously all categories were displayed as search engine tabs.
This commit changes that so that only the categories listed under
categories_as_tabs in settings.yml are displayed.

This lets us introduce more categories without cluttering up the UI.
Categories not displayed as tabs  can still be searched with !bangs.
2 years ago
Markus Heiser c416464949 [fix] lazy loading of <img> tags
Images should include dimension attributes.  Without `width` and `height`
specified, image dimensions are 0×0 pixels at first.  ...  In this case the
browser determines that all of them are visible to the user and decides to load
everything [1].

In CSS the `width` is set to a value and the `height` is unsed to scale the image
proportional in both dimensions.

[1] https://web.dev/browser-level-image-lazy-loading/#images-should-include-dimension-attributes
[2] https://caniuse.com/loading-lazy-attr

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser c7bb6945d1 [fix] simple theme: img tile, shows duplicate information on screen
Remove global title attribute from img tag[1][2] .  In the image result, the
title is already shown from span class title::

    <span class="title">{{ result.title|striptags }}</span>

See commit: 8fbffb1409

    [fix] simple-theme templates: polish HTML <img> elements

[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
[2] https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#attr-title

Reported-by: @dalf https://github.com/searxng/searxng/pull/545#issuecomment-980531215
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 944b73511a [enh] add SVG favicon href="favicon.svg" type="image/svg+xml"
Add link::

    <link rel="icon" href="favicon.png" sizes="any">
    <link rel="icon" href="favicon.svg" type="image/svg+xml">

Modern browsers should request::

    INFO  werkzeug   : 127.0.0.1 - - [28/Nov/2021 17:03:07] "GET /static/themes/simple/img/favicon.svg HTTP/1.1" 200 -

[1] https://github.com/audreyfeldroy/favicon-cheat-sheet#svg-file
[2] https://dev.to/masakudamatsu/favicon-nightmare-how-to-maintain-sanity-3al7

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 1f896ea509 [fix] query_in_title: add missing space in title
Suggested-by: @unixfox https://github.com/searxng/searxng/pull/485#issuecomment-981406978
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 8fbffb1409 [fix] simple-theme templates: polish HTML <img> elements
- <img> [1] element does not have an end tag, no need for a leading `/>`
- add global attribute title[2] to result_templates/images.html (result-images-source)
- in jinja macro 'macro result_header' remove duplicate of class="image"
- in jinja macro 'macro result_header' remove alt attribute (fix [3])::

    alt="{{ result.title|striptags }}"

  the result.title is already shown in::

    <h3>{{ result_link(result.url, result.title|safe) }}</h3>

[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
[2] https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#attr-title
[3] https://github.com/searxng/searxng/issues/523

Closes: https://github.com/searxng/searxng/issues/523
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 3f3097c772 [fix] templates: remove unneeded escape \' of single quotation mark
Strings like::

    'Query in the page\'s title'

are hard to read / remove escape sequence by using double quotation marks for
strings ::

    "Query in the page's title"

BTW: remove a leading dot in the simple theme [1].

[1] 80fb77476f (r756112716)

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 42c1a938f0
Merge pull request #485 from dalf/pref_query_in_title
[mod] new preference: query_in_title
3 years ago
Alexandre Flament c4caa52989
fix PR #535
Use the "empty_element" CSS class.
3 years ago
Markus Heiser f57a9f425d [simple template] format default string 'italic'
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
mrpaulblack 047d0ac6d6 [simple template] return a default string if there is no description 3 years ago
mrpaulblack f3aff26086 [simple theme] rework select; add safesearch to search and replace / with › in article url
* rework selection UI in pref (fix based on: 78643e9f43)
* moved search filters underneath categories
* cut params from url and replace / with ›
* make h3 and url in article bigger
* add safe search select to search filter (this will not override settings and only be valid while on result page in a session)
* make search form button not overlap each other when js is disabled
* 1rem padding around preview image and thumbnail in default article template
3 years ago
Alexandre Flament ec5a82fccd [enh] simple theme: add "simple-style" preferences 3 years ago
Alexandre Flament dfbbc3b471 [fix] simple theme: /preferences: add tokens field
include changes to display input text field in the preferences
3 years ago
Markus Heiser a364e54859 [fix] delete trailing whitespace
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
MrPaulBlack 566dfe3330 [simple theme] update to ion icons 5 and drop webfont
* update from ionicons-npm to ionicons ver.5
* drop the webfont built by grunt for icons
* built icons.html template for inlining icons with jinja2 into html
* update icon to use mostly the outline version
* add icons to categories and do not display them on mobile to save space
* remove all legacy ion icon font files from simple theme
* icons.html is added in this commit since make statc.build.restore requires git to know the file already
* cleanup error-dialog
3 years ago
Markus Heiser ee67a65180 [simple theme] replace old searx logo by searxng-wordmark.min.svg
Suggested-by: @dalf https://github.com/searxng/searxng/pull/473#issuecomment-962476683
Suggested-by: @MrPaulBlack https://github.com/searxng/searxng/pull/473#issuecomment-962579826
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
MrPaulBlack a80b5dc110 [fix] scaling of result page on small screens by @ZetaTom
* thanks to https://github.com/ZetaTom for the fix!
* set the width of the input#q element to 100% of the 1fr space of the grid layout
* change the viewport meta tag to th recommended value (see: https://developer.mozilla.org/en-US/docs/Web/HTML/Viewport_meta_tag#viewport_basics)
* add a new @ultra-small-phone width of 20rem; when a device is smaller than that the search logo does not get displayed on the result page anymore
3 years ago
Alexandre Flament 80fb77476f [mod] new preference: query_in_title
* disable by default
* settings.yml: ui.query_in_title
* in /preferences: privacy tab

when enabled, the result page's title contains the user query.

previously:
* oscar theme: the query was always included
* simple theme: the query was included with the GET method
3 years ago
Alexandre Flament d1c09c84e2 [fix] simple theme: disable hotkeys when they are not enabled in the preferences 3 years ago
Alexandre Flament 3167d645e8 [fix] simple theme: fix open in a new tab preference 3 years ago
Alexandre Flament 0650e73b12 [mod] simple theme: SearXNG logo 3 years ago
Alexandre Flament fd374d6322 [enh] simple theme: image detail
When an image is selected, the detail with the full size image is displayed
on the right side of the screen (or full screen on tablet and phone).

When Javascript is disabled, the thumbnail is a linked to the full size image,
as it was before.

When the image proxy is enabled, the full size image is also proxied,
in consequence this commit increases the bandwidth usage of instances.

The detail can be closed by the close button or the Esc key.
It is possible to go to the next and previous images using the j and k keys
or the button on the top right of the screen.
3 years ago
MrPaulBlack 1723726361 [simple theme] make url clickable and cleanup result article header
* url in article head is clickable
* url is bigger now 0.96em font
* url is now left floating on tablet and phone
* there is a 8px top and bottom margin on h3 result heading
3 years ago
MrPaulBlack bcc313bcf8 [simple theme] add logo to search form on result page
* rework search form as grid layout
* remove various paddings and margins
* add logo and link to index to search form
* make categories bigger on phone
3 years ago
Markus Heiser 9730371199 [fix] typos reported from weblate translators
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 988910d451 [fix] templates: lang attribute of html uses hyphen
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#attr-lang
https://www.w3.org/TR/REC-xml/#sec-lang-tag
3 years ago
MrPaulBlack 09324f3492 [template] move result url to top of article 3 years ago
Alexandre Flament 74b0830362 SearXNG: simple theme 3 years ago
Alexandre Flament 2f1384f198 [enh] themes: display the engine descriptions 3 years ago
MrPaulBlack 3017227c14 [preferences] remove checkbox class from query section 3 years ago
MrPaulBlack d24bcbb6f0 [preferences] reorder tabs in simple to match oscar theme 3 years ago
MrPaulBlack 45eb2b5637 [preferences] cleanup whitespaces 3 years ago
MrPaulBlack 2d26ace265 [preferences] add special queries tab to preferences 3 years ago
MrPaulBlack 575483ad2a [theme] add newline at the end of the file 3 years ago
MrPaulBlack 880fe67172 [theme] remove categories, language and time range from index 3 years ago
MrPaulBlack 644ccf16be [theme] make engine stats clickable 3 years ago
MrPaulBlack 48d4296caa [theme] link to engine stats in footer 3 years ago
Markus Heiser bd830f7449 [fix] simple theme - preferences: fix tooltip overflow
Suggested-by: @dalf https://github.com/searxng/searxng/pull/295#discussion_r703370358
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser e564cef0fe [fix] make /preferences more CSP compliant - simple & oscar theme
In simple & oscar theme remove ``style=`` properties which violates CSP but seem
not to have a magnification in GUI (UX).

Fixed files::

    ./oscar/preferences.html:25:<td class="{{ label }}" style="padding: 2px">{{- "" -}}
    ./simple/preferences.html:39:<td class="{{ label }}" style="padding: 2px; width: 13rem;">{{- "" -}}
    ./simple/preferences.html:77:    <div class="engine-tooltip" style="right: 12rem;" role="tooltip" id="{{engine_name}}_reliability">
    ./simple/preferences.html:258:     <p class="text-muted" style="margin:20px 0;">

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser ad528c706e [fix] make result template map more CSP compliant - simple & oscar
Add osm-map-box in::

    searx/static/themes/__common__/less/result_templates.less

Replaced sty= in files::

    ./oscar/result_templates/map.html:64:        <div style="height:300px; width:100%; margin: 10px 0;" id="osm-map-{{ index }}"></div>
    ./simple/result_templates/map.html:65:    <div id="result-map-{{ index }}" class="invisible"><div id="osm-map-{{ index }}" style="height:300px; width:100%; margin: 10px 0;" ></div></div>

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 48c806954e [fix] make /preferences more CSP compliant - simple & oscar theme
in simple & oscar theme replace bar-graph's *styles* by CSP compliant
implementation in::

    searx/static/themes/__common__/less/stats.less

Fixed files::

    ./oscar/preferences.html:29:        <span style="width: calc(max(2px, 100%*{{ (stats[engine_name].time / max_rate95)|round(3) }}))" class="stacked-bar-chart-median"></span>{{- "" -}}
    ./oscar/preferences.html:30:        <span style="width: calc(100%*{{ ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate80"></span>{{- "" -}}
    ./oscar/preferences.html:31:        <span style="width: calc(100%*{{ ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate95"></span>{{- "" -}}
    ./simple/preferences.html:43:        <span style="width: calc(max(2px, 100%*{{ (stats[engine_name].time / max_rate95)|round(3) }}))" class="stacked-bar-chart-median"></span>{{- "" -}}
    ./simple/preferences.html:44:        <span style="width: calc(100%*{{ ((stats[engine_name].rate80 - stats[engine_name].time) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate80"></span>{{- "" -}}
    ./simple/preferences.html:45:        <span style="width: calc(100%*{{ ((stats[engine_name].rate95 - stats[engine_name].rate80) / max_rate95)|round(3) }})" class="stacked-bar-chart-rate95"></span>{{- "" -}}

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament f77f797f8c [mod] simple theme: fix eslint errors, fix VIM keys
* VIM keys: fix the next page and previous pages (n, p keys)
* Map: Enable the wikipedia map (the layer was initialized but not included)
3 years ago
Alexandre Flament 4b43775c91 version based on the git repository
This commit remove the need to update the brand for GIT_URL and GIT_BRANCH:
there are read from the git repository.

It is possible to call python -m searx.version freeze to freeze the current version.
Useful when the code is installed outside git (distro package, docker, etc...)
3 years ago
Markus Heiser 3f638ed196 [mod] drop usage of the searx.brand namespace (templates & /config)
In the templates and the /config (JSON) the usage of the 'brand.*' name
space is replaced by 'searx.get_setting' function.

- new_issue_url          --> get_setting('brand.new_issue_url')
- brand.GIT_URL          --> get_setting('brand.git_url')
- brand.PUBLIC_INSTANCES --> get_setting('brand.public_instances')
- brand.DOCS_URL         --> get_setting('brand.docs_url')
- brand.ISSUE_URL        --> get_setting('brand.issue_url')
- brand.CONTACT_URL      --> get_setting('general.contact_url', '')

The macro 'new_issue' from searx/templates/*/messages/no_results.html
is now imported with context::

    {% from '__common__/new_issue.html' import new_issue with context %}

To get *public instances URL* from context's 'get_setting()' function::

    get_setting('brand.public_instances','')

Macro's prototype does no longer need the 'new_issue_url' argument and has been
changed to::

    macro new_issue(engine_name, engine_reliability)

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 12af3b39db [fix] make simple/result_templates/map.html more CSP compliant [1]
[1] https://github.com/searxng/searxng/issues/57

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament c75425655f [enh] openstreetmap / map template: improve results
implements ideas described in #69

* update the engine
* use wikidata
* update map.html template
3 years ago
Alexandre Flament 7457f3fe40
Merge pull request #124 from return42/searx-merge
merge redis offline engine from searx
3 years ago
Alexandre Flament a89b823f8d [mod] remove overpass API call
prepare the code the PR #90
3 years ago
Adam Tauber e33858d6ef [fix] correct kv template formatting and remove internal data
Slightly modified merge of commit [ea7ccf24] from searx.

[ea7ccf24] https://github.com/searx/searx/commit/ea7ccf24

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 6ed4616da9 [enh] add settings option to enable/disable search formats
Access to formats can be denied by settings configuration::

    search:
        formats: [html, csv, json, rss]

Closes: https://github.com/searxng/searxng/issues/95
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 99aaf86b73 [fix] offline engines: fix templates /stats and /preferences 3 years ago
Markus Heiser 0507e185a5 [fix] bar graph and rename CSS class engine-scores -> engine-score
- drop #main_stats selector in stats.less
- 'engine-score' exists before this PR.
- untabify searx/static/themes/__common__/less/stats.less

for details see comment at: d93bec7638..1204e4f07e (r633571496)

Suggested-by: @dalf in commit 1204e4f0
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser 0a6c488417 [fix] make /stats more CSP compliant - simple theme
Replace simple theme's *styles* (see below) by CSP compliant implementation in
``searx/static/themes/simple/less/stats.less`` ::

    ./simple/stats.html:26:  <table style="max-width: 1280px; margin: 0 auto 0 0;">
    ./simple/stats.html:28:  <th scope="col" style="width:20rem;">{{ th_sort('name', _("Engine name")) }}</th>
    ./simple/stats.html:29:  <th scope="col" style="width:7rem; text-align: right;">{{ th_sort('score', _('Scores')) }}</th>
    ./simple/stats.html:32:  <th scope="col" style="text-align: right;">{{ th_sort('reliability', _('Reliability')) }}</th>
    ./simple/stats.html:37:  <td style="text-align: right;">
    ./simple/stats.html:90:  <td style="text-align: right;"> {{ engine_reliabilities.get(engine_stat.name, {}).get('reliablity') }}</td>
    ./simple/stats.html:106: <table style="max-width: 1280px; margin: 1rem; border: 1px solid gray;">
    ./simple/stats.html:107: <tbody style="padding-top: 1rem;">
    ./simple/stats.html:110: <th scope="row" style="width: 10rem">{{ _('Exception') }}</th><td>{{ error.exception_classname }}</td>
    ./simple/stats.html:112: <th scope="row" style="width: 10rem">{{ _('Message') }}</th><td>{{ error.log_message }}</td>
    ./simple/stats.html:114: <th scope="row" style="width: 10rem">{{ _('Percentage') }}</th><td style="width: 10rem">{{ error.percentage }}</td>
    ./simple/stats.html:119: <span style="border-right: 1px solid gray; padding: 0 1rem 0 0; margin: 0 0 0 0.5rem;">{{ param }}</span>
    ./simple/stats.html:136: <th scope="col" style="width: 10rem">{{ _('Failed test') }}</th>

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser cdfb4b7ff9 [fix] make /stats more CSP compliant - bar graph
Replace bar graph's *styles* (see below) by CSP compliant implementation in
``searx/static/themes/__common__/less/stats.less`` ::

    ./simple/stats.html:49: <span style="width: calc(max(2px, 100%*{{ (engine_stat.result_count / engine_stats.max_result_count )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}}
    ./simple/stats.html:57: <span style="width: calc(max(2px, 100%*{{ (engine_stat.http / engine_stats.max_time )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}}
    ./simple/stats.html:58: <span style="width: calc(100%*{{ engine_stat.processing / engine_stats.max_time |round(3) }})" class="stacked-bar-chart-serie2"></span>{{- "" -}}
    ./oscar/stats.html:50:  <span style="width: calc(max(2px, 100%*{{ (engine_stat.result_count / engine_stats.max_result_count )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}}
    ./oscar/stats.html:58:  <span style="width: calc(max(2px, 100%*{{ (engine_stat.http / engine_stats.max_time )|round(3) }}))" class="stacked-bar-chart-serie1"></span>{{- "" -}}
    ./oscar/stats.html:59:  <span style="width: calc(100%*{{ engine_stat.processing / engine_stats.max_time |round(3) }})" class="stacked-bar-chart-serie2"></span>{{- "" -}}

Reported-by: https://github.com/searxng/searxng/issues/57
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Markus Heiser d36adfa59f
Merge pull request #55 from searxng/upd-relialibility-column
[themes] /preferences, reliablity: warning icons & error logs link
3 years ago
Markus Heiser 5253df946b
[mod] option to enable or disable "proxy" button next to each result (#54)
* [mod] option to enable or disable "proxy" button next to each result

Closes: https://github.com/searxng/searxng/issues/51
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Co-authored-by: Alexandre Flament <alex@al-f.net>
3 years ago
Alexandre Flament e83862c22f [themes] /preferences, reliablity: warning icons & error logs link
When there is at least one errors or one failed checker test:
* the warning icon is displayed in the reliability column
* the link "View error logs and submit a bug report" is displayed on engine name tooltip.

Before:
* the warning icon was displayed only when one or more checker test(s) failed.
* the link "View error logs and submit a bug report" was not shown when a checker test failed but there were no error.
3 years ago
Markus Heiser 8026ed0d37 [mod] UI: engine pref-page, about toolbox: add link to stats
In the preference page, in the 'about' toolbox of an engine, add a link to the
stats page of the engine, if the engine had one or more errors.

Condition is::

    reliabilities[<engine.name>].errors

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
3 years ago
Alexandre Flament 34bced29ae [mod] engine errors: link to the stats to create an github issue 3 years ago
Alexandre Flament df41b77121 [mod] /stats : detail per engine
allow to submit a github issue including the technical details
(exceptions, errors, warning, checker result)
3 years ago
Alexandre Flament 7032f7521c [mod] /stats: simple theme implementation 3 years ago