diff --git a/pandora_console/include/class/SnmpConsole.class.php b/pandora_console/include/class/SnmpConsole.class.php index 1d1a598bc7..aa90626378 100644 --- a/pandora_console/include/class/SnmpConsole.class.php +++ b/pandora_console/include/class/SnmpConsole.class.php @@ -519,6 +519,8 @@ class SnmpConsole extends HTML $legend .= ''; $legend .= ''; + echo '
'; + ui_toggle($legend, __('Legend')); // Load own javascript file. @@ -1331,17 +1333,8 @@ class SnmpConsole extends HTML * Show more information */ function toggleVisibleExtendedInfo(id, position) { - // Show all "Show more" - $('[id^=img_]').each(function() { - $(this).show(); - }); - // Hide all "Hide details" - $('[id^=img_hide_]').each(function() { - $(this).hide(); - }); var status = $('#eye_'+id).attr('data-show'); if(status == "show"){ - $('tr[id^=show_]').remove() $.ajax({ method: 'get', url: '', @@ -1360,14 +1353,14 @@ class SnmpConsole extends HTML datatype: "json", success: function(data) { let trap = JSON.parse(data); - var tr = $('#snmp_console tr').eq(position+1); + var tr = $('#snmp_console tr:not([id^="show_"])').eq(position+1); // Count. if ($('#filter_group_by').val() == 1) { let labelCount = '

'; let variableCount = `${trap['count']}
${trap['first']}
${trap['last']}`; - tr.after(`${labelCount}${variableCount}`); + tr.after(`${labelCount}${variableCount}`); } // Type. @@ -1405,27 +1398,27 @@ class SnmpConsole extends HTML let labelType = ''; let variableType = `${desc_trap_type}`; - tr.after(`${labelType}${variableType}`); + tr.after(`${labelType}${variableType}`); // Description. if (trap['description']) { let labelDesc = ''; let variableDesc = `${trap['description']}`; - tr.after(`${labelDesc}${variableDesc}`); + tr.after(`${labelDesc}${variableDesc}`); } // Enterprise String. let labelOid = ''; let variableOId = `${trap['oid']}`; - tr.after(`${labelOid}${variableOId}`); + tr.after(`${labelOid}${variableOId}`); // Variable bindings. let labelBindings = ''; let variableBindings = ''; if ($('#filter_group_by').val() == 1) { - labelBindings = ''; + labelBindings = ''; let new_url = 'index.php?sec=snmpconsole&sec2=operation/snmpconsole/snmp_view'; new_url += '&filter_severity='+$('#filter_severity').val(); @@ -1439,7 +1432,7 @@ class SnmpConsole extends HTML variableBindings = `${string}`; } else { - labelBindings = ''; + labelBindings = ''; const binding_vars = trap['oid_custom'].split("\t"); let string = ''; binding_vars.forEach(function(oid) { @@ -1448,7 +1441,7 @@ class SnmpConsole extends HTML variableBindings = `${string}`; } - tr.after(`${labelBindings}${variableBindings}`); + tr.after(`${labelBindings}${variableBindings}`); }, error: function(e) { console.error(e); @@ -1458,7 +1451,7 @@ class SnmpConsole extends HTML $('#img_'+id).hide(); $('#img_hide_'+id).show(); } else{ - $('tr[id^=show_]').remove(); + $(`tr#show_${id}`).remove(); $('#eye_'+id).attr('data-show', 'show'); $('#img_'+id).show(); $('#img_hide_'+id).hide();