From d00e437b8d76bc32732643a92f0ea32fbe0b7901 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Thu, 29 Aug 2024 11:55:52 +0200 Subject: ogcp: add support for multi-disk partition and format Add support for selecting different disks in the disk inspector. Add disk_inspector.html as a template to show the disk contents of a client. The view can define the variable readonly_disk_inspector to make the view non editable. Use disk_inspector.html in the following views: - client details - partition and format Update code to obtain the partitions of a client to better fit the requirements of disk_inspector.html Remove code to setup the SetupForm as the contents of the disks are now dynamically loaded through javascript. --- ogcp/templates/disk_inspector.html | 306 +++++++++++++++++++++++++++++++++++++ 1 file changed, 306 insertions(+) create mode 100644 ogcp/templates/disk_inspector.html (limited to 'ogcp/templates/disk_inspector.html') diff --git a/ogcp/templates/disk_inspector.html b/ogcp/templates/disk_inspector.html new file mode 100644 index 0000000..90a8996 --- /dev/null +++ b/ogcp/templates/disk_inspector.html @@ -0,0 +1,306 @@ +{% if selected_disk is defined and setup_data is defined %} + +
+ {{ disk_form.hidden_tag() }} + {{ disk_form.ips() }} + + + + + + + + + + + + + + {{ disk_form.hidden_tag() }} + + + + +
{{ _('Disk') }}{{ _('Partition Table Type') }}{{ _('Total Disk Size') }} (MiB)
+ {{ disk_form.disk(class_="form-control", onchange="handleDiskChange(this)") }} + + {% if readonly_disk_inspector is defined %} + {{ disk_form.disk_type(class_="form-control", id="diskType", readonly="readonly") }} + {% else %} + {{ disk_form.disk_type(class_="form-control", id="diskType") }} + {% endif %} + {{ disk_size }}
+ + + + + + + + {% if show_part_images is defined %} + + {% endif %} + + + + + + {% for partition in disk_form.partitions %} + + {{ partition.hidden_tag() }} + + + + + {% if show_part_images is defined %} + + {% endif %} + + + {% endfor %} + +
{{ _('Partition') }}{{ _('Type') }}{{ _('Filesystem') }}{{ _('Size') }} (MiB){{ _('Image') }}
{{ partition.partition.data }} + {% if readonly_disk_inspector is defined %} + {{ partition.part_type(class_="form-control", readonly="readonly") }} + {% else %} + {{ partition.part_type(class_="form-control") }} + {% endif %} + + {% if readonly_disk_inspector is defined %} + {{ partition.fs(class_="form-control", readonly="readonly") }} + {% else %} + {{ partition.fs(class_="form-control") }} + {% endif %} + + {% if readonly_disk_inspector is defined %} + {{ partition.size(class_="form-control", oninput="handleEdit(this)", readonly="readonly") }} + {% else %} + {{ partition.size(class_="form-control", oninput="handleEdit(this)") }} + {% endif %} + + +
+
+ + + +{% if not readonly_disk_inspector is defined %} + +{% endif %} + +
+
+ {{ _('Partition graph') }} +
+
+ +
+
+ + + + + + + +{% endif %} -- cgit v1.2.3-18-g5258