summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/templates/dashboard.html33
-rw-r--r--ogcp/views.py3
2 files changed, 35 insertions, 1 deletions
diff --git a/ogcp/templates/dashboard.html b/ogcp/templates/dashboard.html
index 518ae20..0f022c3 100644
--- a/ogcp/templates/dashboard.html
+++ b/ogcp/templates/dashboard.html
@@ -12,6 +12,39 @@
</div>
<div class="m-4 w-25 card text-center">
<div class="card-header">
+ Disk stats
+ </div>
+ <div class="card-body">
+ <ul class="list-group list-group-horizontal">
+ <li class="list-group-item w-50">
+ Disk size
+ </li>
+ <li class="list-group-item w-50">
+ used
+ </li>
+ <li class="list-group-item w-50">
+ available
+ </li>
+ <li class="list-group-item w-50">
+ use(%)
+ </li>
+ </ul>
+ <ul class="list-group list-group-horizontal">
+ <li class="list-group-item w-50">
+ {{ disk['total'] // 2**30 }} Gbytes
+ </li>
+ <li class="list-group-item w-50">
+ {{ (disk['total'] - disk['free']) // 2**30 }} Gbytes
+ </li>
+ <li class="list-group-item w-50">
+ {{ disk['free'] // 2**30 }} Gbytes
+ </li>
+ <li class="list-group-item w-50">
+ {{ (((disk['total'] - disk['free']) / disk['total']) * 100)|int }}%
+ </li>
+ </ul>
+ </div>
+ <div class="card-header">
Number of images
</div>
<div class="card-body">
diff --git a/ogcp/views.py b/ogcp/views.py
index 09454f7..e9a40c8 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -124,8 +124,9 @@ def index():
images_response = g.server.get('/images')
images = images_response.json()['images']
images.sort(key=image_modified_date_from_str, reverse=True)
+ disk = images_response.json()['disk']
return render_template('dashboard.html', clients=clients,
- images=images)
+ images=images, disk=disk)
return render_template('base.html')
@app.route('/login', methods=['GET', 'POST'])