diff options
Diffstat (limited to 'ogcp/templates')
-rw-r--r-- | ogcp/templates/actions/client_details.html | 1 | ||||
-rw-r--r-- | ogcp/templates/disk_inspector.html | 31 |
2 files changed, 24 insertions, 8 deletions
diff --git a/ogcp/templates/actions/client_details.html b/ogcp/templates/actions/client_details.html index e462205..47b4721 100644 --- a/ogcp/templates/actions/client_details.html +++ b/ogcp/templates/actions/client_details.html @@ -38,6 +38,7 @@ </div> {% set show_part_images = True %} +{% set show_free_size = True %} {% set readonly_disk_inspector = True %} {% include 'disk_inspector.html' %} diff --git a/ogcp/templates/disk_inspector.html b/ogcp/templates/disk_inspector.html index 2f19ad2..f3f190a 100644 --- a/ogcp/templates/disk_inspector.html +++ b/ogcp/templates/disk_inspector.html @@ -37,6 +37,9 @@ <th>{{ _('Type') }}</th> <th>{{ _('Filesystem') }}</th> <th>{{ _('Size') }} (MiB)</th> + {% if show_free_size is defined %} + <th>{{ _('Free') }} (MiB)</th> + {% endif %} {% if show_part_images is defined %} <th>{{ _('Image') }}</th> {% endif %} @@ -64,12 +67,13 @@ {% endif %} </td> <td> - {% if readonly_disk_inspector is defined %} - {{ partition.size(class_="form-control", oninput="handleEdit(this)", readonly="readonly") }} - {% else %} + {% if not readonly_disk_inspector is defined %} {{ partition.size(class_="form-control", oninput="handleEdit(this)") }} {% endif %} </td> + {% if show_free_size is defined %} + <td></td> + {% endif %} {% if show_part_images is defined %} <td></td> {% endif %} @@ -291,12 +295,23 @@ let row = partitionsTable.find('tr').eq(i - 1); - row.find('td').eq(0).text(p.partition); - row.find('td').eq(1).find('select').val(p.code); - row.find('td').eq(2).find('select').val(p.filesystem); - row.find('td').eq(3).find('input').val(Math.floor(p.size / 1024)); + var idx = 0; + row.find('td').eq(idx++).text(p.partition); + row.find('td').eq(idx++).find('select').val(p.code); + row.find('td').eq(idx++).find('select').val(p.filesystem); + + {% if readonly_disk_inspector is defined %} + row.find('td').eq(idx++).text(Math.floor(p.size / 1024)); + {% else %} + row.find('td').eq(idx++).find('input').val(Math.floor(p.size / 1024)); + {% endif %} + + {% if show_free_size is defined %} + row.find('td').eq(idx++).text(Math.floor(p.free_size / (1024 * 1024))); + {% endif %} + {% if show_part_images is defined %} - row.find('td').eq(4).text(p.image); + row.find('td').eq(idx++).text(p.image); {% endif %} } |