diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-08-22 10:04:55 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-08-22 10:04:55 +0200 |
commit | bcd18241c7bf0363d00b2203c294d443b22d7807 (patch) | |
tree | 4a9da83ba813e7035323231ef4af106b9ef24b45 /ogcp/static/js/ogcp.js | |
parent | aab70b0222c90d5a852c1d465be35f9591d4a48c (diff) |
ogcp: add disk restrictions in partition and format
Use common disk space across all the selected clients.
Show dynamic disk partition graph in the partition view.
Limit partition sizes dynamically in the form.
Move js code to handle the addition and removal of
partitions into the html file to debloat ogcp.js and keep
the functions local to the only file they manipulate.
Diffstat (limited to 'ogcp/static/js/ogcp.js')
-rw-r--r-- | ogcp/static/js/ogcp.js | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js index b70b49d..9e6fd4f 100644 --- a/ogcp/static/js/ogcp.js +++ b/ogcp/static/js/ogcp.js @@ -341,50 +341,6 @@ function unfoldAll() { $('#scopes .collapse').collapse('show'); } -function AddPartition(evt) { - const target = $($(evt).data("target")); - const oldrow = target.find("[data-toggle=fieldset-entry]:last"); - const row = oldrow.clone(true, true); - const elem_id = row.find(".form-control")[0].id; - const elem_num = parseInt(elem_id.replace(/(.*)-(\d{1,4})/m, '$2')) + 1; - // Increment WTForms unique identifiers - row.find('.form-control').each(function() { - const id = $(this).attr('id').replace(/(.*)-(\d{1,4})-(.*)/, `$1-${elem_num}-$3`); - $(this).attr('name', id).attr('id', id).val('').removeAttr("checked"); - }); - let part_field = row.find('td').filter(':first')[0]; - part_field.innerText = elem_num + 1; - row.show(); - oldrow.after(row); -} - -function RemovePartition(evt) { - const target = $(evt).parent().parent(); - const table = target.parent(); - - if (table[0].children.length > 1) { - target.remove(); - // Reassign rows ids - table.find('tr').each(function(index) { - function update_references() { - const id = $(this).attr('id').replace(/(.*)-(\d{1,4})-(.*)/, `$1-${index}-$3`); - $(this).attr('name', id).attr('id', id); - } - - let part_field = $(this).find('td').filter(':first')[0]; - part_field.innerText = index + 1; - $(this).find('input').filter(':first').each(update_references); - $(this).find('.form-control').each(update_references); - }); - } else { - table.find('tr').each(function(index) { - $(this).find('.form-control').each(function() { - $(this).val('').removeAttr("checked"); - }); - }); - } -} - function checkImageServer() { const images = $('input:checkbox[form|="imagesForm"][name!="image-server"]') |