Merge branch 'ent-11562-snmp-walk-no-funciona-en-politicas' into 'develop'

Ent 11562 snmp walk no funciona en politicas

See merge request artica/pandorafms!6122
This commit is contained in:
Matias Didier 2023-06-19 13:36:57 +00:00
commit 4c146e7b23
3 changed files with 45 additions and 5 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

@ -73,7 +73,8 @@ if ($config['pure']) {
}
// Control from managent polices.
if ($_POST['type'] !== 'networkserver') {
$type = get_parameter('type', false);
if (empty($type) === false && $type !== 'networkserver') {
// Header.
ui_print_standard_header(
__('SNMP Browser'),
@ -745,9 +746,20 @@ 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>