update tracked view to take id instead of URL
This commit is contained in:
parent
4174a25595
commit
f2c2e2d6f2
@ -1,7 +1,7 @@
|
||||
|
||||
<tr{% if log.error %} class="error" {% endif %}>
|
||||
<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>{% if log.error %}{{log.error}}{% endif %}</td>
|
||||
</tr>
|
||||
|
@ -85,10 +85,9 @@ def tracked():
|
||||
return json.dumps(tracked, cls=JSONEncoder)
|
||||
|
||||
|
||||
@app.route('/tracked/<path:url>')
|
||||
def tracked_view(url):
|
||||
url = _path_fixer(url)
|
||||
doc = client.db.tracked.find_one({'url': url})
|
||||
@app.route('/tracked/<id>')
|
||||
def tracked_view(id):
|
||||
doc = client.db.tracked.find_one({'_id': id})
|
||||
return json.dumps(doc, cls=JSONEncoder)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user