2012-04-12 18:49:33 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation; version 2
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
2019-01-24 11:10:49 +01:00
|
|
|
ui_require_css_file ('tree');
|
|
|
|
ui_require_css_file ('fixed-bottom-box');
|
|
|
|
|
2012-04-12 18:49:33 +02:00
|
|
|
global $config;
|
|
|
|
|
2017-12-21 16:37:19 +01:00
|
|
|
$pure = get_parameter('pure', 0);
|
|
|
|
$tab = get_parameter('tab', 'group');
|
|
|
|
$search_group = get_parameter('searchGroup', '');
|
|
|
|
$search_agent = get_parameter('searchAgent', '');
|
|
|
|
$status_agent = get_parameter('statusAgent', AGENT_STATUS_ALL);
|
2015-01-30 20:07:50 +01:00
|
|
|
$search_module = get_parameter('searchModule', '');
|
|
|
|
$status_module = get_parameter('statusModule', -1);
|
2018-03-28 17:07:57 +02:00
|
|
|
$show_not_init_agents = get_parameter('show_not_init_agents', true);
|
|
|
|
$show_not_init_modules = get_parameter('show_not_init_modules', true);
|
2017-12-21 16:37:19 +01:00
|
|
|
$group_id = (int) get_parameter('group_id');
|
|
|
|
$tag_id = (int) get_parameter('tag_id');
|
|
|
|
$strict_acl = (bool) db_get_value("strict_acl", "tusuario", "id_user", $config['id_user']);
|
|
|
|
$serach_hirearchy = (bool) get_parameter('searchHirearchy', false);
|
2015-01-30 20:07:50 +01:00
|
|
|
// ---------------------Tabs -------------------------------------------
|
2012-04-16 19:26:01 +02:00
|
|
|
$enterpriseEnable = false;
|
|
|
|
if (enterprise_include_once('include/functions_policies.php') !== ENTERPRISE_NOT_HOOK) {
|
|
|
|
$enterpriseEnable = true;
|
|
|
|
}
|
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
$url = 'index.php?' .
|
|
|
|
'sec=estado&' .
|
|
|
|
'sec2=operation/tree&' .
|
|
|
|
'refr=0&' .
|
|
|
|
'pure='.$pure.'&' .
|
|
|
|
'tab=%s';
|
|
|
|
|
|
|
|
$tabs = array();
|
|
|
|
|
2015-01-30 20:41:54 +01:00
|
|
|
if (!$strict_acl) {
|
|
|
|
$tabs['tag'] = array(
|
|
|
|
'text' => "<a href='" . sprintf($url, "tag") . "'>" .
|
|
|
|
html_print_image("images/tag.png", true,
|
|
|
|
array("title" => __('Tags'))) . "</a>",
|
|
|
|
'active' => ($tab == "tag"));
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2015-01-30 20:41:54 +01:00
|
|
|
$tabs['os'] = array(
|
|
|
|
'text' => "<a href='" . sprintf($url, "os") . "'>" .
|
|
|
|
html_print_image("images/operating_system.png", true,
|
|
|
|
array("title" => __('OS'))) . "</a>",
|
|
|
|
'active' => ($tab == "os"));
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2015-01-30 20:41:54 +01:00
|
|
|
$tabs['group'] = array(
|
|
|
|
'text' => "<a href='" . sprintf($url, "group") . "'>" .
|
|
|
|
html_print_image("images/group.png", true,
|
|
|
|
array("title" => __('Groups'))) . "</a>",
|
|
|
|
'active' => ($tab == "group"));
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2015-01-30 20:41:54 +01:00
|
|
|
$tabs['module_group'] = array(
|
|
|
|
'text' => "<a href='" . sprintf($url, "module_group") . "'>" .
|
|
|
|
html_print_image("images/module_group.png", true,
|
|
|
|
array("title" => __('Module groups'))) . "</a>",
|
|
|
|
'active' => ($tab == "module_group"));
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2015-01-30 20:41:54 +01:00
|
|
|
$tabs['module'] = array(
|
|
|
|
'text' => "<a href='" . sprintf($url, "module") . "'>" .
|
|
|
|
html_print_image("images/brick.png", true,
|
|
|
|
array("title" => __('Modules'))) . "</a>",
|
|
|
|
'active' => ($tab == "module"));
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2015-01-30 20:41:54 +01:00
|
|
|
if ($enterpriseEnable) {
|
|
|
|
$tabs['policies'] = array(
|
|
|
|
'text' => "<a href='" . sprintf($url, "policies") . "'>" .
|
|
|
|
html_print_image("images/policies_mc.png", true,
|
|
|
|
array("title" => __('Policies'))) . "</a>",
|
|
|
|
'active' => ($tab == "policies"));
|
|
|
|
}
|
2012-04-16 19:26:01 +02:00
|
|
|
}
|
|
|
|
|
2015-03-06 12:28:05 +01:00
|
|
|
enterprise_hook('open_meta_frame');
|
|
|
|
|
2015-01-30 20:41:54 +01:00
|
|
|
$header_title = __('Tree view');
|
|
|
|
$header_sub_title = __('Sort the agents by %s');
|
2015-01-30 20:07:50 +01:00
|
|
|
switch ($tab) {
|
|
|
|
case 'tag':
|
2015-01-30 20:41:54 +01:00
|
|
|
$header_sub_title = sprintf($header_sub_title, __('tags'));
|
2015-01-30 20:07:50 +01:00
|
|
|
break;
|
|
|
|
case 'os':
|
2015-01-30 20:41:54 +01:00
|
|
|
$header_sub_title = sprintf($header_sub_title, __('OS'));
|
2015-01-30 20:07:50 +01:00
|
|
|
break;
|
2012-06-20 17:50:15 +02:00
|
|
|
case 'group':
|
2015-01-30 20:41:54 +01:00
|
|
|
$header_sub_title = sprintf($header_sub_title, __('groups'));
|
2012-06-20 17:50:15 +02:00
|
|
|
break;
|
|
|
|
case 'module_group':
|
2015-01-30 20:41:54 +01:00
|
|
|
$header_sub_title = sprintf($header_sub_title, __('module groups'));
|
2012-06-20 17:50:15 +02:00
|
|
|
break;
|
|
|
|
case 'module':
|
2015-01-30 20:41:54 +01:00
|
|
|
$header_sub_title = sprintf($header_sub_title, __('modules'));
|
2012-06-20 17:50:15 +02:00
|
|
|
break;
|
2015-01-30 20:07:50 +01:00
|
|
|
case 'policies':
|
|
|
|
if ($enterpriseEnable)
|
2015-01-30 20:41:54 +01:00
|
|
|
$header_sub_title = sprintf($header_sub_title, __('policies'));
|
2012-11-26 17:44:41 +01:00
|
|
|
break;
|
2012-06-20 17:50:15 +02:00
|
|
|
}
|
2012-04-16 19:26:01 +02:00
|
|
|
|
2015-09-07 11:53:08 +02:00
|
|
|
if (!is_metaconsole()) {
|
2015-01-30 20:41:54 +01:00
|
|
|
if (!$strict_acl)
|
|
|
|
$header_title = $header_title ." - ". $header_sub_title;
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
ui_print_page_header($header_title, "images/extensions.png", false, "", false, $tabs);
|
2015-01-30 20:41:54 +01:00
|
|
|
}
|
2015-01-30 20:07:50 +01:00
|
|
|
// ---------------------Tabs -------------------------------------------
|
|
|
|
|
|
|
|
// --------------------- form filter -----------------------------------
|
2015-01-30 20:41:54 +01:00
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
$table = new StdClass();
|
|
|
|
$table->width = "100%";
|
2015-04-14 10:12:13 +02:00
|
|
|
$table->class='databox filters';
|
2015-01-30 20:07:50 +01:00
|
|
|
$table->data = array();
|
|
|
|
$table->rowspan = array();
|
2015-04-23 17:52:16 +02:00
|
|
|
$table->style[0] = 'font-weight: bold;';
|
|
|
|
$table->style[2] = 'font-weight: bold;';
|
2017-12-21 16:37:19 +01:00
|
|
|
$table->size = array();
|
|
|
|
$table->size[0] = '10%';
|
2018-03-28 17:07:57 +02:00
|
|
|
$table->size[1] = '20%';
|
|
|
|
$table->size[2] = '10%';
|
|
|
|
$table->size[3] = '5%';
|
2017-12-21 16:37:19 +01:00
|
|
|
$table->size[4] = '10%';
|
2015-01-30 20:07:50 +01:00
|
|
|
// Agent filter
|
|
|
|
$agent_status_arr = array();
|
|
|
|
$agent_status_arr[AGENT_STATUS_ALL] = __('All'); //default
|
2015-06-08 13:13:09 +02:00
|
|
|
$agent_status_arr[AGENT_STATUS_NORMAL] = __('Normal');
|
2015-01-30 20:07:50 +01:00
|
|
|
$agent_status_arr[AGENT_STATUS_WARNING] = __('Warning');
|
|
|
|
$agent_status_arr[AGENT_STATUS_CRITICAL] = __('Critical');
|
|
|
|
$agent_status_arr[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
|
|
|
$agent_status_arr[AGENT_STATUS_NOT_INIT] = __('Not init');
|
|
|
|
|
2017-12-21 16:37:19 +01:00
|
|
|
$row = array();
|
|
|
|
$row[] = __('Search group');
|
2018-03-28 17:07:57 +02:00
|
|
|
$row[] = html_print_input_text("search_group", $search_group, '', is_metaconsole() ? 50 : 40, 30, true);
|
|
|
|
|
|
|
|
if (is_metaconsole()) {
|
|
|
|
$row[] = __('Show not init modules');
|
|
|
|
$row[] = html_print_checkbox("show_not_init_modules", $show_not_init_modules, true, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-10-25 17:44:59 +02:00
|
|
|
|
2017-12-21 16:37:19 +01:00
|
|
|
$table->data[] = $row;
|
2017-10-25 17:44:59 +02:00
|
|
|
|
|
|
|
$row = array();
|
|
|
|
$row[] = __('Search agent');
|
2018-03-28 17:07:57 +02:00
|
|
|
$row[] = html_print_input_text("search_agent", $search_agent, '', is_metaconsole() ? 50 : 40, 30, true);
|
|
|
|
|
|
|
|
$row[] = __('Show not init agents');
|
|
|
|
$row[] = html_print_checkbox("show_not_init_agents", $show_not_init_agents, true, true);
|
2017-12-21 16:37:19 +01:00
|
|
|
|
|
|
|
$row[] = __('Show full hirearchy');
|
|
|
|
$row[] = html_print_checkbox("serach_hirearchy", $serach_hirearchy, false, true);
|
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
$row[] = __('Agent status');
|
|
|
|
$row[] = html_print_select($agent_status_arr, "status_agent", $status_agent, '', '', 0, true);
|
2018-03-28 17:07:57 +02:00
|
|
|
$row[] = html_print_input_hidden('show_not_init_modules_hidden', $show_not_init_modules, true);
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
// Button
|
|
|
|
$row[] = html_print_submit_button(__('Filter'), "uptbutton", false, 'class="sub search"', true);
|
|
|
|
$table->rowspan[][count($row)-1] = 2;
|
|
|
|
|
|
|
|
$table->data[] = $row;
|
|
|
|
|
2015-09-07 11:53:08 +02:00
|
|
|
if (!is_metaconsole()) {
|
2015-04-17 16:12:51 +02:00
|
|
|
// Module filter
|
|
|
|
$module_status_arr = array();
|
|
|
|
$module_status_arr[-1] = __('All'); //default
|
2015-06-08 13:13:09 +02:00
|
|
|
$module_status_arr[AGENT_MODULE_STATUS_NORMAL] = __('Normal');
|
2015-04-17 16:12:51 +02:00
|
|
|
$module_status_arr[AGENT_MODULE_STATUS_WARNING] = __('Warning');
|
|
|
|
$module_status_arr[AGENT_MODULE_STATUS_CRITICAL_BAD] = __('Critical');
|
|
|
|
$module_status_arr[AGENT_MODULE_STATUS_UNKNOWN] = __('Unknown');
|
|
|
|
$module_status_arr[AGENT_MODULE_STATUS_NOT_INIT] = __('Not init');
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2015-04-17 16:12:51 +02:00
|
|
|
$row = array();
|
|
|
|
$row[] = __('Search module');
|
2015-03-12 15:04:12 +01:00
|
|
|
$row[] = html_print_input_text("search_module", $search_module, '', 40, 30, true);
|
2018-03-28 17:07:57 +02:00
|
|
|
|
|
|
|
$row[] = __('Show not init modules');
|
|
|
|
$row[] = html_print_checkbox("show_not_init_modules", $show_not_init_modules, true, true);
|
|
|
|
|
|
|
|
$row[] = '';
|
|
|
|
$row[] = '';
|
|
|
|
|
2017-10-25 17:44:59 +02:00
|
|
|
$row[] = __('Module status');
|
|
|
|
$row[] = html_print_select($module_status_arr, "status_module", $status_module, '', '', 0, true);
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2015-04-17 16:12:51 +02:00
|
|
|
$table->data[] = $row;
|
|
|
|
}
|
2013-01-10 17:00:30 +01:00
|
|
|
|
2015-09-07 11:53:08 +02:00
|
|
|
if (is_metaconsole()) {
|
2015-03-12 10:27:28 +01:00
|
|
|
$table->width = "96%";
|
|
|
|
$table->cellpadding = "0";
|
|
|
|
$table->cellspacing = "0";
|
|
|
|
$table->class='databox_filters';
|
|
|
|
$table->styleTable='padding:0px;margin-bottom:0px; ';
|
2015-03-06 12:28:05 +01:00
|
|
|
}
|
2015-03-11 21:06:16 +01:00
|
|
|
|
|
|
|
$form_html = '<form id="tree_search" method="post" action="index.php?sec=monitoring&sec2=operation/tree&refr=0&tab='.$tab.'&pure='.$config['pure'].'">';
|
|
|
|
$form_html .= html_print_table($table, true);
|
|
|
|
$form_html .= '</form>';
|
2015-09-07 11:53:08 +02:00
|
|
|
if (is_metaconsole()) {
|
2015-03-12 10:27:28 +01:00
|
|
|
echo "<div class='view_tree'>";
|
|
|
|
ui_toggle($form_html, __('Show Options'));
|
2015-03-11 21:06:16 +01:00
|
|
|
echo "<br>";
|
2015-06-08 09:32:01 +02:00
|
|
|
}
|
|
|
|
else {
|
2015-04-21 17:26:20 +02:00
|
|
|
//echo "<br>";
|
2015-03-11 21:06:16 +01:00
|
|
|
ui_toggle($form_html, __('Tree search'));
|
2015-01-30 20:41:54 +01:00
|
|
|
}
|
2015-03-09 19:29:45 +01:00
|
|
|
|
|
|
|
html_print_input_hidden("group-id", $group_id);
|
|
|
|
html_print_input_hidden("tag-id", $tag_id);
|
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
// --------------------- form filter -----------------------------------
|
2012-04-16 19:26:01 +02:00
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
ui_include_time_picker();
|
|
|
|
ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascript/i18n/");
|
2013-05-20 10:42:02 +02:00
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
ui_require_javascript_file("TreeController", "include/javascript/tree/");
|
|
|
|
|
|
|
|
html_print_image('images/spinner.gif', false,
|
|
|
|
array('class' => "loading_tree",
|
|
|
|
'style' => 'display: none;'));
|
|
|
|
|
2015-09-07 11:53:08 +02:00
|
|
|
echo "<div id='tree-controller-recipient'>";
|
2015-01-30 20:07:50 +01:00
|
|
|
echo "</div>";
|
2014-07-30 16:29:44 +02:00
|
|
|
|
2015-09-07 11:53:08 +02:00
|
|
|
if (is_metaconsole()) {
|
2015-03-06 12:28:05 +01:00
|
|
|
echo "</div>";
|
|
|
|
}
|
|
|
|
|
2013-05-20 10:42:02 +02:00
|
|
|
enterprise_hook('close_meta_frame');
|
|
|
|
|
2012-04-16 19:26:01 +02:00
|
|
|
?>
|
|
|
|
|
2018-06-14 12:17:16 +02:00
|
|
|
<?php if (!is_metaconsole()){ ?>
|
2015-09-07 11:53:08 +02:00
|
|
|
<script type="text/javascript" src="include/javascript/fixed-bottom-box.js"></script>
|
2018-06-14 12:17:16 +02:00
|
|
|
<?php }else{ ?>
|
2015-09-07 11:53:08 +02:00
|
|
|
<script type="text/javascript" src="../../include/javascript/fixed-bottom-box.js"></script>
|
2018-06-14 12:17:16 +02:00
|
|
|
<?php } ?>
|
2015-09-07 11:53:08 +02:00
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
var treeController = TreeController.getController();
|
2012-04-12 18:49:33 +02:00
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
processTreeSearch();
|
2012-07-18 16:31:58 +02:00
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
$("form#tree_search").submit(function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
processTreeSearch();
|
|
|
|
});
|
2012-07-18 16:31:58 +02:00
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
function processTreeSearch () {
|
|
|
|
// Clear the tree
|
|
|
|
if (typeof treeController.recipient != 'undefined' && treeController.recipient.length > 0)
|
|
|
|
treeController.recipient.empty();
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
$(".loading_tree").show();
|
|
|
|
|
|
|
|
var parameters = {};
|
|
|
|
parameters['page'] = "include/ajax/tree.ajax";
|
|
|
|
parameters['getChildren'] = 1;
|
|
|
|
parameters['type'] = "<?php echo $tab; ?>";
|
2017-10-25 17:44:59 +02:00
|
|
|
parameters['filter'] = {};
|
|
|
|
parameters['filter']['searchGroup'] = $("input#text-search_group").val();
|
2015-01-30 20:07:50 +01:00
|
|
|
parameters['filter']['searchAgent'] = $("input#text-search_agent").val();
|
|
|
|
parameters['filter']['statusAgent'] = $("select#status_agent").val();
|
|
|
|
parameters['filter']['searchModule'] = $("input#text-search_module").val();
|
|
|
|
parameters['filter']['statusModule'] = $("select#status_module").val();
|
2015-03-09 19:29:45 +01:00
|
|
|
parameters['filter']['groupID'] = $("input#hidden-group-id").val();
|
|
|
|
parameters['filter']['tagID'] = $("input#hidden-tag-id").val();
|
2012-07-18 16:31:58 +02:00
|
|
|
|
2017-12-21 16:37:19 +01:00
|
|
|
if($("#checkbox-serach_hirearchy").is(':checked')){
|
|
|
|
parameters['filter']['searchHirearchy'] = 1;
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
parameters['filter']['searchHirearchy'] = 0;
|
|
|
|
}
|
2018-03-28 17:07:57 +02:00
|
|
|
|
|
|
|
if($("#checkbox-show_not_init_agents").is(':checked')){
|
|
|
|
parameters['filter']['show_not_init_agents'] = 1;
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
parameters['filter']['show_not_init_agents'] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if($("#checkbox-show_not_init_modules").is(':checked')){
|
|
|
|
parameters['filter']['show_not_init_modules'] = 1;
|
|
|
|
$('#hidden-show_not_init_modules_hidden').val(1);
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
parameters['filter']['show_not_init_modules'] = 0;
|
|
|
|
$('#hidden-show_not_init_modules_hidden').val(0);
|
|
|
|
}
|
2017-12-21 16:37:19 +01:00
|
|
|
|
2013-01-29 11:22:59 +01:00
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
2015-01-30 20:07:50 +01:00
|
|
|
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
|
|
|
data: parameters,
|
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_alerts.php, extensions/snmp_explorer.php,
extensions/insert_data.php, extensions/net_tools.php,
extensions/resource_exportation.php, extensions/system_info.php,
extensions/pandora_logs.php, extensions/agents_modules.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/servers/manage_recontask_form.php,
godmode/setup/gis_step_2.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_add_alerts.php,
godmode/massive/massive_delete_agents.php,
godmode/massive/massive_delete_action_alerts.php,
operation/users/user_edit.php, operation/events/events_list.php,
operation/integria_incidents/incident.list.php,
operation/integria_incidents/incident.workunits.php,
operation/tree.php, general/shortcut_bar.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8054 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-25 11:08:54 +02:00
|
|
|
success: function(data) {
|
2015-01-30 20:07:50 +01:00
|
|
|
if (data.success) {
|
|
|
|
$(".loading_tree").hide();
|
|
|
|
|
|
|
|
treeController.init({
|
|
|
|
recipient: $("div#tree-controller-recipient"),
|
2015-09-11 11:58:12 +02:00
|
|
|
detailRecipient: $.fixedBottomBox({ width: 400, height: window.innerHeight * 0.9 }),
|
2015-01-30 20:07:50 +01:00
|
|
|
page: parameters['page'],
|
2015-04-20 15:48:06 +02:00
|
|
|
emptyMessage: "<?php echo __('No data found'); ?>",
|
2018-03-15 12:06:07 +01:00
|
|
|
foundMessage: "<?php echo __('Found groups'); ?>",
|
2015-01-30 20:07:50 +01:00
|
|
|
tree: data.tree,
|
2015-09-07 11:53:08 +02:00
|
|
|
baseURL: "<?php echo ui_get_full_url(false, false, false, is_metaconsole()); ?>",
|
2015-01-30 20:07:50 +01:00
|
|
|
ajaxURL: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
|
|
|
filter: parameters['filter'],
|
|
|
|
counterTitles: {
|
|
|
|
total: {
|
|
|
|
agents: "<?php echo __('Total agents'); ?>",
|
|
|
|
modules: "<?php echo __('Total modules'); ?>",
|
|
|
|
none: "<?php echo __('Total'); ?>"
|
|
|
|
},
|
|
|
|
alerts: {
|
|
|
|
agents: "<?php echo __('Fired alerts'); ?>",
|
|
|
|
modules: "<?php echo __('Fired alerts'); ?>",
|
|
|
|
none: "<?php echo __('Fired alerts'); ?>"
|
|
|
|
},
|
|
|
|
critical: {
|
|
|
|
agents: "<?php echo __('Critical agents'); ?>",
|
|
|
|
modules: "<?php echo __('Critical modules'); ?>",
|
|
|
|
none: "<?php echo __('Critical'); ?>"
|
|
|
|
},
|
|
|
|
warning: {
|
|
|
|
agents: "<?php echo __('Warning agents'); ?>",
|
|
|
|
modules: "<?php echo __('Warning modules'); ?>",
|
|
|
|
none: "<?php echo __('Warning'); ?>"
|
|
|
|
},
|
|
|
|
unknown: {
|
|
|
|
agents: "<?php echo __('Unknown agents'); ?>",
|
|
|
|
modules: "<?php echo __('Unknown modules'); ?>",
|
|
|
|
none: "<?php echo __('Unknown'); ?>"
|
|
|
|
},
|
|
|
|
not_init: {
|
|
|
|
agents: "<?php echo __('Not init agents'); ?>",
|
|
|
|
modules: "<?php echo __('Not init modules'); ?>",
|
|
|
|
none: "<?php echo __('Not init'); ?>"
|
|
|
|
},
|
|
|
|
ok: {
|
|
|
|
agents: "<?php echo __('Normal agents'); ?>",
|
|
|
|
modules: "<?php echo __('Normal modules'); ?>",
|
|
|
|
none: "<?php echo __('Normal'); ?>"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
dataType: "json"
|
2013-01-30 14:53:02 +01:00
|
|
|
});
|
2013-01-29 11:22:59 +01:00
|
|
|
}
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2013-03-15 10:30:46 +01:00
|
|
|
// Show the modal window of an module
|
2015-01-30 20:07:50 +01:00
|
|
|
var moduleDetailsWindow = $("<div></div>");
|
|
|
|
moduleDetailsWindow
|
|
|
|
.hide()
|
|
|
|
.prop("id", "module_details_window")
|
|
|
|
.appendTo('body');
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2015-04-20 10:40:42 +02:00
|
|
|
function show_module_detail_dialog(module_id, id_agent, server_name, offset, period, module_name) {
|
2015-01-30 20:07:50 +01:00
|
|
|
var params = {};
|
2015-03-16 11:58:12 +01:00
|
|
|
var f = new Date();
|
|
|
|
period = $('#period').val();
|
|
|
|
|
|
|
|
params.selection_mode = $('input[name=selection_mode]:checked').val();
|
2015-06-08 11:05:19 +02:00
|
|
|
if (!params.selection_mode) {
|
|
|
|
params.selection_mode='fromnow';
|
|
|
|
}
|
|
|
|
|
2015-03-16 11:58:12 +01:00
|
|
|
params.date_from = $('#text-date_from').val();
|
2015-06-08 11:05:19 +02:00
|
|
|
if (!params.date_from) {
|
|
|
|
params.date_from = f.getFullYear() + "/" + (f.getMonth() +1) + "/" + f.getDate();
|
|
|
|
}
|
|
|
|
|
2015-03-16 11:58:12 +01:00
|
|
|
params.time_from = $('#text-time_from').val();
|
2015-06-08 11:05:19 +02:00
|
|
|
if (!params.time_from) {
|
|
|
|
params.time_from = f.getHours() + ":" + f.getMinutes();
|
|
|
|
}
|
|
|
|
|
2015-03-16 11:58:12 +01:00
|
|
|
params.date_to = $('#text-date_to').val();
|
2015-06-08 11:05:19 +02:00
|
|
|
if (!params.date_to) {
|
|
|
|
params.date_to =f.getFullYear() + "/" + (f.getMonth() +1) + "/" + f.getDate();
|
|
|
|
}
|
|
|
|
|
2015-03-16 11:58:12 +01:00
|
|
|
params.time_to = $('#text-time_to').val();
|
2015-06-08 11:05:19 +02:00
|
|
|
if (!params.time_to) {
|
|
|
|
params.time_to = f.getHours() + ":" + f.getMinutes();
|
|
|
|
}
|
2015-03-16 11:58:12 +01:00
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
params.page = "include/ajax/module";
|
|
|
|
params.get_module_detail = 1;
|
|
|
|
params.server_name = server_name;
|
|
|
|
params.id_agent = id_agent;
|
|
|
|
params.id_module = module_id;
|
|
|
|
params.offset = offset;
|
|
|
|
params.period = period;
|
2015-04-20 10:40:42 +02:00
|
|
|
title = <?php echo "'" . __("Module: ") . "'" ?> ;
|
2013-03-15 10:30:46 +01:00
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: "<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
|
2015-01-30 20:07:50 +01:00
|
|
|
data: params,
|
2013-03-15 10:30:46 +01:00
|
|
|
dataType: "html",
|
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
* extensions/agents_alerts.php, extensions/snmp_explorer.php,
extensions/insert_data.php, extensions/net_tools.php,
extensions/resource_exportation.php, extensions/system_info.php,
extensions/pandora_logs.php, extensions/agents_modules.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/servers/manage_recontask_form.php,
godmode/setup/gis_step_2.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_add_action_alerts.php,
godmode/massive/massive_add_alerts.php,
godmode/massive/massive_delete_agents.php,
godmode/massive/massive_delete_action_alerts.php,
operation/users/user_edit.php, operation/events/events_list.php,
operation/integria_incidents/incident.list.php,
operation/integria_incidents/incident.workunits.php,
operation/tree.php, general/shortcut_bar.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8054 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-04-25 11:08:54 +02:00
|
|
|
success: function(data) {
|
2013-03-15 10:30:46 +01:00
|
|
|
$("#module_details_window").hide ()
|
|
|
|
.empty ()
|
|
|
|
.append (data)
|
|
|
|
.dialog ({
|
|
|
|
resizable: true,
|
|
|
|
draggable: true,
|
|
|
|
modal: true,
|
2015-04-20 10:40:42 +02:00
|
|
|
title: title + module_name,
|
2013-03-15 10:30:46 +01:00
|
|
|
overlay: {
|
|
|
|
opacity: 0.5,
|
|
|
|
background: "black"
|
|
|
|
},
|
2013-06-07 11:13:08 +02:00
|
|
|
width: 650,
|
2013-03-15 10:30:46 +01:00
|
|
|
height: 500
|
|
|
|
})
|
|
|
|
.show ();
|
2015-04-20 10:40:42 +02:00
|
|
|
refresh_pagination_callback(module_id, id_agent, server_name, module_name);
|
2013-06-07 11:13:08 +02:00
|
|
|
datetime_picker_callback();
|
2013-05-28 17:18:41 +02:00
|
|
|
forced_title_callback();
|
2013-03-15 10:30:46 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2013-06-07 11:13:08 +02:00
|
|
|
function datetime_picker_callback() {
|
|
|
|
$("#text-time_from, #text-time_to").timepicker({
|
|
|
|
showSecond: true,
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
timeFormat: '<?php echo TIME_FORMAT_JS; ?>',
|
2013-06-07 11:13:08 +02:00
|
|
|
timeOnlyTitle: '<?php echo __('Choose time');?>',
|
|
|
|
timeText: '<?php echo __('Time');?>',
|
|
|
|
hourText: '<?php echo __('Hour');?>',
|
|
|
|
minuteText: '<?php echo __('Minute');?>',
|
|
|
|
secondText: '<?php echo __('Second');?>',
|
|
|
|
currentText: '<?php echo __('Now');?>',
|
|
|
|
closeText: '<?php echo __('Close');?>'});
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2015-01-30 20:07:50 +01:00
|
|
|
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
|
2013-06-11 Miguel de Dios <miguel.dedios@artica.es>
* extensions/insert_data.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/constants.php, operation/tree.php,
operation/netflow/nf_live_view.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/agentes/datos_agente.php: fixed the date and time format
and set a help tip to say the Pandora's format.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8287 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-11 15:14:48 +02:00
|
|
|
$("#text-date_from, #text-date_to").datepicker({dateFormat: "<?php echo DATE_FORMAT_JS; ?>"});
|
2013-06-07 11:13:08 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-04-20 10:40:42 +02:00
|
|
|
function refresh_pagination_callback (module_id, id_agent, server_name,module_name) {
|
2014-04-23 09:57:40 +02:00
|
|
|
|
|
|
|
$(".binary_dialog").click( function() {
|
|
|
|
|
2013-03-15 10:30:46 +01:00
|
|
|
var classes = $(this).attr('class');
|
|
|
|
classes = classes.split(' ');
|
2014-04-23 09:57:40 +02:00
|
|
|
var offset_class = classes[2];
|
2013-03-15 10:30:46 +01:00
|
|
|
offset_class = offset_class.split('_');
|
|
|
|
var offset = offset_class[1];
|
2013-06-10 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/jquery.ui-timepicker-addon.js: updated the
datepicker for to avoid some found bugs.
* include/javascript/i18n: added translations for the datepicker.
* godmode/alerts/configure_alert_template.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/planned_downtime.editor.php,
include/ajax/module.php, include/functions_ui.php,
operation/tree.php, operation/agentes/status_monitor.php,
operation/agentes/datos_agente.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php, extensions/insert_data.php:
changed the code for to use the user/system language in the
datepicker.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8284 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-06-10 18:19:48 +02:00
|
|
|
|
2013-03-15 10:30:46 +01:00
|
|
|
var period = $('#period').val();
|
|
|
|
|
2015-04-20 10:40:42 +02:00
|
|
|
show_module_detail_dialog(module_id, id_agent, server_name, offset, period,module_name);
|
2013-03-15 10:30:46 +01:00
|
|
|
return false;
|
|
|
|
});
|
|
|
|
}
|
2015-06-30 16:29:39 +02:00
|
|
|
|
2012-11-26 17:44:41 +01:00
|
|
|
</script>
|