use ids now
This commit is contained in:
parent
97e164e6e6
commit
75dadb2579
@ -1,6 +1,6 @@
|
|||||||
<tr{% if log.error %} class="error" {% endif %}>
|
<tr{% if log.error %} class="error" {% endif %}>
|
||||||
<td>{{log.action}}</td>
|
<td>{{log.action}}</td>
|
||||||
<td><a href="{{request.script_root}}/tracked/{{log.url}}">{{log.url}}</td>
|
<td><a href="{{request.script_root}}/tracked/{{log._id}}">{{log.url}}</td>
|
||||||
<td>{{log.timestamp.strftime("%Y-%m-%d %H:%M:%S")}}</td>
|
<td>{{log.timestamp.strftime("%Y-%m-%d %H:%M:%S")}}</td>
|
||||||
<td>{% if log.error %}{{log.error}}{% endif %}</td>
|
<td>{% if log.error %}{{log.error}}{% endif %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -86,23 +86,12 @@ def tracked():
|
|||||||
return json.dumps(tracked, cls=JSONEncoder)
|
return json.dumps(tracked, cls=JSONEncoder)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/tracked/<path:url>')
|
@app.route('/tracked/<path:id>')
|
||||||
def tracked_view(url):
|
def tracked_view(url):
|
||||||
url = _path_fixer(url)
|
url = _path_fixer(url)
|
||||||
doc = kernel.db.tracked.find_one({'url': url})
|
doc = kernel.db.tracked.find_one({'_id': id})
|
||||||
return json.dumps(doc, cls=JSONEncoder)
|
return json.dumps(doc, cls=JSONEncoder)
|
||||||
|
|
||||||
|
|
||||||
@app.route('/doc/<path:url>/<version>')
|
|
||||||
def show_doc(url, version):
|
|
||||||
url = _path_fixer(url)
|
|
||||||
if version == 'latest':
|
|
||||||
version = -1
|
|
||||||
doc = kernel.get_version(url, version)
|
|
||||||
resp = flask.make_response(doc.read())
|
|
||||||
resp.headers['content-type'] = doc.content_type
|
|
||||||
return resp
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app.run(debug=True)
|
app.run(debug=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user