Merge branch 'ent-4138-7696-Tipo-erróneo-módulos-Ifoperstatus-desde-satélite' into 'develop'

Change module type ifOperStatus on Interface Wizard

See merge request artica/pandorafms!2473
This commit is contained in:
Daniel Rodriguez 2019-06-17 16:34:14 +02:00
commit 2401ac5c6e

View File

@ -322,7 +322,7 @@ if ($create_modules) {
} else if (preg_match('/ifAdminStatus/', $name_array[1])) { } else if (preg_match('/ifAdminStatus/', $name_array[1])) {
$module_type = 2; $module_type = 2;
} else if (preg_match('/ifOperStatus/', $name_array[1])) { } else if (preg_match('/ifOperStatus/', $name_array[1])) {
$module_type = 18; $module_type = 2;
} else { } else {
$module_type = 4; $module_type = 4;
} }
@ -608,11 +608,11 @@ ui_require_jquery_file('bgiframe');
$(document).ready (function () { $(document).ready (function () {
var inputActive = true; var inputActive = true;
$(document).data('text_for_module', $("#none_text").html()); $(document).data('text_for_module', $("#none_text").html());
$("#id_snmp").change(snmp_changed_by_multiple_snmp); $("#id_snmp").change(snmp_changed_by_multiple_snmp);
$("#snmp_version").change(function () { $("#snmp_version").change(function () {
if (this.value == "3") { if (this.value == "3") {
$("#snmp3_options").css("display", ""); $("#snmp3_options").css("display", "");
@ -621,7 +621,7 @@ $(document).ready (function () {
$("#snmp3_options").css("display", "none"); $("#snmp3_options").css("display", "none");
} }
}); });
$("#walk_form").submit(function() { $("#walk_form").submit(function() {
$("#submit-snmp_walk").disable (); $("#submit-snmp_walk").disable ();
$("#oid_loading").show (); $("#oid_loading").show ();
@ -632,15 +632,15 @@ $(document).ready (function () {
function snmp_changed_by_multiple_snmp (event, id_snmp, selected) { function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
var idSNMP = Array(); var idSNMP = Array();
jQuery.each ($("#id_snmp option:selected"), function (i, val) { jQuery.each ($("#id_snmp option:selected"), function (i, val) {
idSNMP.push($(val).val()); idSNMP.push($(val).val());
}); });
$('#module').attr ('disabled', 1); $('#module').attr ('disabled', 1);
$('#module').empty (); $('#module').empty ();
$('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0)); $('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0));
jQuery.post ('ajax.php', jQuery.post ('ajax.php',
{"page" : "godmode/agentes/agent_manager", {"page" : "godmode/agentes/agent_manager",
"get_modules_json_for_multiple_snmp": 1, "get_modules_json_for_multiple_snmp": 1,
"id_snmp[]": idSNMP, "id_snmp[]": idSNMP,
@ -655,7 +655,7 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
$('#module').fadeIn ('normal'); $('#module').fadeIn ('normal');
c++; c++;
}); });
if (c == 0) { if (c == 0) {
if (typeof($(document).data('text_for_module')) != 'undefined') { if (typeof($(document).data('text_for_module')) != 'undefined') {
$('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).prop('selected', true)); $('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).prop('selected', true));
@ -666,11 +666,11 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
} }
else { else {
var anyText = $("#any_text").html(); //Trick for catch the translate text. var anyText = $("#any_text").html(); //Trick for catch the translate text.
if (anyText == null) { if (anyText == null) {
anyText = 'Any'; anyText = 'Any';
} }
$('#module').append ($('<option></option>').html (anyText).attr ("value", 0).prop('selected', true)); $('#module').append ($('<option></option>').html (anyText).attr ("value", 0).prop('selected', true));
} }
} }
@ -684,4 +684,3 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
/* ]]> */ /* ]]> */
</script> </script>