index
This commit is contained in:
parent
512a5f8e55
commit
ffacdabb4e
@ -25,7 +25,7 @@
|
||||
{% endblock heading %}
|
||||
</h1>
|
||||
</div>
|
||||
<div class="span-18">
|
||||
<div class="span-20 prepend-2">
|
||||
{% block body %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
|
33
oyster/templates/index.html
Normal file
33
oyster/templates/index.html
Normal file
@ -0,0 +1,33 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block heading %}
|
||||
oyster
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
<div class="span-4">
|
||||
<h2>Stats</h2>
|
||||
<dl>
|
||||
<dt>Queue Size</dt><dd>{{queue_size}}</dd>
|
||||
<dt>Tracking</dt><dd>{{tracking}}</dd>
|
||||
<dt>Need Update</dt><dd>{{need_update}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
|
||||
<div class="span-12 prepend-2 last">
|
||||
<h2>Logs</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>action</th>
|
||||
<th>description</th>
|
||||
<th>timestamp</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
{% for log in logs %}
|
||||
{% include "log_row.html" %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
7
oyster/templates/log_row.html
Normal file
7
oyster/templates/log_row.html
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
<tr{% if log.error %} class="error" {% endif %}>
|
||||
<td>{{log.action}}</td>
|
||||
<td><a href="/tracked/{{log.url}}">{{log.url}}</td>
|
||||
<td>{{log.timestamp}}</td>
|
||||
<td>{% if log.error %}{{log.error}}{% endif %}</td>
|
||||
</tr>
|
@ -28,12 +28,7 @@ Oyster Logs
|
||||
<th> </th>
|
||||
</tr>
|
||||
{% for log in logs %}
|
||||
<tr{% if log.error %} class="error" {% endif %}>
|
||||
<td>{{log.action}}</td>
|
||||
<td><a href="/tracked/{{log.url}}">{{log.url}}</td>
|
||||
<td>{{log.timestamp}}</td>
|
||||
<td>{% if log.error %}{{log.error}}{% endif %}</td>
|
||||
</tr>
|
||||
{% include "log_row.html" %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
|
@ -36,6 +36,18 @@ app = flask.Flask('oyster')
|
||||
client = Client()
|
||||
|
||||
|
||||
@app.route('/')
|
||||
@api_wrapper('index.html')
|
||||
def index():
|
||||
status = {
|
||||
'queue_size': app.work_queue.qsize(),
|
||||
'tracking': client.db.tracked.count(),
|
||||
'need_update': client.get_update_queue_size(),
|
||||
'logs': client.db.logs.find().sort('$natural', -1).limit(20)
|
||||
}
|
||||
return status
|
||||
|
||||
|
||||
@app.route('/status/')
|
||||
@api_wrapper()
|
||||
def doc_list():
|
||||
|
Loading…
Reference in New Issue
Block a user