From 7c3144b5f56f123a44ff324252ddb63306aa10e6 Mon Sep 17 00:00:00 2001 From: Robert Bartel Date: Tue, 13 Aug 2024 15:10:53 -0400 Subject: [PATCH] Finishing domain GUI submit setup. --- python/gui/MaaS/static/common/js/domain.js | 27 +++++++++++++++++++--- python/gui/MaaS/templates/maas/domain.html | 6 ++--- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/python/gui/MaaS/static/common/js/domain.js b/python/gui/MaaS/static/common/js/domain.js index 39c53a757..640361d26 100644 --- a/python/gui/MaaS/static/common/js/domain.js +++ b/python/gui/MaaS/static/common/js/domain.js @@ -19,7 +19,7 @@ function loadFabricNames() { $("#fabric-selector").append(""); }); $("#fabric-selector option")[0].setAttribute("selected", ""); - loadFabric(); + loadFabricDomain(); } } } @@ -40,7 +40,7 @@ function loadFabricTypes() { $("#fabric-type-selector").append(""); }); $("#fabric-type-selector option")[0].setAttribute("selected", ""); - loadFabric(); + loadFabricDomain(); } } } @@ -140,7 +140,7 @@ function controlSelectClear() { function loadFabricDomain(event) { var name = $("#fabric-selector").val(), - type = $("#fabric-type-selector").val(), + type = "catchment", //$("#fabric-type-selector").val(), catLists = [document.getElementById('domainChoices'), document.getElementById('domainSelections')], loadingOverDiv = document.getElementById('loadCatsOverlay'), @@ -183,3 +183,24 @@ function loadFabricDomain(event) { } ) } + +function submitCatchments(event) { + var featuresToConfigure = [], + selections = document.getElementById('domainSelections'), + selectForm = document.getElementById('location-selection-form'), + i; + + for (i = 0; i < selections.options.length; i++) { + featuresToConfigure.push('cat-' + selections.options[i].value) + } + + if (featuresToConfigure.length == 0) { + event.preventDefault(); + alert("Select a location to configure before continuing."); + return; + } + + selectForm['feature-ids'].value = featuresToConfigure.join("|"); + selectForm['framework'].value = 'ngen'; + selectForm.submit(); +} \ No newline at end of file diff --git a/python/gui/MaaS/templates/maas/domain.html b/python/gui/MaaS/templates/maas/domain.html index bda264411..a9c764752 100644 --- a/python/gui/MaaS/templates/maas/domain.html +++ b/python/gui/MaaS/templates/maas/domain.html @@ -93,7 +93,7 @@
- +
@@ -111,8 +111,8 @@ {% endblock content %}