mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-06 03:45:26 +00:00
fixed missing cidr in sending post request
This commit is contained in:
parent
ac12f81b08
commit
a669e7def3
1 changed files with 7 additions and 28 deletions
|
|
@ -2,21 +2,6 @@ $(document).ready(function () {
|
|||
|
||||
// define a constant for the snmp version dropdown value
|
||||
const SNMP_VERSION_THREE = 2;
|
||||
const requiredFieldsAdd = {
|
||||
community: [],
|
||||
nonCommunity: []
|
||||
};
|
||||
|
||||
$(`.community-field input[required], .community-field select[required]`)
|
||||
.each(function() {
|
||||
requiredFieldsAdd.community.push($(this));
|
||||
});
|
||||
|
||||
$(`.non-community-field input[required], .non-community-field select[required]`)
|
||||
.each(function() {
|
||||
requiredFieldsAdd.nonCommunity.push($(this));
|
||||
$(this).removeAttr("required");
|
||||
});
|
||||
|
||||
const addResponsivenessFilter = (tableAPI) => {
|
||||
DataTableUtils.addFilterDropdown(
|
||||
|
|
@ -158,9 +143,15 @@ $(document).ready(function () {
|
|||
resetAfterSubmit: false,
|
||||
endpoint: `${ http_prefix }/lua/pro/rest/v1/add/snmp/device.lua`,
|
||||
beforeSumbit: function() {
|
||||
const data = {};
|
||||
$(`#add-snmp-feedback`).hide();
|
||||
$(`#snmp-add-spinner`).fadeIn();
|
||||
return serializeFormArray($(`#add-snmp-modal form`).serializeArray());
|
||||
|
||||
$(`#add-snmp-modal form`).find('input,select,textarea').each((idx, element) => {
|
||||
console.log(element);
|
||||
data[$(element).attr("name")] = $(element).val();
|
||||
});
|
||||
return data;
|
||||
},
|
||||
onModalInit: function() {
|
||||
|
||||
|
|
@ -234,24 +225,12 @@ $(document).ready(function () {
|
|||
if (value == SNMP_VERSION_THREE) {
|
||||
|
||||
$(`.community-field`).fadeOut(500, function() {
|
||||
requiredFieldsAdd.community.forEach(($input) => {
|
||||
$input.removeAttr("required");
|
||||
});
|
||||
requiredFieldsAdd.nonCommunity.forEach(($input) => {
|
||||
$input.attr("required", "");
|
||||
});
|
||||
$(`.non-community-field`).fadeIn(500);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
$(`.non-community-field`).fadeOut(500, function() {
|
||||
requiredFieldsAdd.nonCommunity.forEach(($input) => {
|
||||
$input.removeAttr("required");
|
||||
});
|
||||
requiredFieldsAdd.community.forEach(($input) => {
|
||||
$input.attr("required", "");
|
||||
});
|
||||
$(`.community-field`).fadeIn(500);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue