handled IPv6 (#4520)

This commit is contained in:
gabryon99 2020-10-05 18:53:57 +02:00
parent 3fc68685a9
commit 89f23846c8
3 changed files with 14 additions and 6 deletions

View file

@ -489,9 +489,12 @@ $(document).ready(function() {
});
$("#select-edit-measurement").on('change', function(event) {
const selected_measurement = $(this).val();
const selectedMeasurement = $(this).val();
// change the pattern depending on the selected measurement
$(`#input-edit-host`).attr('pattern', getMeasurementRegex(selected_measurement));
$(`#input-edit-host`).attr('pattern', getMeasurementRegex(selectedMeasurement));
// trigger form validation
if ($(`#input-edit-host`).val().length > 0) $(`#am-edit-form`)[0].reportValidity();
dialogRefreshMeasurement($("#am-edit-modal"));
});
@ -501,9 +504,12 @@ $(document).ready(function() {
$("#select-add-measurement").on('change', function(event) {
const selected_measurement = $(this).val();
const selectedMeasurement = $(this).val();
// change the pattern depending on the selected measurement
$(`#input-add-host`).attr('pattern', getMeasurementRegex(selected_measurement));
$(`#input-add-host`).attr('pattern', getMeasurementRegex(selectedMeasurement));
// trigger form validation
if ($(`#input-add-host`).val().length > 0) $(`#am-add-form`)[0].reportValidity();
dialogRefreshMeasurement($("#am-add-modal"));
});
@ -532,4 +538,7 @@ $(document).ready(function() {
});
$(`#input-add-host`).attr('pattern', getMeasurementRegex($("#select-add-measurement").val()));
$(`#input-edit-host`).attr('pattern', getMeasurementRegex($("#select-edit-measurement").val()));
});