2014-03-10 Miguel de Dios <miguel.dedios@artica.es>

* include/javascript/pandora_snmp_browser.js,
	include/functions_snmp_browser.php: cleaned source code style.
	
	* godmode/agentes/module_manager_editor_network.php: fixed the
	javascript include for policies.
	
	Incident: #616




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9540 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2014-03-10 13:12:09 +00:00
parent 77068e72d8
commit 7947e2fb2e
4 changed files with 36 additions and 15 deletions

View File

@ -1,3 +1,13 @@
2014-03-10 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/pandora_snmp_browser.js,
include/functions_snmp_browser.php: cleaned source code style.
* godmode/agentes/module_manager_editor_network.php: fixed the
javascript include for policies.
Incident: #616
2014-03-10 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_reporting.php: sla reports with sla

View File

@ -14,8 +14,13 @@
// GNU General Public License for more details.
global $config;
require_once($config['homedir'] . "/include/functions_snmp_browser.php");
ui_require_javascript_file ('pandora_snmp_browser');
?>
<script type="text/javascript" src="include/javascript/pandora_snmp_browser.js"></script>
<?php
//This line does not run with the dinamic loader editor in policies.
//ui_require_javascript_file ('pandora_snmp_browser');
// Save some variables for javascript functions
html_print_input_hidden ('ajax_url', ui_get_full_url("ajax.php"), false);
@ -185,7 +190,8 @@ $data[1] = html_print_select(array('MD5' => __('MD5'), 'SHA' => __('SHA')), 'snm
$data[2] = __('Security level');
$data[3] = html_print_select(array('noAuthNoPriv' => __('Not auth and not privacy method'),
'authNoPriv' => __('Auth and not privacy method'), 'authPriv' => __('Auth and privacy method')), 'snmp3_security_level', $snmp3_security_level, '', '', '', true);
if ($snmp_version != 3) $table_simple->rowstyle['field_snmpv3_row3'] = 'display: none;';
if ($snmp_version != 3)
$table_simple->rowstyle['field_snmpv3_row3'] = 'display: none;';
push_table_simple($data, 'field_snmpv3_row3');
snmp_browser_print_container (false, '100%', '60%', 'none');
@ -245,13 +251,13 @@ $(document).ready (function () {
});
$('#snmp_version').change(function() {
$('#snmp_browser_version').val($(this).val());
// Display or collapse the SNMP browser's v3 options
checkSNMPVersion ();
});
$('#snmp_browser_version').change(function() {
$('#snmp_version').val($(this).val());
// Display or collapse the SNMP v3 options in the main window
if ($(this).val() == "3") {
$("#simple-field_snmpv3_row1").attr("style", "");
@ -319,7 +325,7 @@ function snmpBrowserWindow () {
$('#snmp3_browser_auth_pass').val($('#snmp3_auth_pass').val());
$('#snmp3_browser_privacy_method').val($('#snmp3_privacy_method').val());
$('#snmp3_browser_privacy_pass').val($('#snmp3_privacy_pass').val());
$("#snmp_browser_container").show().dialog ({
title: '',
resizable: true,

View File

@ -446,7 +446,12 @@ function snmp_browser_print_container ($return = false, $width = '95%', $height
$table->data[0][2] .= html_print_input_text ('starting_oid', '.1.3.6.1.2', '', 25, 0, true);
$table->data[0][3] = '<strong>' . __('Version') . '</strong>';
$table->data[0][3] .= html_print_select (array ('1' => 'v. 1', '2' => 'v. 2', '2c' => 'v. 2c', '3' => 'v. 3'), 'snmp_browser_version', '', 'checkSNMPVersion();', '', '', true, false, false, '');
$table->data[0][3] .= html_print_select (
array ('1' => 'v. 1',
'2' => 'v. 2',
'2c' => 'v. 2c',
'3' => 'v. 3'),
'snmp_browser_version', '', 'checkSNMPVersion();', '', '', true, false, false, '');
$table->cellstyle[0][3] = 'width: 15px;';
$table->data[0][4] = html_print_button(__('Browse'), 'browse', false, 'snmpBrowse()', 'class="sub search"', true);

View File

@ -1,19 +1,19 @@
// Load the SNMP tree via AJAX
function snmpBrowse () {
// Empty the SNMP tree
$("#snmp_browser").html('');
// Hide the data div
hideOIDData();
// Reset previous searches
$("#search_results").css('display', 'none');
$("#hidden-search_count").val(-1);
// Show the spinner
$("#spinner").css('display', '');
// Read the target IP and community
var target_ip = $('#text-target_ip').val();
var community = $('#text-community').val();
@ -42,7 +42,7 @@ function snmpBrowse () {
"action=" + "snmptree",
"page=operation/snmpconsole/snmp_browser"
];
// Browse!
jQuery.ajax ({
data: params.join ("&"),
@ -63,7 +63,7 @@ function snmpBrowse () {
// Expand or collapse an SNMP tree node
function toggleTreeNode(node) {
var display = $("#ul_" + node).css('display');
var src = $("#anchor_" + node).children("img").attr('src');
@ -81,7 +81,7 @@ function toggleTreeNode(node) {
// Expand an SNMP tree node
function expandTreeNode(node) {
if (node == 0) {
return;
}
@ -97,7 +97,7 @@ function expandTreeNode(node) {
// Expand an SNMP tree node
function collapseTreeNode(node) {
if (node == 0) {
return;
}
@ -113,7 +113,7 @@ function collapseTreeNode(node) {
// Expand all tree nodes
function expandAll(node) {
$('#snmp_browser').find('ul').each ( function () {
var id = $(this).attr('id').substr(3);
expandTreeNode (id);