diff --git a/oyster/templates/base.html b/oyster/templates/base.html
index dd17f28..2a3762e 100644
--- a/oyster/templates/base.html
+++ b/oyster/templates/base.html
@@ -25,7 +25,7 @@
{% endblock heading %}
-
+
{% block body %}
{% endblock %}
diff --git a/oyster/templates/index.html b/oyster/templates/index.html
new file mode 100644
index 0000000..0501831
--- /dev/null
+++ b/oyster/templates/index.html
@@ -0,0 +1,33 @@
+{% extends "base.html" %}
+
+{% block heading %}
+oyster
+{% endblock %}
+
+{% block body %}
+
+
+
Stats
+
+ - Queue Size
- {{queue_size}}
+ - Tracking
- {{tracking}}
+ - Need Update
- {{need_update}}
+
+
+
+
+
Logs
+
+
+ action |
+ description |
+ timestamp |
+ |
+
+ {% for log in logs %}
+ {% include "log_row.html" %}
+ {% endfor %}
+
+
+
+{% endblock %}
diff --git a/oyster/templates/log_row.html b/oyster/templates/log_row.html
new file mode 100644
index 0000000..d4930cd
--- /dev/null
+++ b/oyster/templates/log_row.html
@@ -0,0 +1,7 @@
+
+
+ {{log.action}} |
+ {{log.url}} |
+ {{log.timestamp}} |
+ {% if log.error %}{{log.error}}{% endif %} |
+
diff --git a/oyster/templates/logs.html b/oyster/templates/logs.html
index e3c2cbe..7e3b009 100644
--- a/oyster/templates/logs.html
+++ b/oyster/templates/logs.html
@@ -28,12 +28,7 @@ Oyster Logs
|
{% for log in logs %}
-
- {{log.action}} |
- {{log.url}} |
- {{log.timestamp}} |
- {% if log.error %}{{log.error}}{% endif %} |
-
+ {% include "log_row.html" %}
{% endfor %}
diff --git a/oyster/web.py b/oyster/web.py
index 2576b6b..1ae9669 100644
--- a/oyster/web.py
+++ b/oyster/web.py
@@ -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():