Skip to content

Commit

Permalink
Finishing domain GUI submit setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbartel committed Aug 22, 2024
1 parent b23de0a commit 0b11f85
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
27 changes: 24 additions & 3 deletions python/gui/MaaS/static/common/js/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function loadFabricNames() {
$("#fabric-selector").append("<option value='" + name + "'>" + titleCase(name) + "</option>");
});
$("#fabric-selector option")[0].setAttribute("selected", "");
loadFabric();
loadFabricDomain();
}
}
}
Expand All @@ -40,7 +40,7 @@ function loadFabricTypes() {
$("#fabric-type-selector").append("<option value='" + name + "'>" + titleCase(name) + "</option>");
});
$("#fabric-type-selector option")[0].setAttribute("selected", "");
loadFabric();
loadFabricDomain();
}
}
}
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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();
}
6 changes: 3 additions & 3 deletions python/gui/MaaS/templates/maas/domain.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@

</div>
<div id="submit-selection" style="padding-top: 25px">
<button type="submit" id="submit-values-button" style="float: left" class="MaaS-btn">Continue</button>
<button type="submit" id="submit-values-button" style="float: left" class="MaaS-btn" onclick="submitCatchments()">Continue</button>
</div>
</div>

Expand All @@ -111,8 +111,8 @@

<script>
startup_scripts.push(loadFabricNames);
startup_scripts.push(loadFabricTypes);
startup_scripts.push(loadFabric);
//startup_scripts.push(loadFabricTypes);
startup_scripts.push(loadFabricDomain);
</script>

{% endblock content %}

0 comments on commit 0b11f85

Please sign in to comment.