Parcourir la source

[enh] view for stats

asciimoo il y a 11 ans
Parent
révision
66d9619862
1 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. 7
    1
      searx/webapp.py

+ 7
- 1
searx/webapp.py Voir le fichier

23
     path.append(realpath(dirname(realpath(__file__))+'/../'))
23
     path.append(realpath(dirname(realpath(__file__))+'/../'))
24
 
24
 
25
 from flask import Flask, request, render_template, url_for, Response, make_response
25
 from flask import Flask, request, render_template, url_for, Response, make_response
26
-from searx.engines import search, categories
26
+from searx.engines import search, categories, get_engines_stats
27
 from searx import settings
27
 from searx import settings
28
 import json
28
 import json
29
 
29
 
105
     global categories
105
     global categories
106
     return render('about.html', categs=categories.items())
106
     return render('about.html', categs=categories.items())
107
 
107
 
108
+@app.route('/stats', methods=['GET'])
109
+def stats():
110
+    global categories
111
+    stats = get_engines_stats()
112
+    return render('stats.html', stats=stats)
113
+
108
 @app.route('/opensearch.xml', methods=['GET'])
114
 @app.route('/opensearch.xml', methods=['GET'])
109
 def opensearch():
115
 def opensearch():
110
     global opensearch_xml
116
     global opensearch_xml