forked from Ponysearch/Ponysearch
[enh] stat bar graphs
This commit is contained in:
parent
4f4ec44bb3
commit
afe767d8e9
3 changed files with 12 additions and 5 deletions
|
@ -180,6 +180,6 @@ def get_engines_stats():
|
||||||
engine['percentage'] = int(engine['avg']/max_results*100)
|
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))
|
,('Number of results', sorted(results, key=itemgetter('avg'), reverse=True))
|
||||||
]
|
]
|
||||||
|
|
|
@ -84,9 +84,16 @@ a { text-decoration: none; }
|
||||||
|
|
||||||
.invisible { display: none; }
|
.invisible { display: none; }
|
||||||
|
|
||||||
|
.left { float: left; }
|
||||||
|
|
||||||
.image_result { float: left; margin: 10px 10px; position: relative; height: 160px;}
|
.image_result { float: left; margin: 10px 10px; position: relative; height: 160px;}
|
||||||
.image_result img { border: 0; height: 160px;}
|
.image_result img { border: 0; height: 160px;}
|
||||||
.image_result p { margin: 0; padding: 0; }
|
.image_result p { margin: 0; padding: 0; }
|
||||||
.image_result p span a { display: none; }
|
.image_result p span a { display: none; }
|
||||||
.image_result p span a { color: #FFFFFF; }
|
.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; }
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<h2>Engine stats</h2>
|
<h2>Engine stats</h2>
|
||||||
|
|
||||||
{% for stat_name,stat_category in stats %}
|
{% for stat_name,stat_category in stats %}
|
||||||
<div>
|
<div class="left">
|
||||||
<table>
|
<table>
|
||||||
<tr colspan="3">
|
<tr colspan="3">
|
||||||
<th>{{ stat_name }}</th>
|
<th>{{ stat_name }}</th>
|
||||||
|
@ -12,8 +12,8 @@
|
||||||
{% for engine in stat_category %}
|
{% for engine in stat_category %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ engine.name }}</td>
|
<td>{{ engine.name }}</td>
|
||||||
<td>{{ engine.percentage }}</td>
|
<td>{{ '%.02f'|format(engine.avg) }}</td>
|
||||||
<td>{{ engine.avg }}</td>
|
<td class="percentage"><div style="width: {{ engine.percentage }}%"> </div></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in a new issue