bringing back basic web interface

This commit is contained in:
James Turk 2012-05-16 15:51:55 -04:00
parent 6153bdaf2a
commit 2677ed18b7
2 changed files with 6 additions and 16 deletions

View File

@ -1,6 +1,6 @@
<tr{% if log.error %} class="error" {% endif %}>
<td>{{log.action}}</td>
<td>{{log.doc_id}} - {{log.url}}</td>
<td>{{log.timestamp.strftime("%Y-%m-%d %H:%M:%S")}}</td>
<td>{% if log.error %}{{log.error}}{% endif %}</td>
<tr class="{{log.levelname.lower}}">
<td>{{log.name}}</td>
<td>{{log.message}}</td>
<td>{{log.created.strftime("%Y-%m-%d %H:%M:%S")}}</td>
<td>{% if log.exc_info %}{{log.exc_info}}{% endif %}</td>
</tr>

View File

@ -51,22 +51,12 @@ def index():
status = {
'tracking': kernel.db.tracked.count(),
'need_update': kernel.get_update_queue_size(),
'logs': list(kernel.db.logs.find().sort('$natural', -1).limit(20)),
'logs': list(kernel.db.logs.find().sort('$natural', -1).limit(100)),
'mongo_host': settings.MONGO_HOST,
}
return status
@app.route('/status/')
@api_wrapper()
def doc_list():
status = {
'tracking': kernel.db.tracked.count(),
'need_update': kernel.get_update_queue_size(),
}
return status
@app.route('/log/')
@api_wrapper('logs.html')
def log_view():