summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2021-10-11 15:37:42 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2021-10-13 13:06:49 +0200
commit0b424aa34effb9865e8e7cbcefe73d77b9465647 (patch)
tree362e7e3b4bbedef6abb88e25ee9e2f0c1ba0a555 /ogcp/views.py
parent3e7801e4872ac81f67e746da89cda43fd00ff592 (diff)
Add partitions info to client details
Show a table with client's disks and partitions information.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index a42642f..77e63ac 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -527,7 +527,21 @@ def action_client_info():
form.room.choices = list(rooms)
form.create.render_kw = {"style": "visibility:hidden;"}
- return render_template('actions/client_details.html', form=form)
+
+ r = g.server.get('/images')
+ images = r.json()['images']
+
+ setup = get_client_setup(ips)
+
+ for entry in setup:
+ if entry['image'] != 0:
+ image = next(img for img in images if img['id'] == entry['image'])
+ entry['image'] = image['name']
+ else:
+ entry['image'] = ""
+
+ return render_template('actions/client_details.html', form=form,
+ setup=setup)
@app.route('/action/client/add', methods=['GET', 'POST'])
@login_required