mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 16:24:54 +02:00
Added floating control in agents/modules, event list and snmp traps list
This commit is contained in:
parent
ef95602157
commit
6d1dc162e8
@ -17,6 +17,7 @@
|
|||||||
include_once($config['homedir'] . "/include/functions_agents.php");
|
include_once($config['homedir'] . "/include/functions_agents.php");
|
||||||
include_once($config['homedir'] . "/include/functions_modules.php");
|
include_once($config['homedir'] . "/include/functions_modules.php");
|
||||||
include_once($config['homedir'] . '/include/functions_users.php');
|
include_once($config['homedir'] . '/include/functions_users.php');
|
||||||
|
$refr = get_parameter('refresh', 0); // By default 30 seconds
|
||||||
|
|
||||||
function mainAgentsModules() {
|
function mainAgentsModules() {
|
||||||
global $config;
|
global $config;
|
||||||
@ -63,7 +64,7 @@ function mainAgentsModules() {
|
|||||||
$updated_time = $updated_info;
|
$updated_time = $updated_info;
|
||||||
|
|
||||||
$modulegroup = get_parameter('modulegroup', 0);
|
$modulegroup = get_parameter('modulegroup', 0);
|
||||||
$refr = get_parameter('refr', 30); // By default 30 seconds
|
$refr = get_parameter('refresh', 0); // By default 30 seconds
|
||||||
|
|
||||||
$group_id = (int)get_parameter('group_id', 0);
|
$group_id = (int)get_parameter('group_id', 0);
|
||||||
$offset = (int)get_parameter('offset', 0);
|
$offset = (int)get_parameter('offset', 0);
|
||||||
@ -97,29 +98,13 @@ function mainAgentsModules() {
|
|||||||
serialize_in_temp($agents_id, $config['id_user']."_agents", 1);
|
serialize_in_temp($agents_id, $config['id_user']."_agents", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$comborefr = '<form method="post" action="' . ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
|
|
||||||
$comborefr .= '<b>'.__('Refresh').'</b>';
|
|
||||||
$comborefr .= html_print_select (
|
|
||||||
array('30' => '30 ' . __('seconds'),
|
|
||||||
(string)SECONDS_1MINUTE => __('1 minute'),
|
|
||||||
(string)SECONDS_2MINUTES => __('2 minutes'),
|
|
||||||
(string)SECONDS_5MINUTES => __('5 minutes'),
|
|
||||||
(string)SECONDS_10MINUTES => __('10 minutes')),
|
|
||||||
'refr', (int)get_parameter('refr', 0),
|
|
||||||
$script = 'this.form.submit()', '', 0, true, false, false, '',
|
|
||||||
false, 'width: 100px; margin-right: 10px; margin-top: 5px;');
|
|
||||||
$comborefr .= "</form>";
|
|
||||||
|
|
||||||
if ($config["pure"] == 0) {
|
if ($config["pure"] == 0) {
|
||||||
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&pure=1&offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'">'
|
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&pure=1&offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh='.$refr.'">'
|
||||||
. html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode')))
|
. html_print_image ("images/full_screen.png", true, array ("title" => __('Full screen mode')))
|
||||||
. "</a>";
|
. "</a>";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$fullscreen['text'] = '<a href="index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&refr=0&offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'">'
|
|
||||||
. html_print_image ("images/normal_screen.png", true, array ("title" => __('Back to normal mode')))
|
|
||||||
. "</a>";
|
|
||||||
$config['refr'] = $refr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$groups = users_get_groups ();
|
$groups = users_get_groups ();
|
||||||
@ -168,26 +153,57 @@ function mainAgentsModules() {
|
|||||||
'combo_module_groups' => $filter_module_groups,
|
'combo_module_groups' => $filter_module_groups,
|
||||||
'combo_groups' => $filter_groups);
|
'combo_groups' => $filter_groups);
|
||||||
|
|
||||||
if ($config['pure'] == 1) {
|
|
||||||
$onheader['combo_refr'] = $comborefr;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Header
|
|
||||||
ui_print_page_header (__("Agents/Modules"), "images/module_mc.png", false, "", false, $updated_time);
|
|
||||||
|
|
||||||
// Old style table, we need a lot of special formatting,don't use table function
|
// Old style table, we need a lot of special formatting,don't use table function
|
||||||
// Prepare old-style table
|
// Prepare old-style table
|
||||||
|
if ($config['pure'] == 0){
|
||||||
|
// Header
|
||||||
|
ui_print_page_header (__("Agents/Modules"), "images/module_mc.png", false, "", false, $updated_time);
|
||||||
echo '<table style="width:100%;">';
|
echo '<table style="width:100%;">';
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
if ($config['pure'] == 1){
|
|
||||||
echo "<td>" . $comborefr . "</td>";
|
|
||||||
echo "<td>" . $fullscreen['text'] . "</td>";
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
echo "<td> <span style='float: right;'>" . $fullscreen['text'] . "</span> </td>";
|
echo "<td> <span style='float: right;'>" . $fullscreen['text'] . "</span> </td>";
|
||||||
}
|
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
|
} else {
|
||||||
|
$url =" index.php?sec=view&sec2=extensions/agents_modules&pure=0&offset='.$offset.'&group_id='.$group_id.'&modulegroup='.$modulegroup.'&refresh=$refr";
|
||||||
|
// Floating menu - Start
|
||||||
|
echo '<div id="vc-controls" style="z-index: 999">';
|
||||||
|
|
||||||
|
echo '<div id="menu_tab">';
|
||||||
|
echo '<ul class="mn">';
|
||||||
|
|
||||||
|
// Quit fullscreen
|
||||||
|
echo '<li class="nomn">';
|
||||||
|
echo '<a target="_top" href="' . $url . '">';
|
||||||
|
echo html_print_image('images/normal_screen.png', true, array('title' => __('Back to normal mode')));
|
||||||
|
echo '</a>';
|
||||||
|
echo '</li>';
|
||||||
|
|
||||||
|
// Countdown
|
||||||
|
echo '<li class="nomn">';
|
||||||
|
echo '<div class="vc-refr">';
|
||||||
|
echo '<div class="vc-countdown"></div>';
|
||||||
|
echo '<div id="vc-refr-form">';
|
||||||
|
echo __('Refresh') . ':';
|
||||||
|
echo html_print_select(get_refresh_time_array(), 'refresh', $refr, '', '', 0, true, false, false);
|
||||||
|
echo '</div>';
|
||||||
|
echo '</div>';
|
||||||
|
echo '</li>';
|
||||||
|
|
||||||
|
// Console name
|
||||||
|
echo '<li class="nomn">';
|
||||||
|
echo '<div class="vc-title">' . __('Agent/module view') . '</div>';
|
||||||
|
echo '</li>';
|
||||||
|
|
||||||
|
echo '</ul>';
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
echo '</div>';
|
||||||
|
// Floating menu - End
|
||||||
|
|
||||||
|
ui_require_jquery_file('countdown');
|
||||||
|
ui_require_css_file('countdown');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if($config['pure'] != 1){
|
if($config['pure'] != 1){
|
||||||
echo '<form method="post" action="' . ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
|
echo '<form method="post" action="' . ui_get_url_refresh (array ('offset' => $offset, 'hor_offset' => $offset,'group_id' => $group_id, 'modulegroup' => $modulegroup)).'">';
|
||||||
@ -538,9 +554,50 @@ function mainAgentsModules() {
|
|||||||
extensions_add_operation_menu_option(__("Agents/Modules view"), 'estado', 'agents_modules/icon_menu.png', "v1r1","view");
|
extensions_add_operation_menu_option(__("Agents/Modules view"), 'estado', 'agents_modules/icon_menu.png', "v1r1","view");
|
||||||
extensions_add_main_function('mainAgentsModules');
|
extensions_add_main_function('mainAgentsModules');
|
||||||
|
|
||||||
|
$ignored_params['refresh']='';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
var refr = <?php echo (int)$refr; ?>;
|
||||||
|
var pure = <?php echo (int) $config['pure']; ?>;
|
||||||
|
var href = "<?php echo ui_get_url_refresh ($ignored_params); ?>";
|
||||||
|
if (pure) {
|
||||||
|
var startCountDown = function (duration, cb) {
|
||||||
|
$('div.vc-countdown').countdown('destroy');
|
||||||
|
if (!duration) return;
|
||||||
|
var t = new Date();
|
||||||
|
t.setTime(t.getTime() + duration * 1000);
|
||||||
|
$('div.vc-countdown').countdown({
|
||||||
|
until: t,
|
||||||
|
format: 'MS',
|
||||||
|
layout: '(%M%nn%M:%S%nn%S <?php echo __('Until refresh'); ?>) ',
|
||||||
|
alwaysExpire: true,
|
||||||
|
onExpiry: function () {
|
||||||
|
$('div.vc-countdown').countdown('destroy');
|
||||||
|
url = js_html_entity_decode( href ) + duration;
|
||||||
|
$(document).attr ("location", url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
startCountDown(refr, false);
|
||||||
|
//~ // Auto hide controls
|
||||||
|
var controls = document.getElementById('vc-controls');
|
||||||
|
autoHideElement(controls, 1000);
|
||||||
|
|
||||||
|
$('select#refresh').change(function (event) {
|
||||||
|
refr = Number.parseInt(event.target.value, 10);
|
||||||
|
startCountDown(refr, false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
$('#refresh').change(function () {
|
||||||
|
$('#hidden-vc_refr').val($('#refresh option:selected').val());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$("#group_id").change (function () {
|
$("#group_id").change (function () {
|
||||||
jQuery.post ("ajax.php",
|
jQuery.post ("ajax.php",
|
||||||
{"page" : "operation/agentes/ver_agente",
|
{"page" : "operation/agentes/ver_agente",
|
||||||
|
@ -3752,9 +3752,13 @@ function ui_print_module_string_value($value, $id_agente_module,
|
|||||||
* Displays a tag list
|
* Displays a tag list
|
||||||
*/
|
*/
|
||||||
function ui_print_tags_view($title = '', $tags = array()) {
|
function ui_print_tags_view($title = '', $tags = array()) {
|
||||||
$tv = '';
|
if (!empty($title)){
|
||||||
$tv .= '<div class="tag-wrapper">';
|
$tv .= '<div class="tag-wrapper">';
|
||||||
if ($title !== '') $tv .= '<h3>' . $title . '</h3>';
|
$tv .= '<h3>' . $title . '</h3>';
|
||||||
|
} else {
|
||||||
|
$tv .= '<div class="tag-wrapper" style="padding-top: 10px">';
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
$tv .= '<div class=pandora-tag>';
|
$tv .= '<div class=pandora-tag>';
|
||||||
$tv .= '<span class=pandora-tag-title>';
|
$tv .= '<span class=pandora-tag-title>';
|
||||||
|
@ -232,6 +232,7 @@ $time_from = (string)get_parameter('time_from', '');
|
|||||||
$time_to = (string)get_parameter('time_to', '');
|
$time_to = (string)get_parameter('time_to', '');
|
||||||
$server_id = (int)get_parameter('server_id', 0);
|
$server_id = (int)get_parameter('server_id', 0);
|
||||||
$text_agent = (string) get_parameter("text_agent");
|
$text_agent = (string) get_parameter("text_agent");
|
||||||
|
$refr = (int) get_parameter ('refresh');
|
||||||
|
|
||||||
if ($id_agent != 0) {
|
if ($id_agent != 0) {
|
||||||
$text_agent = agents_get_alias($id_agent);
|
$text_agent = agents_get_alias($id_agent);
|
||||||
@ -286,7 +287,7 @@ $params = "search=" . rawurlencode(io_safe_input($search)) .
|
|||||||
"&status=" . $status .
|
"&status=" . $status .
|
||||||
"&id_group=" . $id_group .
|
"&id_group=" . $id_group .
|
||||||
"&recursion=" . $recursion .
|
"&recursion=" . $recursion .
|
||||||
"&refr=" . (int)get_parameter("refr", 0) .
|
"&refresh=" . (int)get_parameter("refresh", 0) .
|
||||||
"&id_agent=" . $id_agent .
|
"&id_agent=" . $id_agent .
|
||||||
"&id_agent_module=" . $id_agent_module .
|
"&id_agent_module=" . $id_agent_module .
|
||||||
"&pagination=" . $pagination .
|
"&pagination=" . $pagination .
|
||||||
@ -306,8 +307,7 @@ $params = "search=" . rawurlencode(io_safe_input($search)) .
|
|||||||
"&date_from=" . $date_from .
|
"&date_from=" . $date_from .
|
||||||
"&date_to=" . $date_to .
|
"&date_to=" . $date_to .
|
||||||
"&time_from=" . $time_from .
|
"&time_from=" . $time_from .
|
||||||
"&time_to=" . $time_to .
|
"&time_to=" . $time_to;
|
||||||
"&pure=" . $config["pure"];
|
|
||||||
|
|
||||||
if ($meta) {
|
if ($meta) {
|
||||||
$params .= "&text_agent=" . $text_agent;
|
$params .= "&text_agent=" . $text_agent;
|
||||||
@ -443,15 +443,43 @@ if ($config["pure"] == 0 || $meta) {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Fullscreen
|
// Fullscreen
|
||||||
echo "<h2>" . __('Events') . " » " . __('Main event view') . " ";
|
// Floating menu - Start
|
||||||
echo ui_print_help_icon ("eventview", true);
|
echo '<div id="vc-controls" style="z-index: 999">';
|
||||||
echo " ";
|
|
||||||
|
|
||||||
|
echo '<div id="menu_tab">';
|
||||||
|
echo '<ul class="mn">';
|
||||||
|
|
||||||
|
// Quit fullscreen
|
||||||
|
echo '<li class="nomn">';
|
||||||
echo '<a target="_top" href="' . $url . '&pure=0">';
|
echo '<a target="_top" href="' . $url . '&pure=0">';
|
||||||
html_print_image ("images/normalscreen.png", false,
|
echo html_print_image('images/normal_screen.png', true, array('title' => __('Back to normal mode')));
|
||||||
array("title" => __('Back to normal mode')));
|
|
||||||
echo '</a>';
|
echo '</a>';
|
||||||
echo "</h2>";
|
echo '</li>';
|
||||||
|
|
||||||
|
// Countdown
|
||||||
|
echo '<li class="nomn">';
|
||||||
|
echo '<div class="vc-refr">';
|
||||||
|
echo '<div class="vc-countdown"></div>';
|
||||||
|
echo '<div id="vc-refr-form">';
|
||||||
|
echo __('Refresh') . ':';
|
||||||
|
echo html_print_select(get_refresh_time_array(), 'refresh', $refr, '', '', 0, true, false, false);
|
||||||
|
echo '</div>';
|
||||||
|
echo '</div>';
|
||||||
|
echo '</li>';
|
||||||
|
|
||||||
|
// Console name
|
||||||
|
echo '<li class="nomn">';
|
||||||
|
echo '<div class="vc-title">' . __('Event viewer') . '</div>';
|
||||||
|
echo '</li>';
|
||||||
|
|
||||||
|
echo '</ul>';
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
echo '</div>';
|
||||||
|
// Floating menu - End
|
||||||
|
|
||||||
|
ui_require_jquery_file('countdown');
|
||||||
|
ui_require_css_file('countdown');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error div for ajax messages
|
// Error div for ajax messages
|
||||||
@ -525,12 +553,59 @@ echo "<div id='event_response_window'></div>";
|
|||||||
ui_require_jquery_file ('bgiframe');
|
ui_require_jquery_file ('bgiframe');
|
||||||
ui_require_javascript_file('pandora_events');
|
ui_require_javascript_file('pandora_events');
|
||||||
enterprise_hook('close_meta_frame');
|
enterprise_hook('close_meta_frame');
|
||||||
|
ui_require_javascript_file('wz_jsgraphics');
|
||||||
|
ui_require_javascript_file('pandora_visual_console');
|
||||||
|
|
||||||
|
$ignored_params['refresh']='';
|
||||||
?>
|
?>
|
||||||
<script language="javascript" type="text/javascript">
|
<script language="javascript" type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
|
|
||||||
$(document).ready( function() {
|
$(document).ready( function() {
|
||||||
|
|
||||||
|
var refr = <?php echo (int)$refr; ?>;
|
||||||
|
var pure = <?php echo (int) $config['pure']; ?>;
|
||||||
|
var href = "<?php echo ui_get_url_refresh ($ignored_params); ?>";
|
||||||
|
// alert($(location).attr('href'));
|
||||||
|
if (pure) {
|
||||||
|
var startCountDown = function (duration, cb) {
|
||||||
|
$('div.vc-countdown').countdown('destroy');
|
||||||
|
if (!duration) return;
|
||||||
|
var t = new Date();
|
||||||
|
t.setTime(t.getTime() + duration * 1000);
|
||||||
|
$('div.vc-countdown').countdown({
|
||||||
|
until: t,
|
||||||
|
format: 'MS',
|
||||||
|
layout: '(%M%nn%M:%S%nn%S <?php echo __('Until refresh'); ?>) ',
|
||||||
|
alwaysExpire: true,
|
||||||
|
onExpiry: function () {
|
||||||
|
$('div.vc-countdown').countdown('destroy');
|
||||||
|
//cb();
|
||||||
|
|
||||||
|
url = js_html_entity_decode( href ) + duration;
|
||||||
|
$(document).attr ("location", url);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
startCountDown(refr, false);
|
||||||
|
//~ // Auto hide controls
|
||||||
|
var controls = document.getElementById('vc-controls');
|
||||||
|
autoHideElement(controls, 1000);
|
||||||
|
|
||||||
|
$('select#refresh').change(function (event) {
|
||||||
|
refr = Number.parseInt(event.target.value, 10);
|
||||||
|
startCountDown(refr, false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
$('#refresh').change(function () {
|
||||||
|
$('#hidden-vc_refr').val($('#refresh option:selected').val());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$("input[name=all_validate_box]").change (function() {
|
$("input[name=all_validate_box]").change (function() {
|
||||||
if ($(this).is(":checked")) {
|
if ($(this).is(":checked")) {
|
||||||
$("input[name='validate_ids[]']").check();
|
$("input[name='validate_ids[]']").check();
|
||||||
|
@ -631,10 +631,20 @@ $events_filter .= $botom_update;
|
|||||||
|
|
||||||
$events_filter .= "</form>"; //This is the filter div
|
$events_filter .= "</form>"; //This is the filter div
|
||||||
|
|
||||||
if (is_metaconsole())
|
$filter_resume['title'] = empty($id_name)
|
||||||
|
? __('No filter loaded')
|
||||||
|
: __('Filter loaded') . ': ' . $id_name;
|
||||||
|
|
||||||
|
if (is_metaconsole()){
|
||||||
ui_toggle($events_filter, __("Show Options"));
|
ui_toggle($events_filter, __("Show Options"));
|
||||||
else
|
} else {
|
||||||
|
if($config['pure']){
|
||||||
|
ui_toggle($events_filter, __('Event control filter') .". ". $filter_resume['title']);
|
||||||
|
} else {
|
||||||
ui_toggle($events_filter, __('Event control filter'));
|
ui_toggle($events_filter, __('Event control filter'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Error div for ajax messages
|
// Error div for ajax messages
|
||||||
echo "<div id='show_filter_error' style='display: none;'>";
|
echo "<div id='show_filter_error' style='display: none;'>";
|
||||||
@ -710,9 +720,8 @@ elseif ($group_rep == 2) {
|
|||||||
$history);
|
$history);
|
||||||
}
|
}
|
||||||
|
|
||||||
$filter_resume['title'] = empty($id_name)
|
|
||||||
? __('No filter loaded')
|
|
||||||
: __('Filter loaded') . ': ' . $id_name;
|
|
||||||
// Active filter tag view call (only enterprise version)
|
// Active filter tag view call (only enterprise version)
|
||||||
// It is required to pass some references to enterprise function
|
// It is required to pass some references to enterprise function
|
||||||
// to translate the active filters
|
// to translate the active filters
|
||||||
|
@ -51,7 +51,7 @@ else {
|
|||||||
|
|
||||||
// List
|
// List
|
||||||
$list = array();
|
$list = array();
|
||||||
$list['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_view&pure=' . $config["pure"] . '&refr=' . $refr . '">' .
|
$list['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_view&pure=' . $config["pure"] . '&refresh=' . $refr . '">' .
|
||||||
html_print_image("images/op_snmp.png", true, array ("title" => __('List'))) .'</a>';
|
html_print_image("images/op_snmp.png", true, array ("title" => __('List'))) .'</a>';
|
||||||
|
|
||||||
// Statistics (This file)
|
// Statistics (This file)
|
||||||
|
@ -41,7 +41,8 @@ $pagination = (int) get_parameter ("pagination", $config["block_size"]);
|
|||||||
$offset = (int) get_parameter ('offset',0);
|
$offset = (int) get_parameter ('offset',0);
|
||||||
$trap_type = (int) get_parameter ('trap_type', -1);
|
$trap_type = (int) get_parameter ('trap_type', -1);
|
||||||
$group_by = (int)get_parameter('group_by', 0);
|
$group_by = (int)get_parameter('group_by', 0);
|
||||||
$refr = (int)get_parameter("refr", 0);
|
$refr = (int)get_parameter("refresh");
|
||||||
|
$default_refr = !empty($refr) ? $refr : $config['vc_refr'];
|
||||||
|
|
||||||
$user_groups = users_get_groups ($config['id_user'], $access, false);
|
$user_groups = users_get_groups ($config['id_user'], $access, false);
|
||||||
|
|
||||||
@ -69,21 +70,18 @@ $url = "index.php?sec=estado&" .
|
|||||||
|
|
||||||
$statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure=' . $config["pure"] . '&refr=' . $refr . '">' .
|
$statistics['text'] = '<a href="index.php?sec=estado&sec2=operation/snmpconsole/snmp_statistics&pure=' . $config["pure"] . '&refr=' . $refr . '">' .
|
||||||
html_print_image("images/op_reporting.png", true, array ("title" => __('Statistics'))) .'</a>';
|
html_print_image("images/op_reporting.png", true, array ("title" => __('Statistics'))) .'</a>';
|
||||||
$list['text'] = '<a href="' . $url . '&pure=' . $config["pure"] . '&refr=' . $refr . '">' .
|
$list['text'] = '<a href="' . $url . '&pure=' . $config["pure"] . '&refresh=' . $refr . '">' .
|
||||||
html_print_image("images/op_snmp.png", true, array ("title" => __('List'))) .'</a>';
|
html_print_image("images/op_snmp.png", true, array ("title" => __('List'))) .'</a>';
|
||||||
$list['active'] = true;
|
$list['active'] = true;
|
||||||
|
|
||||||
if ($config["pure"]) {
|
if ($config["pure"]) {
|
||||||
$fullscreen['text'] = '<a target="_top" href="'.$url.'&pure=0&refr=' . $refr . '">' . html_print_image("images/normal_screen.png", true, array("title" => __('Normal screen'))) . '</a>';
|
$fullscreen['text'] = '<a target="_top" href="'.$url.'&pure=0&refresh=' . $refr . '">' . html_print_image("images/normal_screen.png", true, array("title" => __('Normal screen'))) . '</a>';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Fullscreen
|
// Fullscreen
|
||||||
$fullscreen['text'] = '<a target="_top" href="'.$url.'&pure=1&refr=' . $refr . '">' . html_print_image("images/full_screen.png", true, array("title" => __('Full screen'))) . '</a>';
|
$fullscreen['text'] = '<a target="_top" href="'.$url.'&pure=1&refresh=' . $refr . '">' . html_print_image("images/full_screen.png", true, array("title" => __('Full screen'))) . '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header
|
|
||||||
ui_print_page_header(__("SNMP Console"), "images/op_snmp.png", false,
|
|
||||||
"", false, array($fullscreen, $list, $statistics));
|
|
||||||
|
|
||||||
// OPERATIONS
|
// OPERATIONS
|
||||||
|
|
||||||
@ -445,7 +443,7 @@ if ($config['dbtype'] != 'oracle') {
|
|||||||
$filter = '<form method="POST" action="index.php?' .
|
$filter = '<form method="POST" action="index.php?' .
|
||||||
'sec=snmpconsole&' .
|
'sec=snmpconsole&' .
|
||||||
'sec2=operation/snmpconsole/snmp_view&' .
|
'sec2=operation/snmpconsole/snmp_view&' .
|
||||||
'refr=' . ((int)get_parameter('refr', 0)) . '&' .
|
'refresh=' . ((int)get_parameter('refresh', 0)) . '&' .
|
||||||
'pure=' . $config["pure"] . '">';
|
'pure=' . $config["pure"] . '">';
|
||||||
$filter .= html_print_table($table, true);
|
$filter .= html_print_table($table, true);
|
||||||
$filter .= '<div style="width: ' . $table->width . '; text-align: right;">';
|
$filter .= '<div style="width: ' . $table->width . '; text-align: right;">';
|
||||||
@ -453,9 +451,7 @@ $filter .= html_print_submit_button(__('Update'), 'search', false, 'class="sub u
|
|||||||
$filter .= '</div>';
|
$filter .= '</div>';
|
||||||
$filter .= '</form>';
|
$filter .= '</form>';
|
||||||
|
|
||||||
ui_toggle($filter, __('Toggle filter(s)'));
|
|
||||||
|
|
||||||
unset ($table);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -466,10 +462,103 @@ $trapcount = (int) db_get_value_sql($sql_count);
|
|||||||
|
|
||||||
// No traps
|
// No traps
|
||||||
if (empty ($traps)) {
|
if (empty ($traps)) {
|
||||||
|
// Header
|
||||||
|
ui_print_page_header(__("SNMP Console"), "images/op_snmp.png", false,
|
||||||
|
"", false, array($list, $statistics));
|
||||||
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no SNMP traps in database') ) );
|
ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no SNMP traps in database') ) );
|
||||||
return;
|
return;
|
||||||
|
} else{
|
||||||
|
if($config["pure"]){
|
||||||
|
echo '<div id="dashboard-controls">';
|
||||||
|
|
||||||
|
echo '<div id="menu_tab">';
|
||||||
|
echo '<ul class="mn">';
|
||||||
|
// Normal view button
|
||||||
|
echo '<li class="nomn">';
|
||||||
|
$normal_url = "index.php?" .
|
||||||
|
"sec=snmpconsole&" .
|
||||||
|
"sec2=operation/snmpconsole/snmp_view&" .
|
||||||
|
"filter_severity=" . $filter_severity . "&" .
|
||||||
|
"filter_fired=" . $filter_fired . "&" .
|
||||||
|
"filter_status=" . $filter_status . "&" .
|
||||||
|
"refresh=" . ((int)get_parameter('refresh', 0)) . "&" .
|
||||||
|
"pure=0&" .
|
||||||
|
"trap_type=" . $trap_type . "&" .
|
||||||
|
"group_by=" . $group_by . "&" .
|
||||||
|
"free_search_string=" . $free_search_string;
|
||||||
|
|
||||||
|
$urlPagination = $normal_url . "&" .
|
||||||
|
"pagination=" . $pagination . "&" .
|
||||||
|
"offset=" . $offset;
|
||||||
|
|
||||||
|
echo '<a href="' . $urlPagination . '">';
|
||||||
|
echo html_print_image('images/normal_screen.png', true, array('title' => __('Exit fullscreen')));
|
||||||
|
echo '</a>';
|
||||||
|
echo '</li>';
|
||||||
|
|
||||||
|
// Auto refresh control
|
||||||
|
echo '<li class="nomn">';
|
||||||
|
echo '<div class="dashboard-refr" style="margin-top: 6px;">';
|
||||||
|
echo '<div class="dashboard-countdown" style="display: inline;"></div>';
|
||||||
|
$normal_url = "index.php?" .
|
||||||
|
"sec=snmpconsole&" .
|
||||||
|
"sec2=operation/snmpconsole/snmp_view&" .
|
||||||
|
"filter_severity=" . $filter_severity . "&" .
|
||||||
|
"filter_fired=" . $filter_fired . "&" .
|
||||||
|
"filter_status=" . $filter_status . "&" .
|
||||||
|
"refresh=" . ((int)get_parameter('refresh', 0)) . "&" .
|
||||||
|
"pure=1&" .
|
||||||
|
"trap_type=" . $trap_type . "&" .
|
||||||
|
"group_by=" . $group_by . "&" .
|
||||||
|
"free_search_string=" . $free_search_string;
|
||||||
|
|
||||||
|
$urlPagination = $normal_url . "&" .
|
||||||
|
"pagination=" . $pagination . "&" .
|
||||||
|
"offset=" . $offset;
|
||||||
|
|
||||||
|
|
||||||
|
echo '<form id="refr-form" method="get" action="' . $urlPagination . '" style="display: inline;">';
|
||||||
|
echo __('Refresh every') . ':';
|
||||||
|
echo html_print_select(get_refresh_time_array(), 'refresh', $refr, '', '', 0, true, false, false);
|
||||||
|
echo '</form>';
|
||||||
|
echo '</li>';
|
||||||
|
|
||||||
|
html_print_input_hidden('sec', 'snmpconsole');
|
||||||
|
html_print_input_hidden('sec2', 'operation/snmpconsole/snmp_view');
|
||||||
|
html_print_input_hidden('pure', 1);
|
||||||
|
html_print_input_hidden('refresh', ($refr > 0 ? $refr : $default_refr));
|
||||||
|
|
||||||
|
// Dashboard name
|
||||||
|
echo '<li class="nomn">';
|
||||||
|
echo '<div class="dashboard-title">' . __('SNMP Traps') . '</div>';
|
||||||
|
echo '</li>';
|
||||||
|
|
||||||
|
echo '</ul>';
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
echo '</div>';
|
||||||
|
|
||||||
|
ui_require_css_file('pandora_enterprise', ENTERPRISE_DIR . '/include/styles/');
|
||||||
|
ui_require_css_file('pandora_dashboard', ENTERPRISE_DIR . '/include/styles/');
|
||||||
|
ui_require_css_file('cluetip');
|
||||||
|
|
||||||
|
ui_require_jquery_file('countdown');
|
||||||
|
ui_require_javascript_file('pandora_dashboard', ENTERPRISE_DIR.'/include/javascript/');
|
||||||
|
ui_require_javascript_file('wz_jsgraphics');
|
||||||
|
ui_require_javascript_file('pandora_visual_console');
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// Header
|
||||||
|
ui_print_page_header(__("SNMP Console"), "images/op_snmp.png", false,
|
||||||
|
"", false, array($fullscreen, $list, $statistics));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ui_toggle($filter, __('Toggle filter(s)'));
|
||||||
|
unset ($table);
|
||||||
|
|
||||||
if (($config['dbtype'] == 'oracle') && ($traps !== false)) {
|
if (($config['dbtype'] == 'oracle') && ($traps !== false)) {
|
||||||
for ($i = 0; $i < count($traps); $i++) {
|
for ($i = 0; $i < count($traps); $i++) {
|
||||||
unset($traps[$i]['rnum']);
|
unset($traps[$i]['rnum']);
|
||||||
@ -482,7 +571,7 @@ $url_snmp = "index.php?" .
|
|||||||
"filter_severity=" . $filter_severity . "&" .
|
"filter_severity=" . $filter_severity . "&" .
|
||||||
"filter_fired=" . $filter_fired . "&" .
|
"filter_fired=" . $filter_fired . "&" .
|
||||||
"filter_status=" . $filter_status . "&" .
|
"filter_status=" . $filter_status . "&" .
|
||||||
"refr=" . ((int)get_parameter('refr', 0)) . "&" .
|
"refresh=" . ((int)get_parameter('refresh', 0)) . "&" .
|
||||||
"pure=" . $config["pure"] . "&" .
|
"pure=" . $config["pure"] . "&" .
|
||||||
"trap_type=" . $trap_type . "&" .
|
"trap_type=" . $trap_type . "&" .
|
||||||
"group_by=" . $group_by . "&" .
|
"group_by=" . $group_by . "&" .
|
||||||
@ -688,7 +777,7 @@ if ($traps !== false) {
|
|||||||
"filter_severity=" . $filter_severity . "&" .
|
"filter_severity=" . $filter_severity . "&" .
|
||||||
"filter_fired=" . $filter_fired . "&" .
|
"filter_fired=" . $filter_fired . "&" .
|
||||||
"filter_status=" . $filter_status . "&" .
|
"filter_status=" . $filter_status . "&" .
|
||||||
"refr=" . ((int)get_parameter('refr', 0)) . "&" .
|
"refresh=" . ((int)get_parameter('refresh', 0)) . "&" .
|
||||||
"pure=" . $config["pure"] . "&" .
|
"pure=" . $config["pure"] . "&" .
|
||||||
"group_by=0&" .
|
"group_by=0&" .
|
||||||
"free_search_string=" . $free_search_string;
|
"free_search_string=" . $free_search_string;
|
||||||
@ -855,7 +944,48 @@ echo '<div style="clear:both;"> </div>';
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<script language="JavaScript" type="text/javascript">
|
<script language="JavaScript" type="text/javascript">
|
||||||
<!--
|
|
||||||
|
$(document).ready( function() {
|
||||||
|
var controls = document.getElementById('dashboard-controls');
|
||||||
|
autoHideElement(controls, 1000);
|
||||||
|
|
||||||
|
var startCountDown = function (duration, cb) {
|
||||||
|
$('div.dashboard-countdown').countdown('destroy');
|
||||||
|
if (!duration) return;
|
||||||
|
var t = new Date();
|
||||||
|
t.setTime(t.getTime() + duration * 1000);
|
||||||
|
$('div.dashboard-countdown').countdown({
|
||||||
|
until: t,
|
||||||
|
format: 'MS',
|
||||||
|
layout: '(%M%nn%M:%S%nn%S <?php echo __('Until next'); ?>) ',
|
||||||
|
alwaysExpire: true,
|
||||||
|
onExpiry: function () {
|
||||||
|
$('div.dashboard-countdown').countdown('destroy');
|
||||||
|
cb();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Auto refresh select
|
||||||
|
$('form#refr-form').submit(function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
});
|
||||||
|
|
||||||
|
var handleRefrChange = function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
var url = $('form#refr-form').prop('action');
|
||||||
|
var refr = Number.parseInt(event.target.value, 10);
|
||||||
|
|
||||||
|
startCountDown(refr, function () {
|
||||||
|
window.location = url + '&refresh=' + refr;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$('form#refr-form select').change(handleRefrChange).change();
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
function CheckAll() {
|
function CheckAll() {
|
||||||
for (var i = 0; i < document.eventtable.elements.length; i++) {
|
for (var i = 0; i < document.eventtable.elements.length; i++) {
|
||||||
var e = document.eventtable.elements[i];
|
var e = document.eventtable.elements[i];
|
||||||
@ -883,5 +1013,5 @@ echo '<div style="clear:both;"> </div>';
|
|||||||
$('.trap_info_' + id_trap).css('display', '');
|
$('.trap_info_' + id_trap).css('display', '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//-->
|
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user