Merge branch 'ent-6277-no-hay-modulos-seleccionados-en-wizard-snmp-de-interfaces' into 'develop'

fixed error with snmp interfaces

See merge request artica/pandorafms!3425
This commit is contained in:
Alejandro Fraguas 2020-09-03 11:17:04 +02:00
commit 7455a814fc

View File

@ -4751,6 +4751,7 @@ class AgentWizard extends HTML
*/ */
function switchBlockControl(e) { function switchBlockControl(e) {
var switchId = e.target.id.split("_"); var switchId = e.target.id.split("_");
var switchName = e.target.name.split("_");
var type = switchId[1]; var type = switchId[1];
var blockNumber = switchId[2]; var blockNumber = switchId[2];
var moduleNumber = switchId[3]; var moduleNumber = switchId[3];
@ -4758,14 +4759,15 @@ class AgentWizard extends HTML
var imageInfoModules = $("#image-info-modules-" + blockNumber); var imageInfoModules = $("#image-info-modules-" + blockNumber);
var totalCount = 0; var totalCount = 0;
var markedCount = 0; var markedCount = 0;
var hidden_input = document.getElementById("hidden-module-active-"+switchName[2]+"_0-0");
var id_input = hidden_input.id.split("_");
if (type == 'block') { if (type == 'block') {
selectedBlock selectedBlock
.parent() .parent()
.removeClass("alpha50"); .removeClass("alpha50");
if (selectedBlock.prop("checked")) { if (selectedBlock.prop("checked")) {
// Set to active the values of fields. // Set to active the values of fields.
$("[id*=hidden-module-active-"+blockNumber+"]") $("[id*='"+id_input[0]+"']")
.each(function(){ .each(function(){
$(this).val('1'); $(this).val('1');
}); });
@ -4777,8 +4779,8 @@ class AgentWizard extends HTML
imageInfoModules.removeClass('hidden'); imageInfoModules.removeClass('hidden');
} else { } else {
// Set to inactive the values of fields. // Set to inactive the values of fields.
$("[id*=hidden-module-active-"+blockNumber+"]") $("[id*='"+id_input[0]+"']")
.each(function(){ .each(function(){
$(this).val('0'); $(this).val('0');
}); });
// Set unchecked. // Set unchecked.
@ -4790,13 +4792,13 @@ class AgentWizard extends HTML
} }
} else if (type == 'module') { } else if (type == 'module') {
// Getting the element. // Getting the element.
var thisModuleHidden = $("#hidden-module-active-"+blockNumber+"_"+moduleNumber); var thisModuleHidden = document.getElementById("hidden-module-active-"+switchName[2]+"_"+moduleNumber);
var thisModule = $("#checkbox-sel_module_"+blockNumber+"_"+moduleNumber); var thisModule = $("#checkbox-sel_module_"+blockNumber+"_"+moduleNumber);
// Setting the individual field // Setting the individual field
if (thisModule.prop('checked')) { if (thisModule.prop('checked')) {
thisModuleHidden.val('1'); thisModuleHidden.value = '1';
} else { } else {
thisModuleHidden.val('0'); thisModuleHidden.value = '0';
} }
// Get the list of selected modules. // Get the list of selected modules.