updated configurator and streamlined getAndValidateExtraFields method.
This commit is contained in:
@@ -117,6 +117,11 @@
|
||||
<input type="text" id="inputOIDCAuthURL" class="form-control">
|
||||
<small class="text-body-secondary">URL to Provider Login</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="inputOIDCLogOutURL">Logout URL</label>
|
||||
<input type="text" id="inputOIDCLogOutURL" class="form-control">
|
||||
<small class="text-body-secondary">Required if SSO Login Only</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<div class="form-group">
|
||||
@@ -143,6 +148,10 @@
|
||||
<input class="form-check-input"type="checkbox" role="switch" id="inputOIDCUsePKCE">
|
||||
<label class="form-check-label" for="inputOIDCUsePKCE">PKCE</label>
|
||||
</div>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input"type="checkbox" role="switch" id="inputOIDCOnly">
|
||||
<label class="form-check-label" for="inputOIDCOnly">SSO Login Only</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -259,7 +268,9 @@ function generateConfig(){
|
||||
RedirectURL: redirectUrl,
|
||||
Scope: $("#inputOIDCScope").val(),
|
||||
ValidateState: $("#inputOIDCValidateState").is(":checked"),
|
||||
UsePKCE: $("#inputOIDCUsePKCE").is(":checked")
|
||||
UsePKCE: $("#inputOIDCUsePKCE").is(":checked"),
|
||||
DisableRegularLogin: $("#inputOIDCOnly").is(":checked"),
|
||||
LogOutURL: $("#inputOIDCLogOutURL").val()
|
||||
};
|
||||
}
|
||||
if ($('#inputCertPath').val().trim() != ''){
|
||||
@@ -320,6 +331,8 @@ function generateConfig(){
|
||||
dockerConfig.push(`OpenIDConfig__Scope="${$('#inputOIDCScope').val()}"`);
|
||||
dockerConfig.push(`OpenIDConfig__ValidateState=${$('#inputOIDCValidateState').is(':checked')}`);
|
||||
dockerConfig.push(`OpenIDConfig__UsePKCE=${$('#inputOIDCUsePKCE').is(':checked')}`);
|
||||
dockerConfig.push(`OpenIDConfig__DisableRegularLogin=${$('#inputOIDCOnly').is(':checked')}`);
|
||||
dockerConfig.push(`OpenIDConfig__LogOutURL="${$('#inputOIDCLogOutURL').val()}"`);
|
||||
}
|
||||
if ($('#inputCertPath').val().trim() != ''){
|
||||
dockerConfig.push(`ASPNETCORE_Kestrel__Certificates__Default__Path="${$('#inputCertPath').val()}"`);
|
||||
|
||||
@@ -52,7 +52,7 @@ function saveVehicle(isEdit) {
|
||||
var vehicleDashboardMetrics = $("#collapseMetricInfo :checked").map(function () {
|
||||
return this.value;
|
||||
}).toArray();
|
||||
var extraFields = getAndValidateExtraFields(true);
|
||||
var extraFields = getAndValidateExtraFields();
|
||||
//validate
|
||||
var hasError = false;
|
||||
if (extraFields.hasError) {
|
||||
@@ -487,11 +487,12 @@ function showBulkImportModal(mode) {
|
||||
function hideBulkImportModal() {
|
||||
$("#bulkImportModal").modal('hide');
|
||||
}
|
||||
function getAndValidateExtraFields(isVehicle) {
|
||||
function getAndValidateExtraFields() {
|
||||
var hasError = false;
|
||||
var outputData = [];
|
||||
var fieldName = isVehicle ? '#addVehicleModalContent .extra-field,#editVehicleModalContent .extra-field' : '.extra-field:not(#addVehicleModalContent .extra-field, #editVehicleModalContent .extra-field)';
|
||||
$(`${fieldName}`).map((index, elem) => {
|
||||
//get extra fields in modal that is currently open.
|
||||
var extraFieldsVisible = $(".modal.fade.show").find(".extra-field");
|
||||
extraFieldsVisible.map((index, elem) => {
|
||||
var extraFieldName = $(elem).children("label").text();
|
||||
var extraFieldInput = $(elem).children("input");
|
||||
var extraFieldValue = extraFieldInput.val();
|
||||
|
||||
Reference in New Issue
Block a user