diff --git a/ogcp/static/js/ogcp.js b/ogcp/static/js/ogcp.js index bdd7581..d5615b8 100644 --- a/ogcp/static/js/ogcp.js +++ b/ogcp/static/js/ogcp.js @@ -248,3 +248,20 @@ function RemovePartition(evt) { }); } +function checkImageServer() { + const images = $('input:checkbox[form|="imagesForm"]:not(:hidden)') + + images.on('change', function() { + const selectedServer = $('#' + $.escapeSelector(this.dataset.server)); + const serversSelector = 'input:checkbox[name|="image-server"]'; + const nonSelectedServers = $(serversSelector).not(selectedServer); + + selectedServer.prop('checked', true); + + nonSelectedServers.each(function() { + $(this).prop('checked', false); + const checkboxes = $('input:checkbox[data-server|="' + this.id + '"]'); + checkboxes.prop('checked', false); + }); + }); +} diff --git a/ogcp/templates/images.html b/ogcp/templates/images.html index 4231df2..d053913 100644 --- a/ogcp/templates/images.html +++ b/ogcp/templates/images.html @@ -8,17 +8,31 @@ {{ super() }} + + {% endblock %} {% block sidebar %}