diff --git a/docs/admin/engines.rst b/docs/admin/engines.rst index 4b78c8c2b..4d1872dfc 100644 --- a/docs/admin/engines.rst +++ b/docs/admin/engines.rst @@ -26,6 +26,8 @@ Safe search **SS** Weigth **W** ------------- ----------- --------------------------------- Disabled **D** +------------- ----------- --------------------------------- +Show errors **DE** ============= =========== ================================= Configuration defaults (at built time): @@ -51,6 +53,7 @@ Configuration defaults (at built time): - O - W - D + - DE {% for name, mod in engines.items() %} @@ -67,5 +70,6 @@ Configuration defaults (at built time): - {{(mod.offline and "y") or ""}} - {{mod.weight or 1 }} - {{(mod.disabled and "y") or ""}} + - {{(mod.display_error_messages and "y") or ""}} {% endfor %} diff --git a/docs/admin/settings.rst b/docs/admin/settings.rst index 0bfdcc6cb..2bfbae35c 100644 --- a/docs/admin/settings.rst +++ b/docs/admin/settings.rst @@ -98,7 +98,7 @@ Global Settings specific instance of searx, a locale can be defined using an ISO language code, like ``fr``, ``en``, ``de``. -.. _requests proxies: http://docs.python-requests.org/en/latest/user/advanced/#proxies +.. _requests proxies: http://requests.readthedocs.io/en/latest/user/advanced/#proxies .. _PR SOCKS support: https://github.com/kennethreitz/requests/pull/478 ``outgoing_proxies`` : @@ -175,6 +175,9 @@ Engine settings ``weigth`` : default ``1`` Weighting of the results of this engine. +``display_error_messages`` : default ``True`` + When an engine returns an error, the message is displayed on the user interface. + .. note:: A few more options are possible, but they are pretty specific to some diff --git a/docs/dev/engine_overview.rst b/docs/dev/engine_overview.rst index 449c837a9..c3c81fff8 100644 --- a/docs/dev/engine_overview.rst +++ b/docs/dev/engine_overview.rst @@ -57,6 +57,7 @@ engine string name of searx-engine (filename without ``.py``) shortcut string shortcut of search-engine timeout string specific timeout for search-engine +display_error_messages boolean display error messages on the web UI ======================= =========== =========================================== diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index 9ccef8b54..48c02e2e7 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -55,6 +55,7 @@ engine_default_args = {'paging': False, 'continuous_errors': 0, 'time_range_support': False, 'offline': False, + 'display_error_messages': True, 'tokens': []} diff --git a/searx/results.py b/searx/results.py index 02ab9efb1..62a01a5bd 100644 --- a/searx/results.py +++ b/searx/results.py @@ -346,7 +346,8 @@ class ResultContainer(object): return resultnum_sum / len(self._number_of_results) def add_unresponsive_engine(self, engine_name, error_type, error_message=None): - self.unresponsive_engines.add((engine_name, error_type, error_message)) + if engines[engine_name].display_error_messages: + self.unresponsive_engines.add((engine_name, error_type, error_message)) def add_timing(self, engine_name, engine_time, page_load_time): self.timings.append({ diff --git a/searx/settings.yml b/searx/settings.yml index 77cc4e087..2497a764b 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -41,7 +41,7 @@ outgoing: # communication with search engines pool_maxsize : 10 # Number of simultaneous requests by host # uncomment below section if you want to use a proxy # see http://docs.python-requests.org/en/latest/user/advanced/#proxies -# SOCKS proxies are also supported: see http://docs.python-requests.org/en/master/user/advanced/#socks +# SOCKS proxies are also supported: see http://requests.readthedocs.io/en/master/user/advanced/#socks # proxies : # http : http://127.0.0.1:8080 # https: http://127.0.0.1:8080 diff --git a/searx/static/themes/oscar/js/searx.js b/searx/static/themes/oscar/js/searx.js index 9138576f5..c6feda50c 100644 --- a/searx/static/themes/oscar/js/searx.js +++ b/searx/static/themes/oscar/js/searx.js @@ -357,3 +357,13 @@ $(document).ready(function(){ $( this ).off( event ); }); }); +;$(document).ready(function(){ + $("#allow-all-engines").click(function() { + $(".onoffswitch-checkbox").each(function() { this.checked = false;}); + }); + + $("#disable-all-engines").click(function() { + $(".onoffswitch-checkbox").each(function() { this.checked = true;}); + }); +}); + diff --git a/searx/static/themes/oscar/js/searx.min.js b/searx/static/themes/oscar/js/searx.min.js index 4c01dca94..9c3e13b59 100644 Binary files a/searx/static/themes/oscar/js/searx.min.js and b/searx/static/themes/oscar/js/searx.min.js differ diff --git a/searx/static/themes/oscar/js/searx_src/toggleall.js b/searx/static/themes/oscar/js/searx_src/toggleall.js new file mode 100644 index 000000000..b6c484e3e --- /dev/null +++ b/searx/static/themes/oscar/js/searx_src/toggleall.js @@ -0,0 +1,10 @@ +$(document).ready(function(){ + $("#allow-all-engines").click(function() { + $(".onoffswitch-checkbox").each(function() { this.checked = false;}); + }); + + $("#disable-all-engines").click(function() { + $(".onoffswitch-checkbox").each(function() { this.checked = true;}); + }); +}); + diff --git a/searx/templates/courgette/search.html b/searx/templates/courgette/search.html index bd4efd42f..fe70fde05 100644 --- a/searx/templates/courgette/search.html +++ b/searx/templates/courgette/search.html @@ -1,6 +1,6 @@
- +
{% include 'courgette/categories.html' %} diff --git a/searx/templates/legacy/search.html b/searx/templates/legacy/search.html index 4d37f9ba1..fcd08d6d2 100644 --- a/searx/templates/legacy/search.html +++ b/searx/templates/legacy/search.html @@ -1,6 +1,6 @@
- +
{% set display_tooltip = true %} diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index b03929df3..0d96ff5f2 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -155,6 +155,14 @@
+ +
+

