浏览代码

[enh] view for stats

asciimoo 11 年前
父节点
当前提交
66d9619862
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7
    1
      searx/webapp.py

+ 7
- 1
searx/webapp.py 查看文件

@@ -23,7 +23,7 @@ if __name__ == "__main__":
23 23
     path.append(realpath(dirname(realpath(__file__))+'/../'))
24 24
 
25 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 27
 from searx import settings
28 28
 import json
29 29
 
@@ -105,6 +105,12 @@ def about():
105 105
     global categories
106 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 114
 @app.route('/opensearch.xml', methods=['GET'])
109 115
 def opensearch():
110 116
     global opensearch_xml