#11562 Fixed snmp walk

This commit is contained in:
Daniel Maya 2023-06-15 15:49:06 +02:00
parent 7d550de82d
commit 18c4f7295b
3 changed files with 43 additions and 4 deletions

View File

@ -654,6 +654,18 @@ function snmp_browser_print_oid(
);
}
if (isset($_POST['print_copy_oid'])) {
// Hidden by default.
$output .= html_print_button(
__('Use this OID'),
'use_iod',
false,
'use_oid()',
'class="sub add invisible"',
true
);
}
// Select agent modal.
$output .= snmp_browser_print_create_modules(true);
@ -1134,6 +1146,14 @@ function snmp_browser_print_container(
false,
'id_agent_module'
);
$output .= html_print_input_hidden(
'is_policy_agent',
1,
true,
false,
false,
'is_policy_agent'
);
$output .= html_print_table($table, true);
$output .= html_print_div(
[

View File

@ -7,6 +7,10 @@ function snmpBrowse() {
// Hide the data div
hideOIDData();
$("#button-srcbutton")
.find("div")
.addClass("rotation");
// Reset previous searches
$("#search_results").css("display", "none");
$("#hidden-search_count").val(-1);
@ -258,7 +262,7 @@ function snmpGet(oid) {
var ajax_url = $("#hidden-ajax_url").val();
var server_to_exec = $("#server_to_exec").val();
var target_port = $("#target_port").val();
var print_create_agent_module = true;
var is_policy_or_agent = $("#is_policy_agent").val();
// Check for a custom action
var custom_action = $("#hidden-custom_action").val();
@ -283,7 +287,11 @@ function snmpGet(oid) {
params["custom_action"] = custom_action;
params["page"] = "include/ajax/snmp_browser.ajax";
params["target_port"] = target_port;
params["print_create_agent_module"] = print_create_agent_module;
if (typeof is_policy_or_agent !== "undefined") {
params["print_copy_oid"] = 1;
} else {
params["print_create_agent_module"] = 1;
}
// SNMP get!
jQuery.ajax({

View File

@ -750,4 +750,15 @@ function show_add_module() {
}
}
function use_oid() {
$("#text-snmp_oid").val($("#hidden-snmp_oid").val());
$("#snmp_data").empty();
$("#snmp_data").css("display", "none");
$(".forced_title_layer").css("display", "none");
$("#snmp_browser_container").dialog("close");
}
</script>