summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ogcp/templates/dashboard.html20
-rw-r--r--ogcp/views.py5
2 files changed, 19 insertions, 6 deletions
diff --git a/ogcp/templates/dashboard.html b/ogcp/templates/dashboard.html
index a9cea41..9c34768 100644
--- a/ogcp/templates/dashboard.html
+++ b/ogcp/templates/dashboard.html
@@ -1,12 +1,22 @@
{% extends 'base.html' %}
{% block content %}
-<div class="m-4 w-25 card text-center">
- <div class="card-header">
- Connected clients (ogClient)
+<div class="row">
+ <div class="m-4 w-25 card text-center">
+ <div class="card-header">
+ Connected clients (ogClient)
+ </div>
+ <div class="card-body">
+ <p class="card-text">{{ clients['clients'] | length }}</p>
+ </div>
</div>
- <div class="card-body">
- <p class="card-text">{{ clients['clients'] | length }}</p>
+ <div class="m-4 w-25 card text-center">
+ <div class="card-header">
+ Number of images
+ </div>
+ <div class="card-body">
+ <p class="card-text">{{ images | length }}</p>
+ </div>
</div>
</div>
{% endblock %}
diff --git a/ogcp/views.py b/ogcp/views.py
index 48ff798..44e9a6e 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -117,7 +117,10 @@ def index():
clients = None
if current_user.is_authenticated:
clients = get_clients()
- return render_template('dashboard.html', clients=clients)
+ images_response = g.server.get('/images')
+ images = images_response.json()['images']
+ return render_template('dashboard.html', clients=clients,
+ images=images)
return render_template('base.html')
@app.route('/login', methods=['GET', 'POST'])