From 93594a7b42cd4e2ddb8dc9ec0cd4d67e737e45b8 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 17 May 2021 17:26:24 +0200 Subject: [less] update grunt-contrib-less v3.3.0 Upgraded [v3.3.0] otherwise:: ` width: calc(100% - 5rem);` becomes `width: 95%` once compiled by less version 1.4.1. [v3.3.0] https://github.com/gruntjs/grunt-contrib-less/releases/tag/v3.0.0 Suggested-by: @dalf in commit 1204e4f0 Signed-off-by: Markus Heiser --- searx/static/themes/simple/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'searx/static') diff --git a/searx/static/themes/simple/package.json b/searx/static/themes/simple/package.json index 5150e8153..e84489947 100644 --- a/searx/static/themes/simple/package.json +++ b/searx/static/themes/simple/package.json @@ -4,7 +4,7 @@ "grunt-contrib-concat": "~1.0.1", "grunt-contrib-cssmin": "^2.2.1", "grunt-contrib-jshint": "~1.1.0", - "grunt-contrib-less": "^1.4.1", + "grunt-contrib-less": "~3.0.0", "grunt-contrib-uglify": "~3.4.0", "grunt-contrib-watch": "~1.1.0", "grunt-webfont": "^1.7.1", -- cgit v1.2.3 From 965817f2942c31eddba44ace307b6c872479b922 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 17 May 2021 17:38:33 +0200 Subject: [fix] simple theme - generate missing sourceMap file C&P from searx/static/themes/oscar/gruntfile.js Suggested-by: @dalf in commit 1204e4f0 Signed-off-by: Markus Heiser --- searx/static/themes/simple/gruntfile.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'searx/static') diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index 0c322f37f..4c14116b2 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -68,11 +68,12 @@ module.exports = function(grunt) { options: { paths: ["less"], plugins: [ - new (require('less-plugin-clean-css'))({ - advanced: true, - compatibility: '*' - }) + new (require('less-plugin-clean-css'))() ], + sourceMap: true, + sourceMapURL: (name) => { const s = name.split('/'); return s[s.length - 1] + '.map';}, + outputSourceFiles: false, + sourceMapRootpath: '../', banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n' }, files: { -- cgit v1.2.3 From cdfb4b7ff9829cb9048b573f7f1775dc8029f75a Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 16 May 2021 13:16:44 +0200 Subject: [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: {{- "" -}} ./simple/stats.html:57: {{- "" -}} ./simple/stats.html:58: {{- "" -}} ./oscar/stats.html:50: {{- "" -}} ./oscar/stats.html:58: {{- "" -}} ./oscar/stats.html:59: {{- "" -}} Reported-by: https://github.com/searxng/searxng/issues/57 Signed-off-by: Markus Heiser --- searx/static/themes/__common__/less/stats.less | 38 ++++++++++++++++++++++ .../oscar/src/less/logicodev-dark/oscar.less | 1 + .../themes/oscar/src/less/logicodev/oscar.less | 1 + .../oscar/src/less/logicodev/preferences.less | 14 -------- .../themes/oscar/src/less/pointhi/oscar.less | 1 + .../themes/oscar/src/less/pointhi/preferences.less | 15 --------- searx/static/themes/simple/less/style.less | 1 + searx/static/themes/simple/less/toolkit.less | 14 -------- 8 files changed, 42 insertions(+), 43 deletions(-) create mode 100644 searx/static/themes/__common__/less/stats.less (limited to 'searx/static') diff --git a/searx/static/themes/__common__/less/stats.less b/searx/static/themes/__common__/less/stats.less new file mode 100644 index 000000000..6c2117b39 --- /dev/null +++ b/searx/static/themes/__common__/less/stats.less @@ -0,0 +1,38 @@ +.bar-chart-value { + width: 3em; +} + +.bar-chart-graph { + width: 300px; +} + +.bar-chart-bar { + border: 3px solid #5bc0de; + margin: 1px 0; +} + +.bar-chart-serie1 { + border: 3px solid #5bc0de; + margin: 1px 0; + float: left; +} + +.bar-chart-serie2 { + border: 3px solid #deb15b; + margin: 1px 0; + float: left; +} + +.bar0{ + width: 0; + border: 0; +} + +.generate-bar(100); + +.generate-bar(@n, @i: 1) when (@i =< @n) { + .bar@{i} { + width: (@i * 100% / @n); + } + .generate-bar(@n, (@i + 1)); +} diff --git a/searx/static/themes/oscar/src/less/logicodev-dark/oscar.less b/searx/static/themes/oscar/src/less/logicodev-dark/oscar.less index 44d3154a8..53ee7ae31 100644 --- a/searx/static/themes/oscar/src/less/logicodev-dark/oscar.less +++ b/searx/static/themes/oscar/src/less/logicodev-dark/oscar.less @@ -1,5 +1,6 @@ @import "../logicodev/variables.less"; @import "../../../../__common__/less/new_issue.less"; +@import "../../../../__common__/less/stats.less"; @stacked-bar-chart: rgb(213, 216, 215, 1); diff --git a/searx/static/themes/oscar/src/less/logicodev/oscar.less b/searx/static/themes/oscar/src/less/logicodev/oscar.less index 3415af30b..57c351bd9 100644 --- a/searx/static/themes/oscar/src/less/logicodev/oscar.less +++ b/searx/static/themes/oscar/src/less/logicodev/oscar.less @@ -1,5 +1,6 @@ @import "variables.less"; @import "../../../../__common__/less/new_issue.less"; +@import "../../../../__common__/less/stats.less"; @import "navbar.less"; @import "footer.less"; diff --git a/searx/static/themes/oscar/src/less/logicodev/preferences.less b/searx/static/themes/oscar/src/less/logicodev/preferences.less index 790ed10b7..32e230413 100644 --- a/searx/static/themes/oscar/src/less/logicodev/preferences.less +++ b/searx/static/themes/oscar/src/less/logicodev/preferences.less @@ -89,17 +89,3 @@ td:hover .engine-tooltip, th:hover .engine-tooltip, .engine-tooltip:hover { padding: 0.4rem 0; width: 1px; } - -.stacked-bar-chart-serie1 { - .stacked-bar-chart-base(); - background: #5bc0de; - box-shadow: inset 0 -1px 0 rgba(0,0,0,.15); - padding: 0.4rem 0; -} - -.stacked-bar-chart-serie2 { - .stacked-bar-chart-base(); - background: #deb15b; - box-shadow: inset 0 -1px 0 rgba(0,0,0,.15); - padding: 0.4rem 0; -} diff --git a/searx/static/themes/oscar/src/less/pointhi/oscar.less b/searx/static/themes/oscar/src/less/pointhi/oscar.less index 4ac8da564..689fc1471 100644 --- a/searx/static/themes/oscar/src/less/pointhi/oscar.less +++ b/searx/static/themes/oscar/src/less/pointhi/oscar.less @@ -1,5 +1,6 @@ @import "variables.less"; @import "../../../../__common__/less/new_issue.less"; +@import "../../../../__common__/less/stats.less"; @import "footer.less"; @import "checkbox.less"; diff --git a/searx/static/themes/oscar/src/less/pointhi/preferences.less b/searx/static/themes/oscar/src/less/pointhi/preferences.less index 352aed513..25ba100d6 100644 --- a/searx/static/themes/oscar/src/less/pointhi/preferences.less +++ b/searx/static/themes/oscar/src/less/pointhi/preferences.less @@ -77,18 +77,3 @@ th:hover .engine-tooltip, td:hover .engine-tooltip, .engine-tooltip:hover { padding: 0.4rem 0; width: 1px; } - -.stacked-bar-chart-serie1 { - .stacked-bar-chart-base(); - background: #5bc0de; - box-shadow: inset 0 -1px 0 rgba(0,0,0,.15); - padding: 0.4rem 0; -} - -.stacked-bar-chart-serie2 { - .stacked-bar-chart-base(); - background: #deb15b; - box-shadow: inset 0 -1px 0 rgba(0,0,0,.15); - padding: 0.4rem 0; -} - diff --git a/searx/static/themes/simple/less/style.less b/searx/static/themes/simple/less/style.less index b82b1cb1f..3b0506b98 100644 --- a/searx/static/themes/simple/less/style.less +++ b/searx/static/themes/simple/less/style.less @@ -7,6 +7,7 @@ @stacked-bar-chart: rgb(0, 0, 0); @import "../../__common__/less/new_issue.less"; +@import "../../__common__/less/stats.less"; @import "normalize.less"; diff --git a/searx/static/themes/simple/less/toolkit.less b/searx/static/themes/simple/less/toolkit.less index 3e9274fc8..c381af802 100644 --- a/searx/static/themes/simple/less/toolkit.less +++ b/searx/static/themes/simple/less/toolkit.less @@ -551,17 +551,3 @@ th:hover .engine-tooltip, td:hover .engine-tooltip, .engine-tooltip:hover { padding: 0.4rem 0; width: 1px; } - -.stacked-bar-chart-serie1 { - .stacked-bar-chart-base(); - background: #5bc0de; - box-shadow: inset 0 -1px 0 rgba(0,0,0,.15); - padding: 0.4rem 0; -} - -.stacked-bar-chart-serie2 { - .stacked-bar-chart-base(); - background: #deb15b; - box-shadow: inset 0 -1px 0 rgba(0,0,0,.15); - padding: 0.4rem 0; -} -- cgit v1.2.3 From 0a6c488417f83fc2fbfcdb8d80b5978a14c561c4 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 16 May 2021 14:18:42 +0200 Subject: [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: ./simple/stats.html:28: ./simple/stats.html:29: ./simple/stats.html:32: ./simple/stats.html:37: ./simple/stats.html:106:
{{ th_sort('name', _("Engine name")) }}{{ th_sort('score', _('Scores')) }}{{ th_sort('reliability', _('Reliability')) }} ./simple/stats.html:90: {{ engine_reliabilities.get(engine_stat.name, {}).get('reliablity') }}
./simple/stats.html:107: ./simple/stats.html:110: ./simple/stats.html:112: ./simple/stats.html:114: ./simple/stats.html:119: {{ param }} ./simple/stats.html:136: Reported-by: https://github.com/searxng/searxng/issues/57 Signed-off-by: Markus Heiser --- searx/static/themes/__common__/less/stats.less | 47 ++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) (limited to 'searx/static') diff --git a/searx/static/themes/__common__/less/stats.less b/searx/static/themes/__common__/less/stats.less index 6c2117b39..2204fb02b 100644 --- a/searx/static/themes/__common__/less/stats.less +++ b/searx/static/themes/__common__/less/stats.less @@ -1,3 +1,50 @@ +#main_stats { + + table { + margin: 0 auto 0 0; + } + + table .engine-name { + width: 20rem; + } + + table .engine-scores { + width: 7rem; + } + + table .result-count { + } + + table .response-time { + } + + table .engine-reliability { + text-align: right; + } + + table.engine-error { + max-width: 1280px; + margin: 1rem; + border: 1px solid gray; + } + + table.engine-error th.engine-error-type, + table.engine-error td.engine-error-type, + failed-test { + width: 10rem; + } + + table.engine-error span.log_parameters + { + border-right: 1px solid gray; + padding: 0 1rem 0 0; + margin: 0 0 0 0.5rem; + } +} + +@media screen and (max-width: 75em) { +} + .bar-chart-value { width: 3em; } -- cgit v1.2.3 From 3e9ad7ae0c5d520e88bf686de9038d22907876f7 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sun, 16 May 2021 19:35:49 +0200 Subject: [fix] make /stats more CSP compliant - github issue form Hide textarea from github issue form:: ./__common__/new_issue.html:6:
{{ _('Exception') }}{{ error.exception_classname }}{{ _('Message') }}{{ error.log_message }}{{ _('Percentage') }}{{ error.percentage }}{{ _('Failed test') }}