+ + +

+
+ {% for categ in all_categories %} @@ -174,14 +182,14 @@ {{ _("Avg. time") }} {{ _("Max time") }} {% else %} - {{ _("Max time") }} - {{ _("Avg. time") }} - {{ _("Time range") }} - {{ _("SafeSearch") }} - {{ _("Selected language") }} - {{ _("Shortcut") }} - {{ _("Engine name") }} - {{ _("Allow") }} + {{ _("Max time") }} + {{ _("Avg. time") }} + {{ _("Time range") }} + {{ _("SafeSearch") }} + {{ _("Selected language") }} + {{ _("Shortcut") }} + {{ _("Engine name") }} + {{ _("Allow") }} {% endif %} {% for search_engine in engines_by_category[categ] %} @@ -256,10 +264,10 @@

- - - - + + + + {% for answerer in answerers %} @@ -285,8 +293,8 @@ {% if cookies %}
{{ _('Name') }}{{ _('Keywords') }}{{ _('Description') }}{{ _('Examples') }}{{ _('Name') }}{{ _('Keywords') }}{{ _('Description') }}{{ _('Examples') }}
- - + + {% for cookie in cookies %} diff --git a/searx/templates/oscar/search.html b/searx/templates/oscar/search.html index 9978801ca..666a4df38 100644 --- a/searx/templates/oscar/search.html +++ b/searx/templates/oscar/search.html @@ -3,7 +3,7 @@
- + diff --git a/searx/templates/oscar/search_full.html b/searx/templates/oscar/search_full.html index ea821dc45..1f1c50e50 100644 --- a/searx/templates/oscar/search_full.html +++ b/searx/templates/oscar/search_full.html @@ -6,7 +6,7 @@ {% else %}
{% endif %} - + diff --git a/searx/templates/pix-art/search.html b/searx/templates/pix-art/search.html index 4d129ec68..bb40559db 100644 --- a/searx/templates/pix-art/search.html +++ b/searx/templates/pix-art/search.html @@ -1,6 +1,6 @@
- + {% for category in categories %} diff --git a/searx/templates/simple/search.html b/searx/templates/simple/search.html index e9023b420..61d52dbc7 100644 --- a/searx/templates/simple/search.html +++ b/searx/templates/simple/search.html @@ -1,7 +1,7 @@
diff --git a/searx/translations/fa_IR/LC_MESSAGES/messages.mo b/searx/translations/fa_IR/LC_MESSAGES/messages.mo index a2f503386..56c04178f 100644 Binary files a/searx/translations/fa_IR/LC_MESSAGES/messages.mo and b/searx/translations/fa_IR/LC_MESSAGES/messages.mo differ diff --git a/searx/translations/fa_IR/LC_MESSAGES/messages.po b/searx/translations/fa_IR/LC_MESSAGES/messages.po index 6689dafe7..28cfd1ed6 100644 --- a/searx/translations/fa_IR/LC_MESSAGES/messages.po +++ b/searx/translations/fa_IR/LC_MESSAGES/messages.po @@ -109,7 +109,7 @@ msgstr "توابع آماری" #: searx/answerers/statistics/answerer.py:54 msgid "Compute {functions} of the arguments" -msgstr "پردازش {عملکرد های} نشانوند ها
" +msgstr "پردازش {functions} نشانوند ها
" #: searx/engines/__init__.py:194 msgid "Engine time (sec)" diff --git a/searx/webapp.py b/searx/webapp.py index 8c3531069..f3f5f21b8 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -144,7 +144,7 @@ if not searx_debug \ babel = Babel(app) -rtl_locales = ['ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'glk', 'he', +rtl_locales = ['ar', 'arc', 'bcc', 'bqi', 'ckb', 'dv', 'fa', 'fa_IR', 'glk', 'he', 'ku', 'mzn', 'pnb', 'ps', 'sd', 'ug', 'ur', 'yi'] # used when translating category names
{{ _('Cookie name') }}{{ _('Value') }}{{ _('Cookie name') }}{{ _('Value') }}