Add partitions info to client details

Show a table with client's disks and partitions information.
multi-ogserver
Javier Sánchez Parra 2021-10-11 15:37:42 +02:00
parent 3e7801e487
commit 0b424aa34e
2 changed files with 39 additions and 1 deletions

View File

@ -10,4 +10,28 @@
button_map={'create': 'primary'},
extra_classes="mx-5") }}
<table class="table">
<tbody class="text-center">
<tr>
<th>Partition</th>
<th>Type</th>
<th>Filesytem</th>
<th>Size (KB)</th>
<th>Image</th>
<th colspan="2"></th>
</tr>
</tbody>
<tbody class="text-center">
{% for entry in setup %}
<tr>
<td>{{ entry.partition }}</td>
<td>{{ entry.code }}</td>
<td>{{ entry.filesystem }}</td>
<td>{{ entry.size }}</td>
<td>{{ entry.image }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@ -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