Code Consistency - Quotes, Formatting, Whitespace
This commit is contained in:
parent
c53af91e48
commit
1f416e38bf
3 changed files with 20 additions and 20 deletions
30
dist/js/main.js
vendored
30
dist/js/main.js
vendored
|
@ -488,29 +488,29 @@ function switchMode(operatingMode) {
|
||||||
renderTable(operatingMode);
|
renderTable(operatingMode);
|
||||||
set_usable_ips_title(operatingMode);
|
set_usable_ips_title(operatingMode);
|
||||||
|
|
||||||
$('#netsize').attr("pattern",netsizePatterns[operatingMode]);
|
$('#netsize').attr('pattern', netsizePatterns[operatingMode]);
|
||||||
$('#input_form').removeClass('was-validated');
|
$('#input_form').removeClass('was-validated');
|
||||||
$('#input_form').rules("remove", "netsize");
|
$('#input_form').rules('remove', 'netsize');
|
||||||
|
|
||||||
switch (operatingMode) {
|
switch (operatingMode) {
|
||||||
case 'AWS':
|
case 'AWS':
|
||||||
var validate_error_message = "AWS Mode - Smallest size is /" + minSubnetSizes[operatingMode]
|
var validate_error_message = 'AWS Mode - Smallest size is /' + minSubnetSizes[operatingMode]
|
||||||
break;
|
break;
|
||||||
case 'AZURE':
|
case 'AZURE':
|
||||||
var validate_error_message = "Azure Mode - Smallest size is /" + minSubnetSizes[operatingMode]
|
var validate_error_message = 'Azure Mode - Smallest size is /' + minSubnetSizes[operatingMode]
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
var validate_error_message = "Smallest size is /" + minSubnetSizes[operatingMode]
|
var validate_error_message = 'Smallest size is /' + minSubnetSizes[operatingMode]
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Modify jquery validation rule
|
// Modify jquery validation rule
|
||||||
$('#input_form #netsize').rules("add", {
|
$('#input_form #netsize').rules('add', {
|
||||||
required: true,
|
required: true,
|
||||||
pattern: netsizePatterns[operatingMode],
|
pattern: netsizePatterns[operatingMode],
|
||||||
messages: {
|
messages: {
|
||||||
required: "Please enter a network size",
|
required: 'Please enter a network size',
|
||||||
pattern: validate_error_message
|
pattern: validate_error_message
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -527,7 +527,7 @@ function switchMode(operatingMode) {
|
||||||
var modal_error_message = 'One or more subnets are smaller than the minimum allowed for Azure.<br/>The smallest size allowed is /' + minSubnetSizes[operatingMode] + '.<br/>See: <a href="https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-faq#how-small-and-how-large-can-virtual-networks-and-subnets-be" target="_blank">Azure Virtual Network FAQ > How small and how large can virtual networks and subnets be?</a>'
|
var modal_error_message = 'One or more subnets are smaller than the minimum allowed for Azure.<br/>The smallest size allowed is /' + minSubnetSizes[operatingMode] + '.<br/>See: <a href="https://learn.microsoft.com/en-us/azure/virtual-network/virtual-networks-faq#how-small-and-how-large-can-virtual-networks-and-subnets-be" target="_blank">Azure Virtual Network FAQ > How small and how large can virtual networks and subnets be?</a>'
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
var validate_error_message = "Unknown Error"
|
var validate_error_message = 'Unknown Error'
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
show_warning_modal('<div>' + modal_error_message + '</div>');
|
show_warning_modal('<div>' + modal_error_message + '</div>');
|
||||||
|
@ -579,7 +579,7 @@ function set_usable_ips_title(operatingMode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function show_warning_modal(message) {
|
function show_warning_modal(message) {
|
||||||
var notifyModal = new bootstrap.Modal(document.getElementById("notifyModal"), {});
|
var notifyModal = new bootstrap.Modal(document.getElementById('notifyModal'), {});
|
||||||
$('#notifyModal .modal-body').html(message)
|
$('#notifyModal .modal-body').html(message)
|
||||||
notifyModal.show()
|
notifyModal.show()
|
||||||
}
|
}
|
||||||
|
@ -594,21 +594,21 @@ $( document ).ready(function() {
|
||||||
rules: {
|
rules: {
|
||||||
network: {
|
network: {
|
||||||
required: true,
|
required: true,
|
||||||
pattern: "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)"
|
pattern: '^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'
|
||||||
},
|
},
|
||||||
netsize: {
|
netsize: {
|
||||||
required: true,
|
required: true,
|
||||||
pattern: "^([0-9]|[12][0-9]|3[0-2])$"
|
pattern: '^([0-9]|[12][0-9]|3[0-2])$'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
network: {
|
network: {
|
||||||
required: "Please enter a network",
|
required: 'Please enter a network',
|
||||||
pattern: "Must be a valid IPv4 Address"
|
pattern: 'Must be a valid IPv4 Address'
|
||||||
},
|
},
|
||||||
netsize: {
|
netsize: {
|
||||||
required: "Please enter a network size",
|
required: 'Please enter a network size',
|
||||||
pattern: "Smallest size is /32"
|
pattern: 'Smallest size is /32'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
errorPlacement: function(error, element) {
|
errorPlacement: function(error, element) {
|
||||||
|
|
Loading…
Reference in a new issue