From afe767d8e935e33a8aafd0c2a8fe3686a7d1a248 Mon Sep 17 00:00:00 2001 From: asciimoo Date: Sun, 27 Oct 2013 02:59:32 +0200 Subject: [PATCH] [enh] stat bar graphs --- searx/engines/__init__.py | 2 +- searx/static/css/style.css | 9 ++++++++- searx/templates/stats.html | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/searx/engines/__init__.py b/searx/engines/__init__.py index 016f06b08..a9a23f080 100644 --- a/searx/engines/__init__.py +++ b/searx/engines/__init__.py @@ -180,6 +180,6 @@ def get_engines_stats(): engine['percentage'] = int(engine['avg']/max_results*100) - return [('Page loads', sorted(pageloads, key=itemgetter('avg'), reverse=True)) + return [('Page loads (sec)', sorted(pageloads, key=itemgetter('avg'), reverse=True)) ,('Number of results', sorted(results, key=itemgetter('avg'), reverse=True)) ] diff --git a/searx/static/css/style.css b/searx/static/css/style.css index 47ce2d1b2..d83e1b935 100644 --- a/searx/static/css/style.css +++ b/searx/static/css/style.css @@ -84,9 +84,16 @@ a { text-decoration: none; } .invisible { display: none; } +.left { float: left; } + .image_result { float: left; margin: 10px 10px; position: relative; height: 160px;} .image_result img { border: 0; height: 160px;} .image_result p { margin: 0; padding: 0; } .image_result p span a { display: none; } .image_result p span a { color: #FFFFFF; } -.image_result p:hover span a { display: block; position: absolute; bottom: 0; right: 0; padding: 4px; background-color: rgba(0, 0, 0, 0.6); font-size: 0.7em; } +image_result p:hover span a { display: block; position: absolute; bottom: 0; right: 0; padding: 4px; background-color: rgba(0, 0, 0, 0.6); font-size: 0.7em; } + +.percentage { position: relative; width: 300px; } +.percentage div { background: #444444; } +td { padding: 0 4px; } +tr:hover td { background: #DDDDDD; } diff --git a/searx/templates/stats.html b/searx/templates/stats.html index 66623629c..933616e32 100644 --- a/searx/templates/stats.html +++ b/searx/templates/stats.html @@ -4,7 +4,7 @@

Engine stats

{% for stat_name,stat_category in stats %} -
+
@@ -12,8 +12,8 @@ {% for engine in stat_category %} - - + + {% endfor %}
{{ stat_name }}
{{ engine.name }}{{ engine.percentage }}{{ engine.avg }}{{ '%.02f'|format(engine.avg) }}