Merge remote-tracking branch 'origin/develop' into ent-3679-7637-7711-Agregar-eliminar-agente-de-politica-en-metaconsola

This commit is contained in:
alejandro-campos 2019-06-25 11:46:52 +02:00
commit 005540fef3
189 changed files with 8871 additions and 3940 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.735-190614
Version: 7.0NG.735-190625
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.735-190614"
pandora_version="7.0NG.735-190625"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.735';
use constant AGENT_BUILD => '190614';
use constant AGENT_BUILD => '190625';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.735
%define release 190614
%define release 190625
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_agent_unix
%define version 7.0NG.735
%define release 190614
%define release 190625
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.735"
PI_BUILD="190614"
PI_BUILD="190625"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190614}
{190625}
ViewReadme
{Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.735(Build 190614)")
#define PANDORA_VERSION ("7.0NG.735(Build 190625)")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.735(Build 190614))"
VALUE "ProductVersion", "(7.0NG.735(Build 190625))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.735-190614
Version: 7.0NG.735-190625
Architecture: all
Priority: optional
Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
pandora_version="7.0NG.735-190614"
pandora_version="7.0NG.735-190625"
package_pear=0
package_pandora=1

View File

@ -1,23 +1,24 @@
<?php
/**
* Pandora FMS - http://pandorafms.com
* ==================================================
* Copyright (c) 2005-2011 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 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.
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 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 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.
$refr = (int) get_parameter('refresh', 0);
// By default 30 seconds
function mainAgentsModules()
{
global $config;
// Load global vars
// Load global vars.
include_once 'include/config.php';
include_once 'include/functions_reporting.php';
include_once $config['homedir'].'/include/functions_agents.php';
@ -25,7 +26,7 @@ function mainAgentsModules()
include_once $config['homedir'].'/include/functions_users.php';
check_login();
// ACL Check
// ACL Check.
if (! check_acl($config['id_user'], 0, 'AR')) {
db_pandora_audit(
'ACL Violation',
@ -37,7 +38,7 @@ function mainAgentsModules()
// Update network modules for this group
// Check for Network FLAG change request
// Made it a subquery, much faster on both the database and server side
// Made it a subquery, much faster on both the database and server side.
if (isset($_GET['update_netgroup'])) {
$group = get_parameter_get('update_netgroup', 0);
if (check_acl($config['id_user'], $group, 'AW')) {
@ -62,7 +63,7 @@ function mainAgentsModules()
$modulegroup = get_parameter('modulegroup', 0);
$refr = (int) get_parameter('refresh', 0);
// By default 30 seconds
// By default 30 seconds.
$recursion = get_parameter('recursion', 0);
$group_id = (int) get_parameter('group_id', 0);
$offset = (int) get_parameter('offset', 0);
@ -79,7 +80,8 @@ function mainAgentsModules()
$full_modules_selected = explode(';', get_parameter('full_modules_selected', 0));
$full_agents_id = explode(';', get_parameter('full_agents_id', 0));
if ($save_serialize && $update_item == '') {
// In full screen there is no pagination neither filters.
if (( ($config['pure'] == 0 && $save_serialize) && $update_item == '' ) || ( ($config['pure'] == 1 && $save_serialize == 0) && $update_item == '' )) {
$unserialize_modules_selected = unserialize_in_temp($config['id_user'].'_agent_module', true, 1);
$unserialize_agents_id = unserialize_in_temp($config['id_user'].'_agents', true, 1);
if ($unserialize_modules_selected) {
@ -102,7 +104,6 @@ function mainAgentsModules()
serialize_in_temp($agents_id, $config['id_user'].'_agents', 1);
}
// if($agents_id != -1) $agents_id = null;
if ($config['pure'] == 0) {
if ($modules_selected[0] && $agents_id[0]) {
$full_modules = urlencode(implode(';', $modules_selected));
@ -124,13 +125,13 @@ function mainAgentsModules()
}
}
// groups
// Groups.
$filter_groups_label = '<b>'.__('Group').'</b>';
$filter_groups = html_print_select_groups(false, 'AR', true, 'group_id', $group_id, '', '', '', true, false, true, '', false, 'width: auto;');
$filter_recursion_label = '<b>'.__('Recursion').'</b>';
$filter_recursion = html_print_checkbox('recursion', 1, 0, true);
// groups module
// Groups module.
$filter_module_groups_label = '<b>'.__('Module group').'</b>';
$filter_module_groups = html_print_select_from_sql(
'SELECT * FROM tmodule_group ORDER BY name',
@ -146,7 +147,7 @@ function mainAgentsModules()
'width: auto;'
);
// agent
// Agent.
$agents = agents_get_group_agents($group_id);
if ((empty($agents)) || $agents == -1) {
$agents = [];
@ -155,7 +156,7 @@ function mainAgentsModules()
$filter_agents_label = '<b>'.__('Agents').'</b>';
$filter_agents = html_print_select($agents, 'id_agents2[]', $agents_id, '', '', 0, true, true, true, '', false, 'min-width: 180px; max-width: 200px;');
// type show
// Type show.
$selection = [
0 => __('Show common modules'),
1 => __('Show all modules'),
@ -163,12 +164,12 @@ function mainAgentsModules()
$filter_type_show_label = '<b>'.__('Show common modules').'</b>';
$filter_type_show = html_print_select($selection, 'selection_agent_module', $selection_a_m, '', '', 0, true, false, true, '', false, 'min-width: 180px;');
// modules
// Modules.
$all_modules = select_modules_for_agent_group($group_id, $agents_id, $selection_a_m, false);
$filter_modules_label = '<b>'.__('Module').'</b>';
$filter_modules = html_print_select($all_modules, 'module[]', $modules_selected, '', '', 0, true, true, false, '', false, 'min-width: 180px; max-width: 200px;');
// update
// Update.
$filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true);
$onheader = [
@ -178,8 +179,11 @@ function mainAgentsModules()
'combo_groups' => $filter_groups,
];
// Old style table, we need a lot of special formatting,don't use table function
// Prepare old-style table
/*
* Old style table, we need a lot of special formatting,don't use table function.
* Prepare old-style table.
*/
if ($config['pure'] == 0) {
// Header.
ui_print_page_header(
@ -200,38 +204,51 @@ function mainAgentsModules()
$full_modules = urlencode(implode(';', $full_modules_selected));
$full_agents = urlencode(implode(';', $full_agents_id));
$url = " index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset
$url = 'index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset
&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr&full_modules_selected=$full_modules
&full_agents_id=$full_agents&selection_agent_module=$selection_a_m";
&full_agents_id=$full_agents&selection_agent_module=$selection_a_m';
} else {
$url = " index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr";
$url = 'index.php?sec=view&sec2=extensions/agents_modules&amp;pure=0&amp;offset=$offset&group_id=$group_id&modulegroup=$modulegroup&refresh=$refr';
}
// Floating menu - Start
// Floating menu - Start.
echo '<div id="vc-controls" style="z-index: 999">';
echo '<div id="menu_tab">';
echo '<ul class="mn">';
// Quit fullscreen
// Quit fullscreen.
echo '<li class="nomn">';
echo '<a target="_top" href="'.$url.'">';
echo html_print_image('images/normal_screen.png', true, ['title' => __('Back to normal mode')]);
echo '</a>';
echo '</li>';
// Countdown
// Countdown.
echo '<li class="nomn">';
echo '<div class="vc-refr">';
echo '<div class="vc-countdown"></div>';
echo '<div class="vc-countdown style="display: inline;"></div>';
echo '<div id="vc-refr-form">';
echo __('Refresh').':';
echo html_print_select(get_refresh_time_array(), 'refresh', $refr, '', '', 0, true, false, false);
echo html_print_select(
get_refresh_time_array(),
'refresh',
$refr,
'',
'',
0,
true,
false,
false,
'',
false,
'margin-top: 3px;'
);
echo '</div>';
echo '</div>';
echo '</li>';
// Console name
// Console name.
echo '<li class="nomn">';
echo '<div class="vc-title">'.__('Agent/module view').'</div>';
echo '</li>';
@ -240,35 +257,35 @@ function mainAgentsModules()
echo '</div>';
echo '</div>';
// Floating menu - End
// Floating menu - End.
ui_require_jquery_file('countdown');
}
if ($config['pure'] != 1) {
echo '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'">';
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">';
echo '<tr>';
echo '<td>'.$filter_groups_label.'</td>';
echo '<td>'.$filter_groups.'&nbsp;&nbsp;&nbsp;'.$filter_recursion_label.$filter_recursion.'</td>';
echo '<td></td>';
echo '<td></td>';
echo '<td>'.$filter_module_groups_label.'</td>';
echo '<td>'.$filter_module_groups.'</td>';
echo '</tr>';
echo '<tr>';
echo '<td>'.$filter_agents_label.'</td>';
echo '<td>'.$filter_agents.'</td>';
echo '<td>'.$filter_type_show_label.'</td>';
echo '<td>'.$filter_type_show.'</td>';
echo '<td>'.$filter_modules_label.'</td>';
echo '<td>'.$filter_modules.'</td>';
echo '</tr>';
echo '<tr>';
echo "<td colspan=6 ><span style='float: right; padding-right: 20px;'>".$filter_update.'</sapn></td>';
echo '</tr>';
echo '</table>';
echo '</form>';
$show_filters = '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'" style="width:100%;">';
$show_filters .= '<table class="white_table" cellpadding="0" cellspacing="0" border="0" style="width:100%; border:none;">';
$show_filters .= '<tr>';
$show_filters .= '<td>'.$filter_groups_label.'</td>';
$show_filters .= '<td>'.$filter_groups.'&nbsp;&nbsp;&nbsp;'.$filter_recursion_label.$filter_recursion.'</td>';
$show_filters .= '<td></td>';
$show_filters .= '<td></td>';
$show_filters .= '<td>'.$filter_module_groups_label.'</td>';
$show_filters .= '<td>'.$filter_module_groups.'</td>';
$show_filters .= '</tr>';
$show_filters .= '<tr>';
$show_filters .= '<td>'.$filter_agents_label.'</td>';
$show_filters .= '<td>'.$filter_agents.'</td>';
$show_filters .= '<td>'.$filter_type_show_label.'</td>';
$show_filters .= '<td>'.$filter_type_show.'</td>';
$show_filters .= '<td>'.$filter_modules_label.'</td>';
$show_filters .= '<td>'.$filter_modules.'</td>';
$show_filters .= '</tr>';
$show_filters .= '<tr>';
$show_filters .= "<td colspan=6 ><span style='float: right; padding-right: 20px;'>".$filter_update.'</sapn></td>';
$show_filters .= '</tr>';
$show_filters .= '</table>';
$show_filters .= '</form>';
ui_toggle($show_filters, __('Filters'));
}
if ($agents_id[0] != -1) {
@ -291,7 +308,7 @@ function mainAgentsModules()
$count = 0;
foreach ($agents as $agent) {
// TODO TAGS agents_get_modules
// TODO TAGS agents_get_modules.
$module = agents_get_modules(
$agent,
false,
@ -339,7 +356,7 @@ function mainAgentsModules()
}
}
} else {
// TODO TAGS agents_get_modules
// TODO TAGS agents_get_modules.
$all_modules = agents_get_modules(
$agents,
false,
@ -414,11 +431,11 @@ function mainAgentsModules()
if ($hor_offset > 0) {
$new_hor_offset = ($hor_offset - $block);
echo "<th width='20px' "."style='vertical-align:top; padding-top: 35px;' "."rowspan='".($nagents + 1)."'>"."<a href='index.php?".'extension_in_menu=estado&'.'sec=extensions&'.'sec2=extensions/agents_modules&'.'refr=0&'.'save_serialize=1&'.'selection_a_m='.$selection_a_m.'&'.'hor_offset='.$new_hor_offset.'&'.'offset='.$offset."'>".html_print_image(
'images/arrow_left.png',
echo "<th width='20px' style='vertical-align: middle; text-align: center;' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&refr=0&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
'images/arrow_left_green.png',
true,
['title' => __('Previous modules')]
).'</a>'.'</th>';
).'</a></th>';
}
$nmodules = 0;
@ -440,11 +457,11 @@ function mainAgentsModules()
if (($hor_offset + $block) < $nmodules) {
$new_hor_offset = ($hor_offset + $block);
echo "<th width='20px' "."style='vertical-align:top; padding-top: 35px;' "."rowspan='".($nagents + 1)."'>"."<a href='index.php?".'extension_in_menu=estado&'.'sec=extensions&'.'sec2=extensions/agents_modules&'.'save_serialize=1&'.'selection_a_m='.$selection_a_m.'&'.'hor_offset='.$new_hor_offset.'&'.'offset='.$offset."'>".html_print_image(
'images/arrow.png',
echo "<th width='20px' style='vertical-align: middle; text-align: center;' rowspan='".($nagents + 1)."'><a href='index.php?".'extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&selection_a_m='.$selection_a_m.'&hor_offset='.$new_hor_offset.'&offset='.$offset."'>".html_print_image(
'images/arrow_right_green.png',
true,
['title' => __('More modules')]
).'</a>'.'</th>';
).'</a></th>';
}
echo '</tr>';
@ -457,12 +474,12 @@ function mainAgentsModules()
$filter_agents['id_grupo'] = $group_id;
}
// Prepare pagination
$url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&'.'hor_offset='.$hor_offset.'&selection_a_m='.$selection_a_m;
// Prepare pagination.
$url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&hor_offset='.$hor_offset.'&selection_a_m='.$selection_a_m;
ui_pagination($total_pagination, $url);
foreach ($agents as $agent) {
// Get stats for this group
// Get stats for this group.
$agent_status = agents_get_status($agent['id_agente']);
$alias = db_get_row('tagente', 'id_agente', $agent['id_agente']);
if (empty($alias['alias'])) {
@ -471,29 +488,29 @@ function mainAgentsModules()
switch ($agent_status) {
case 4:
// Alert fired status
// Alert fired status.
$rowcolor = 'group_view_alrm';
break;
case 1:
// Critical status
// Critical status.
$rowcolor = 'group_view_crit';
break;
case 2:
// Warning status
// Warning status.
$rowcolor = 'group_view_warn';
break;
case 0:
// Normal status
// Normal status.
$rowcolor = 'group_view_ok';
break;
case 3:
case -1:
default:
// Unknown status
// Unknown status.
$rowcolor = 'group_view_unk';
break;
}
@ -502,7 +519,7 @@ function mainAgentsModules()
echo "<td class='$rowcolor'>
<a class='$rowcolor' href='index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=".$agent['id_agente']."'>".$alias['alias'].'</a></td>';
// TODO TAGS agents_get_modules
// TODO TAGS agents_get_modules.
$agent_modules = agents_get_modules($agent['id_agente'], false, $filter_module_group, true, true);
$nmodules = 0;
@ -572,18 +589,23 @@ function mainAgentsModules()
echo '</table>';
echo "<div class='legend_basic' style='width: 96%'>";
$show_legend = "<div class='legend_white'>";
$show_legend .= "<div style='display: flex;align-items: center;'>
<div class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></div>".__('Orange cell when the module has fired alerts').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
<div class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></div>".__('Red cell when the module has a critical status').'
</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
<div class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></div>".__('Yellow cell when the module has a warning status').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
<div class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></div>".__('Green cell when the module has a normal status').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
<div class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></div>".__('Grey cell when the module has an unknown status').'</div>';
$show_legend .= "<div style='display: flex;align-items: center;'>
<div class='legend_square_simple'><div style='background-color: ".COL_NOTINIT.";'></div></div>".__("Cell turns blue when the module is in 'not initialize' status").'</div>';
$show_legend .= '</div>';
ui_toggle($show_legend, __('Legend'));
echo '<table>';
echo "<tr><td colspan='2' style='padding-bottom: 10px;'><b>".__('Legend').'</b></td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></td><td>".__('Orange cell when the module has fired alerts').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></td><td>".__('Red cell when the module has a critical status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></td><td>".__('Yellow cell when the module has a warning status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></td><td>".__('Green cell when the module has a normal status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></td><td>".__('Grey cell when the module has an unknown status').'</td></tr>';
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NOTINIT.";'></div></td><td>".__("Cell turns blue when the module is in 'not initialize' status").'</td></tr>';
echo '</table>';
echo '</div>';
$pure_var = $config['pure'];
if ($pure_var) {
$pure_var = 1;
@ -627,15 +649,13 @@ $ignored_params['refresh'] = '';
$.each($('.th_class_module_r'), function (i, elem) {
id = $(elem).attr('id').replace('th_module_r_', '');
$("#th_module_r_" + id).height(($("#div_module_r_" + id).width() + 10) + 'px');
//$("#div_module_r_" + id).css('margin-top', (max_width - $("#div_module_r_" + id).width()) + 'px');
$("#div_module_r_" + id).css('margin-top', (max_width - 20) + 'px');
$("#div_module_r_" + id).show();
});
var refr =" . $refr . ";
var pure =" . $pure_var . ";
var href ='" . ui_get_url_refresh ($ignored_params) . "';
var refr = '<?php echo get_parameter('refresh', 0); ?>';
var pure = '<?php echo get_parameter('pure', 0); ?>';
var href =' <?php echo ui_get_url_refresh($ignored_params); ?>';
if (pure) {
var startCountDown = function (duration, cb) {
@ -646,7 +666,7 @@ $ignored_params['refresh'] = '';
$('div.vc-countdown').countdown({
until: t,
format: 'MS',
layout: '(%M%nn%M:%S%nn%S Until refresh)',
layout: '(%M%nn%M:%S%nn%S <?php echo __('Until next'); ?>) ',
alwaysExpire: true,
onExpiry: function () {
$('div.vc-countdown').countdown('destroy');
@ -656,7 +676,10 @@ $ignored_params['refresh'] = '';
});
}
startCountDown(refr, false);
if(refr>0){
startCountDown(refr, false);
}
var controls = document.getElementById('vc-controls');
autoHideElement(controls, 1000);

View File

@ -1,17 +1,32 @@
<?php
/**
* Module groups.
*
* @category Extensions
* @package Pandora FMS
* @subpackage Module groups view.
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2019 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 General Public License
* as published by the Free Software Foundation for 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.
* ============================================================================
*/
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 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 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.
// Load global vars
// Begin.
global $config;
check_login();
@ -32,10 +47,12 @@ if (is_ajax()) {
}
/**
* The main function of module groups and the enter point to
* execute the code.
*/
/**
* The main function of module groups and the enter point to
* execute the code.
*
* @return void
*/
function mainModuleGroups()
{
global $config;
@ -68,13 +85,20 @@ function mainModuleGroups()
$info = array_filter(
$info,
function ($v, $k) use ($agent_group_search) {
return preg_match("/$agent_group_search/i", $v['name']);
return preg_match(
'/'.$agent_group_search.'/i',
$v['name']
);
},
ARRAY_FILTER_USE_BOTH
);
if (!empty($info)) {
$groups_view = $is_not_paginated ? $info : array_slice($info, $offset, $config['block_size']);
$groups_view = ($is_not_paginated) ? $info : array_slice(
$info,
$offset,
$config['block_size']
);
$agents_counters = array_reduce(
$groups_view,
function ($carry, $item) {
@ -113,7 +137,7 @@ function mainModuleGroups()
$array_module_group = array_filter(
$array_module_group,
function ($v, $k) use ($module_group_search) {
return preg_match("/$module_group_search/i", $v);
return preg_match('/'.$module_group_search.'/i', $v);
},
ARRAY_FILTER_USE_BOTH
);
@ -125,66 +149,75 @@ function mainModuleGroups()
$array_for_defect[$key]['data']['icon'] = $value['icon'];
}
$sql = "SELECT SUM(IF(tae.alert_fired <> 0, 1, 0)) AS alerts_module_count,
SUM(IF($condition_warning, 1, 0)) AS warning_module_count,
SUM(IF($condition_unknown, 1, 0)) AS unknown_module_count,
SUM(IF($condition_not_init, 1, 0)) AS notInit_module_count,
SUM(IF($condition_critical, 1, 0)) AS critical_module_count,
SUM(IF($condition_normal, 1, 0)) AS normal_module_count,
COUNT(tae.id_agente_modulo) AS total_count,
tmg.id_mg,
tmg.name as n,
tg.id_grupo
FROM (
SELECT tam.id_agente_modulo,
tam.id_module_group,
ta.id_grupo AS g,
tae.estado,
SUM(IF(tatm.last_fired <> 0, 1, 0)) AS alert_fired
FROM tagente_modulo tam
LEFT JOIN talert_template_modules tatm
ON tatm.id_agent_module = tam.id_agente_modulo
AND tatm.times_fired = 1
LEFT JOIN tagente_estado tae
ON tae.id_agente_modulo = tam.id_agente_modulo
INNER JOIN tagente ta
ON ta.id_agente = tam.id_agente
WHERE ta.disabled = 0
AND tam.disabled = 0
AND tam.delete_pending = 0
AND ta.id_grupo IN ($ids_group)
GROUP BY tam.id_agente_modulo
UNION ALL
SELECT tam.id_agente_modulo,
tam.id_module_group,
tasg.id_group AS g,
tae.estado,
SUM(IF(tatm.last_fired <> 0, 1, 0)) AS alert_fired
FROM tagente_modulo tam
LEFT JOIN talert_template_modules tatm
ON tatm.id_agent_module = tam.id_agente_modulo
AND tatm.times_fired = 1
LEFT JOIN tagente_estado tae
ON tae.id_agente_modulo = tam.id_agente_modulo
INNER JOIN tagente ta
ON ta.id_agente = tam.id_agente
INNER JOIN tagent_secondary_group tasg
ON ta.id_agente = tasg.id_agent
WHERE ta.disabled = 0
AND tam.disabled = 0
AND tam.delete_pending = 0
AND tasg.id_group IN ($ids_group)
GROUP BY tam.id_agente_modulo, tasg.id_group
) AS tae
RIGHT JOIN tgrupo tg
ON tg.id_grupo = tae.g
INNER JOIN (
SELECT * FROM tmodule_group
UNION ALL
SELECT 0 AS 'id_mg', 'Nothing' AS 'name'
) AS tmg
ON tae.id_module_group = tmg.id_mg
GROUP BY tae.g, tmg.id_mg";
$sql = sprintf(
"SELECT SUM(IF(tae.alert_fired <> 0, 1, 0)) AS alerts_module_count,
SUM(IF(%s, 1, 0)) AS warning_module_count,
SUM(IF(%s, 1, 0)) AS unknown_module_count,
SUM(IF(%s, 1, 0)) AS notInit_module_count,
SUM(IF(%s, 1, 0)) AS critical_module_count,
SUM(IF(%s, 1, 0)) AS normal_module_count,
COUNT(tae.id_agente_modulo) AS total_count,
tmg.id_mg,
tmg.name as n,
tg.id_grupo
FROM (
SELECT tam.id_agente_modulo,
tam.id_module_group,
ta.id_grupo AS g,
tae.estado,
SUM(IF(tatm.last_fired <> 0, 1, 0)) AS alert_fired
FROM tagente_modulo tam
LEFT JOIN talert_template_modules tatm
ON tatm.id_agent_module = tam.id_agente_modulo
AND tatm.times_fired = 1
LEFT JOIN tagente_estado tae
ON tae.id_agente_modulo = tam.id_agente_modulo
INNER JOIN tagente ta
ON ta.id_agente = tam.id_agente
WHERE ta.disabled = 0
AND tam.disabled = 0
AND tam.delete_pending = 0
AND ta.id_grupo IN (%s)
GROUP BY tam.id_agente_modulo
UNION ALL
SELECT tam.id_agente_modulo,
tam.id_module_group,
tasg.id_group AS g,
tae.estado,
SUM(IF(tatm.last_fired <> 0, 1, 0)) AS alert_fired
FROM tagente_modulo tam
LEFT JOIN talert_template_modules tatm
ON tatm.id_agent_module = tam.id_agente_modulo
AND tatm.times_fired = 1
LEFT JOIN tagente_estado tae
ON tae.id_agente_modulo = tam.id_agente_modulo
INNER JOIN tagente ta
ON ta.id_agente = tam.id_agente
INNER JOIN tagent_secondary_group tasg
ON ta.id_agente = tasg.id_agent
WHERE ta.disabled = 0
AND tam.disabled = 0
AND tam.delete_pending = 0
AND tasg.id_group IN (%s)
GROUP BY tam.id_agente_modulo, tasg.id_group
) AS tae
RIGHT JOIN tgrupo tg
ON tg.id_grupo = tae.g
INNER JOIN (
SELECT * FROM tmodule_group
UNION ALL
SELECT 0 AS 'id_mg', 'Nothing' AS 'name'
) AS tmg
ON tae.id_module_group = tmg.id_mg
GROUP BY tae.g, tmg.id_mg",
$condition_warning,
$condition_unknown,
$condition_not_init,
$condition_critical,
$condition_normal,
$ids_group,
$ids_group
);
$array_data_prev = db_get_all_rows_sql($sql);
@ -220,9 +253,21 @@ function mainModuleGroups()
echo '<td>';
echo '</tr></table>';
$cell_style = '
min-width: 60px;
width: 100%;
margin: 0;
overflow:hidden;
text-align: center;
padding: 5px;
padding-bottom:10px;
font-size: 18px;
text-align: center;
';
if (true) {
$table = new StdClass();
$table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; padding-right: 10px; min-width: 230px;';
$table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; min-width: 230px;';
$table->width = '100%';
$head[0] = __('Groups');
@ -248,28 +293,28 @@ function mainModuleGroups()
$color = '#FFA631';
// Orange when the cell for this model group and agent has at least one alert fired.
} else if ($array_data[$key][$k]['critical_module_count'] != 0) {
$color = '#FC4444';
$color = '#e63c52';
// Red when the cell for this model group and agent has at least one module in critical state and the rest in any state.
} else if ($array_data[$key][$k]['warning_module_count'] != 0) {
$color = '#FAD403';
$color = '#f3b200';
// Yellow when the cell for this model group and agent has at least one in warning state and the rest in green state.
} else if ($array_data[$key][$k]['unknown_module_count'] != 0) {
$color = '#B2B2B2 ';
// Grey when the cell for this model group and agent has at least one module in unknown state and the rest in any state.
} else if ($array_data[$key][$k]['normal_module_count'] != 0) {
$color = '#80BA27';
$color = '#82b92e';
// Green when the cell for this model group and agent has OK state all modules.
} else if ($array_data[$key][$k]['notInit_module_count'] != 0) {
$color = '#5BB6E5';
// Blue when the cell for this module group and all modules have not init value.
}
$data[$i][$j] = "<div style='background:$color; height: 20px;min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
$data[$i][$j] = "<div style='".$cell_style.'background:'.$color.";'>";
$data[$i][$j] .= "<a class='info_cell' rel='$rel' href='$url' style='color:white;font-size: 18px;'>";
$data[$i][$j] .= $array_data[$key][$k]['total_count'];
$data[$i][$j] .= '</a></div>';
} else {
$data[$i][$j] = "<div style='background:white; height: 20px;min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
$data[$i][$j] = "<div style='background:white;".$cell_style."'>";
$data[$i][$j] .= 0;
$data[$i][$j] .= '</div>';
}
@ -278,7 +323,7 @@ function mainModuleGroups()
}
} else {
foreach ($value['gm'] as $k => $v) {
$data[$i][$j] = "<div style='background:white; height: 20px;min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
$data[$i][$j] = "<div style='background:white; min-width: 60px;max-width:5%;overflow:hidden; margin-left: auto; margin-right: auto; text-align: center; padding: 5px;padding-bottom:10px;font-size: 18px;line-height:25px;'>";
$data[$i][$j] .= 0;
$data[$i][$j] .= '</div>';
$j++;

View File

@ -11,5 +11,5 @@
#graph_container {
width: 800px;
margin: 20px auto !important;
margin: 20px auto;
}

View File

@ -1,3 +0,0 @@
/general/login_identification_wizard.php
/general/login_required.php
/godmode/update_manager/update_manager.messages.php

View File

@ -20,6 +20,8 @@ if (isset($_SERVER['REQUEST_TIME'])) {
$time = get_system_time();
}
ui_require_css_file('footer');
$license_file = 'general/license/pandora_info_'.$config['language'].'.html';
if (! file_exists($config['homedir'].$license_file)) {
$license_file = 'general/license/pandora_info_en.html';
@ -41,9 +43,17 @@ if ($current_package == 0) {
$build_package_version = $current_package;
}
echo sprintf(__('%s %s - Build %s - MR %s', get_product_name(), $pandora_version, $build_package_version, $config['MR']));
echo __(
'%s %s - Build %s - MR %s',
get_product_name(),
$pandora_version,
$build_package_version,
$config['MR']
);
echo '</a><br />';
echo '<small><span>'.__('Page generated on %s', date('Y-m-d H:i:s')).'</span></small>';
echo '</a> ';
if (isset($config['debug'])) {
$cache_info = [];

View File

@ -19,8 +19,8 @@ if (isset($config['homedir'])) {
ui_require_css_file('login');
require_once $homedir.'include/functions_ui.php';
require_once $homedir.'include/functions.php';
require_once __DIR__.'/../include/functions_ui.php';
require_once __DIR__.'/../include/functions.php';
require_once __DIR__.'/../include/functions_html.php';
@ -518,6 +518,7 @@ if ($login_screen == 'error_authconfig' || $login_screen == 'error_emptyconfig'
ui_require_css_file('dialog');
ui_require_css_file('jquery-ui.min', 'include/styles/js/');
ui_require_jquery_file('jquery-ui.min');
ui_require_jquery_file('jquery-ui_custom');
?>
<?php

View File

@ -103,199 +103,203 @@ if (!empty($all_data)) {
$data['server_sanity'] = format_numeric((100 - $data['module_sanity']), 1);
}
ui_require_css_file('logon');
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
echo '<div id="welcome_panel">';
<td width="25%" style="padding-right: 20px;" valign="top">
//
// Overview Table.
//
$table = new stdClass();
$table->class = 'no-class';
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->head = [];
$table->data = [];
$table->headstyle[0] = 'text-align:center;';
$table->width = '100%';
$table->head_colspan[0] = 4;
// Indicators.
$tdata = [];
$stats = reporting_get_stats_indicators($data, 120, 10, false);
$status = '<table class="status_tactical">';
foreach ($stats as $stat) {
$status .= '<tr><td><b>'.$stat['title'].'</b></td><td>'.$stat['graph'].'</td></tr>';
}
$status .= '</table>';
$table->data[0][0] = $status;
$table->rowclass[] = '';
$table->data[] = $tdata;
// Alerts.
$tdata = [];
$tdata[0] = reporting_get_stats_alerts($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Modules by status.
$tdata = [];
$tdata[0] = reporting_get_stats_modules_status($data, 180, 100);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Total agents and modules.
$tdata = [];
$tdata[0] = reporting_get_stats_agents_monitors($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Users.
if (users_is_admin()) {
$tdata = [];
$tdata[0] = reporting_get_stats_users($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
}
ui_toggle(
html_print_table($table, true),
__('%s Overview', get_product_name()),
'',
'overview',
false
);
unset($table);
echo '<div id="right">';
// News.
$options = [];
$options['id_user'] = $config['id_user'];
$options['modal'] = false;
$options['limit'] = 3;
$news = get_news($options);
<?php
//
// Overview Table.
//
$table = new stdClass();
$table->class = 'databox';
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->head = [];
$table->data = [];
$table->headstyle[0] = 'text-align:center;';
$table->width = '100%';
$table->head[0] = '<span>'.__('%s Overview', get_product_name()).'</span>';
$table->head_colspan[0] = 4;
if (!empty($news)) {
ui_require_css_file('news');
// NEWS BOARD.
if ($config['prominent_time'] == 'timestamp') {
$comparation_suffix = '';
} else {
$comparation_suffix = __('ago');
}
// Indicators.
$tdata = [];
$stats = reporting_get_stats_indicators($data, 120, 10, false);
$status = '<table class="status_tactical">';
foreach ($stats as $stat) {
$status .= '<tr><td><b>'.$stat['title'].'</b></td><td>'.$stat['graph'].'</td></tr>';
}
$output_news = '<div id="news_board" class="new">';
foreach ($news as $article) {
$image = false;
if ($article['text'] == '&amp;lt;p&#x20;style=&quot;text-align:&#x20;center;&#x20;font-size:&#x20;13px;&quot;&amp;gt;Hello,&#x20;congratulations,&#x20;if&#x20;you&apos;ve&#x20;arrived&#x20;here&#x20;you&#x20;already&#x20;have&#x20;an&#x20;operational&#x20;monitoring&#x20;console.&#x20;Remember&#x20;that&#x20;our&#x20;forums&#x20;and&#x20;online&#x20;documentation&#x20;are&#x20;available&#x20;24x7&#x20;to&#x20;get&#x20;you&#x20;out&#x20;of&#x20;any&#x20;trouble.&#x20;You&#x20;can&#x20;replace&#x20;this&#x20;message&#x20;with&#x20;a&#x20;personalized&#x20;one&#x20;at&#x20;Admin&#x20;tools&#x20;-&amp;amp;gt;&#x20;Site&#x20;news.&amp;lt;/p&amp;gt;&#x20;') {
$image = true;
}
$status .= '</table>';
$table->data[0][0] = $status;
$table->rowclass[] = '';
$text_bbdd = io_safe_output($article['text']);
$text = html_entity_decode($text_bbdd);
$output_news .= '<span class="green_title">'.$article['subject'].'</span>';
$output_news .= '<div class="new content">';
$output_news .= '<p>'.__('by').' <b>'.$article['author'].'</b> <i>'.ui_print_timestamp($article['timestamp'], true).'</i> '.$comparation_suffix.'</p>';
if ($image) {
$output_news .= '<center><img src="./images/welcome_image.png" alt="img colabora con nosotros - Support" width="191" height="207"></center>';
}
$table->data[] = $tdata;
$output_news .= nl2br($text);
$output_news .= '</div>';
}
// Alerts.
$tdata = [];
$tdata[0] = reporting_get_stats_alerts($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
$output_news .= '</div>';
// Modules by status.
$tdata = [];
$tdata[0] = reporting_get_stats_modules_status($data, 180, 100);
$table->rowclass[] = '';
$table->data[] = $tdata;
// News board.
ui_toggle(
$output_news,
__('News board'),
'',
'news',
false
);
// END OF NEWS BOARD.
}
// Total agents and modules.
$tdata = [];
$tdata[0] = reporting_get_stats_agents_monitors($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Users.
if (users_is_admin()) {
$tdata = [];
$tdata[0] = reporting_get_stats_users($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
}
html_print_table($table);
unset($table);
?>
// LAST ACTIVITY.
// Show last activity from this user.
$table = new stdClass();
$table->class = 'no-td-padding info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->width = '100%';
// Don't specify px.
$table->data = [];
$table->size = [];
$table->headstyle = [];
$table->size[0] = '5%';
$table->size[1] = '15%';
$table->headstyle[1] = 'min-width: 12em;';
$table->size[2] = '5%';
$table->headstyle[2] = 'min-width: 65px;';
$table->size[3] = '10%';
$table->size[4] = '25%';
$table->head = [];
$table->head[0] = __('User');
$table->head[1] = __('Action');
$table->head[2] = __('Date');
$table->head[3] = __('Source IP');
$table->head[4] = __('Comments');
$table->align[4] = 'left';
$sql = sprintf(
'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp
FROM tsesion
WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.")
AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10",
$config['id_user']
);
</td>
$sessions = db_get_all_rows_sql($sql);
<td width="75%" valign="top">
if ($sessions === false) {
$sessions = [];
}
foreach ($sessions as $session) {
$data = [];
$session_id_usuario = $session['id_usuario'];
$session_ip_origen = $session['ip_origen'];
<?php
$options = [];
$options['id_user'] = $config['id_user'];
$options['modal'] = false;
$options['limit'] = 3;
$news = get_news($options);
$data[0] = '<strong>'.$session_id_usuario.'</strong>';
$data[1] = ui_print_session_action_icon($session['accion'], true).' '.$session['accion'];
$data[2] = ui_print_help_tip(
date($config['date_format'], $session['utimestamp']),
true
).human_time_comparation($session['utimestamp'], 'tiny');
$data[3] = $session_ip_origen;
$description = str_replace([',', ', '], ', ', $session['descripcion']);
if (strlen($description) > 100) {
$data[4] = '<div >'.io_safe_output(substr($description, 0, 150).'...').'</div>';
} else {
$data[4] = '<div >'.io_safe_output($description).'</div>';
}
array_push($table->data, $data);
}
if (!empty($news)) {
// NEWS BOARD.
echo '<div id="news_board">';
$activity .= html_print_table($table, true);
unset($table);
echo '<table cellpadding="0" width=100% cellspacing="0" class="databox filters">';
echo '<tr><th style="text-align:center;"><span >'.__('News board').'</span></th></tr>';
if ($config['prominent_time'] == 'timestamp') {
$comparation_suffix = '';
} else {
$comparation_suffix = __('ago');
}
ui_toggle(
$activity,
__('Latest activity'),
'',
'activity',
false,
false,
'',
'white-box-content padded'
);
// END OF LAST ACTIVIYY.
// Close right panel.
echo '</div>';
foreach ($news as $article) {
$image = false;
if ($article['text'] == '&amp;lt;p&#x20;style=&quot;text-align:&#x20;center;&#x20;font-size:&#x20;13px;&quot;&amp;gt;Hello,&#x20;congratulations,&#x20;if&#x20;you&apos;ve&#x20;arrived&#x20;here&#x20;you&#x20;already&#x20;have&#x20;an&#x20;operational&#x20;monitoring&#x20;console.&#x20;Remember&#x20;that&#x20;our&#x20;forums&#x20;and&#x20;online&#x20;documentation&#x20;are&#x20;available&#x20;24x7&#x20;to&#x20;get&#x20;you&#x20;out&#x20;of&#x20;any&#x20;trouble.&#x20;You&#x20;can&#x20;replace&#x20;this&#x20;message&#x20;with&#x20;a&#x20;personalized&#x20;one&#x20;at&#x20;Admin&#x20;tools&#x20;-&amp;amp;gt;&#x20;Site&#x20;news.&amp;lt;/p&amp;gt;&#x20;') {
$image = true;
}
$text_bbdd = io_safe_output($article['text']);
$text = html_entity_decode($text_bbdd);
echo '<tr><th class="green_title">'.$article['subject'].'</th></tr>';
echo '<tr><td>'.__('by').' <b>'.$article['author'].'</b> <i>'.ui_print_timestamp($article['timestamp'], true).'</i> '.$comparation_suffix.'</td></tr>';
echo '<tr><td class="datos">';
if ($image) {
echo '<center><img src="./images/welcome_image.png" alt="img colabora con nosotros - Support" width="191" height="207"></center>';
}
echo nl2br($text);
echo '</td></tr>';
}
echo '</table>';
echo '</div>';
// News board.
echo '<br><br>';
// END OF NEWS BOARD.
}
// LAST ACTIVITY.
// Show last activity from this user.
echo '<div id="activity">';
$table = new stdClass();
$table->class = 'info_table';
$table->cellpadding = 0;
$table->cellspacing = 0;
$table->width = '100%';
// Don't specify px.
$table->data = [];
$table->size = [];
$table->size[0] = '5%';
$table->size[1] = '15%';
$table->size[2] = '15%';
$table->size[3] = '10%';
$table->size[4] = '25%';
$table->head = [];
$table->head[0] = __('User');
$table->head[1] = __('Action');
$table->head[2] = __('Date');
$table->head[3] = __('Source IP');
$table->head[4] = __('Comments');
$table->title = '<span>'.__('This is your last activity performed on the %s console', get_product_name()).'</span>';
$sql = sprintf(
'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp
FROM tsesion
WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.")
AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10",
$config['id_user']
);
$sessions = db_get_all_rows_sql($sql);
if ($sessions === false) {
$sessions = [];
}
foreach ($sessions as $session) {
$data = [];
$session_id_usuario = $session['id_usuario'];
$session_ip_origen = $session['ip_origen'];
$data[0] = '<strong>'.$session_id_usuario.'</strong>';
$data[1] = ui_print_session_action_icon($session['accion'], true).' '.$session['accion'];
$data[2] = ui_print_help_tip(
date($config['date_format'], $session['utimestamp']),
true
).human_time_comparation($session['utimestamp'], 'tiny');
$data[3] = $session_ip_origen;
$description = str_replace([',', ', '], ', ', $session['descripcion']);
if (strlen($description) > 100) {
$data[4] = '<div >'.io_safe_output(substr($description, 0, 150).'...').'</div>';
} else {
$data[4] = '<div >'.io_safe_output($description).'</div>';
}
array_push($table->data, $data);
}
echo "<div style='width:100%; overflow-x:auto;'>";
html_print_table($table);
unset($table);
echo '</div>';
echo '</div>';
// END OF LAST ACTIVIYY.
?>
</td>
</tr>
</table>
// Close welcome panel.
echo '</div>';

View File

@ -30,12 +30,6 @@ $(document).ready(function(){
}
});
// Set the height of the menu.
$(window).on('load', function (){
$("#menu_full").height($("#container").height());
});
</script>
<?php
$autohidden_menu = 0;

View File

@ -94,7 +94,7 @@ $table->data[1] = $data;
$form = '<form name="query_sel" method="post" action="index.php?sec=glog&sec2=godmode/admin_access_logs">';
$form .= html_print_table($table, true);
$form .= '</form>';
ui_toggle($form, __('Filter'), '', false);
ui_toggle($form, __('Filter'), '', '', false);
$filter = '1=1';

View File

@ -176,7 +176,7 @@ if ($disk_conf_delete) {
@unlink($filename['conf']);
}
echo '<form name="conf_agent" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
echo '<form autocomplete="new-password" name="conf_agent" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
// Custom ID.
$custom_id_div = '<div class="label_select">';
@ -245,7 +245,7 @@ if (!$new_agent && $alias != '') {
$table_agent_name .= '</div></div></div>';
// QR code div.
$table_qr_code = '<div class="agent_qr white_box">';
$table_qr_code = '<div class="box-shadow agent_qr white_box">';
$table_qr_code .= '<p class="input_label">'.__('QR Code Agent view').': </p>';
$table_qr_code .= '<div id="qr_container_image"></div>';
if ($id_agente) {
@ -401,7 +401,7 @@ $table_description .= html_print_textarea(
// QR code.
echo '<div class="first_row">
<div class="agent_options '.$agent_options_update.' white_box">
<div class="box-shadow agent_options '.$agent_options_update.' white_box">
<div class="agent_options_column_left">'.$table_agent_name.$table_alias.$table_ip.$table_primary_group.'</div>
<div class="agent_options_column_right">'.$table_interval.$table_os.$table_server.$table_description.'</div>
</div>';
@ -413,8 +413,8 @@ echo '</div>';
if (enterprise_installed()) {
$secondary_groups_selected = enterprise_hook('agents_get_secondary_groups', [$id_agente]);
$table_adv_secondary_groups = '<div class="label_select"><p class="input_label">'.__('Secondary groups').': </p></div>';
$table_adv_secondary_groups_left = html_print_select_groups(
$adv_secondary_groups_label = '<div class="label_select"><p class="input_label">'.__('Secondary groups').': </p></div>';
$adv_secondary_groups_left = html_print_select_groups(
false,
// Use the current user to select the groups.
'AR',
@ -441,7 +441,7 @@ if (enterprise_installed()) {
// CSS classnames (default).
false,
// Not disabled (default).
'width:50%; min-width:170px;',
'min-width:170px;',
// Inline styles (default).
false,
// Option style select (default).
@ -455,7 +455,7 @@ if (enterprise_installed()) {
// Do not show the primary group in this selection.
);
$table_adv_secondary_groups_arrows = html_print_input_image(
$adv_secondary_groups_arrows = html_print_input_image(
'add_secondary',
'images/darrowright_green.png',
1,
@ -479,7 +479,7 @@ if (enterprise_installed()) {
]
);
$table_adv_secondary_groups_right .= html_print_select(
$adv_secondary_groups_right .= html_print_select(
$secondary_groups_selected['for_select'],
// Values.
'secondary_groups_selected',
@ -502,7 +502,7 @@ if (enterprise_installed()) {
// Class.
false,
// Disabled.
'width:50%; min-width:170px;'
'min-width:170px;'
// Style.
);
@ -579,7 +579,7 @@ if (enterprise_installed()) {
}
$table_adv_parent = '<div class="label_select"><p class="input_label">'.__('Parent').': </p>';
$table_adv_parent = '<div class="label_select"><label class="input_label">'.__('Parent').': </label>';
$params = [];
$params['return'] = true;
$params['show_helptip'] = true;
@ -648,13 +648,15 @@ $table_adv_module_mode .= html_print_radio_button_extended(
$table_adv_module_mode .= '</div></div>';
// Status (Disabled / Enabled).
$table_adv_status = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Disabled').': '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).'</p>';
$table_adv_status = '<div class="label_select_simple label_simple_one_item">';
$table_adv_status .= html_print_checkbox_switch(
'disabled',
1,
$disabled,
true
).'</div>';
);
$table_adv_status .= '<p class="input_label input_label_simple">'.__('Disabled').': '.ui_print_help_tip(__('If the remote configuration is enabled, it will also go into standby mode when disabling it.'), true).'</p>';
$table_adv_status .= '</div>';
// Url address.
if (enterprise_installed()) {
@ -665,7 +667,14 @@ if (enterprise_installed()) {
'',
45,
255,
true
true,
false,
false,
'',
'',
'',
// Autocomplete.
'new-password'
).'</div>';
} else {
$table_adv_url = '<div class="label_select"><p class="input_label">'.__('Url address').': </p></div>';
@ -679,9 +688,11 @@ if (enterprise_installed()) {
).'</div>';
}
$table_adv_quiet = '<div class="label_select_simple label_simple_one_item"><p class="input_label input_label_simple">'.__('Quiet').': ';
$table_adv_quiet = '<div class="label_select_simple label_simple_one_item">';
$table_adv_quiet .= html_print_checkbox_switch('quiet', 1, $quiet, true);
$table_adv_quiet .= '<p class="input_label input_label_simple">'.__('Quiet').': ';
$table_adv_quiet .= ui_print_help_tip(__('The agent still runs but the alerts and events will be stop'), true).'</p>';
$table_adv_quiet .= html_print_checkbox_switch('quiet', 1, $quiet, true).'</div>';
$table_adv_quiet .= '</div>';
$listIcons = gis_get_array_list_icons();
@ -753,31 +764,46 @@ if ($config['activate_gis']) {
// General display distribution.
$table_adv_options = $table_adv_secondary_groups.'<div class="secondary_groups_select" style="margin-bottom:30px;">
<div class="secondary_groups_list_left">
'.$table_adv_secondary_groups_left.'
$table_adv_options = '
<div class="secondary_groups_list">
'.$adv_secondary_groups_label.'
<div class="sg_source">
'.$adv_secondary_groups_left.'
</div>
<div class="secondary_group_arrows">
'.$adv_secondary_groups_arrows.'
</div>
<div class="sg_target">
'.$adv_secondary_groups_right.'
</div>
</div>
<div class="secondary_groups_select_arrows">
'.$table_adv_secondary_groups_arrows.'
</div>
<div class="secondary_groups_list_right">
'.$table_adv_secondary_groups_right.'
</div>
</div>
<div class="agent_options agent_options_adv">
<div class="agent_options_column_left" >'.$table_adv_parent.$table_adv_module_mode.$table_adv_cascade;
<div class="adv_right" >
'.$table_adv_parent.$table_adv_module_mode.$table_adv_cascade;
if ($new_agent) {
// If agent is new, show custom id as old style format.
$table_adv_options .= $custom_id_div;
}
$table_adv_options .= $table_adv_gis.'</div>
<div class="agent_options_column_right" >'.$table_adv_agent_icon.$table_adv_url.$table_adv_quiet.$table_adv_status.$table_adv_remote.$table_adv_safe.'</div>
</div>';
$table_adv_options .= '</div>';
$table_adv_options .= '
<div class="adv_left" >
'.$table_adv_gis.$table_adv_agent_icon.$table_adv_url.$table_adv_quiet.$table_adv_status.$table_adv_remote.$table_adv_safe.'
</div>';
echo '<div class="ui_toggle">';
ui_toggle($table_adv_options, __('Advanced options'), '', true, false, 'white_box white_box_opened');
ui_toggle(
$table_adv_options,
__('Advanced options'),
'',
'',
true,
false,
'white_box white_box_opened',
'no-border flex'
);
echo '</div>';
@ -831,7 +857,7 @@ foreach ($fields as $field) {
$custom_value = '';
}
$table->rowstyle[$i] = 'cursor: pointer;';
$table->rowstyle[$i] = 'cursor: pointer;user-select: none;';
if (!empty($custom_value)) {
$table->rowstyle[($i + 1)] = 'display: table-row;';
} else {
@ -895,14 +921,16 @@ foreach ($fields as $field) {
if (!empty($fields)) {
echo '<div class="ui_toggle">';
ui_toggle(
html_print_table($table, true),
__('Custom fields'),
'',
true,
false,
'white_box white_box_opened'
);
ui_toggle(
html_print_table($table, true),
__('Custom fields'),
'',
'',
true,
false,
'white_box white_box_opened',
'no-border'
);
echo '</div>';
}

View File

@ -322,7 +322,7 @@ if ($create_modules) {
} else if (preg_match('/ifAdminStatus/', $name_array[1])) {
$module_type = 2;
} else if (preg_match('/ifOperStatus/', $name_array[1])) {
$module_type = 18;
$module_type = 2;
} else {
$module_type = 4;
}
@ -684,4 +684,3 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
/* ]]> */
</script>

View File

@ -583,7 +583,13 @@ echo '<h3 id="message" class="error invisible"></h3>';
// TODO: Change to the ui_print_error system
echo '<form method="post" id="module_form">';
html_print_table($table_simple);
ui_toggle(
html_print_table($table_simple, true),
__('Base options'),
'',
'',
false
);
ui_toggle(
html_print_table($table_advanced, true),

View File

@ -162,7 +162,7 @@ $edit_module = (bool) get_parameter_get('edit_module');
$table_simple = new stdClass();
$table_simple->id = 'simple';
$table_simple->width = '100%';
$table_simple->class = 'databox';
$table_simple->class = 'no-class';
$table_simple->data = [];
$table_simple->style = [];
$table_simple->style[0] = 'font-weight: bold; width: 25%;';
@ -637,7 +637,7 @@ if ($disabledBecauseInPolicy) {
$table_advanced = new stdClass();
$table_advanced->id = 'advanced';
$table_advanced->width = '100%';
$table_advanced->class = 'databox filters';
$table_advanced->class = 'no-class';
$table_advanced->data = [];
$table_advanced->style = [];
$table_advanced->style[0] = $table_advanced->style[3] = $table_advanced->style[5] = 'font-weight: bold;';
@ -1066,7 +1066,7 @@ if (check_acl($config['id_user'], 0, 'PM')) {
$table_macros = new stdClass();
$table_macros->id = 'module_macros';
$table_macros->width = '100%';
$table_macros->class = 'databox filters';
$table_macros->class = 'no-class';
$table_macros->data = [];
$table_macros->style = [];
$table_macros->style[0] = 'font-weight: bold;';
@ -1107,7 +1107,7 @@ html_print_input_hidden('module_macro_count', $macro_count);
$table_new_relations = new stdClass();
$table_new_relations->id = 'module_new_relations';
$table_new_relations->width = '100%';
$table_new_relations->class = 'databox filters';
$table_new_relations->class = 'no-class';
$table_new_relations->data = [];
$table_new_relations->style = [];
$table_new_relations->style[0] = 'width: 10%; font-weight: bold;';

View File

@ -37,14 +37,10 @@ $table->head = [];
$table->data = [];
$table->size = [];
$table->size = [];
$table->size[0] = '5%';
$table->size[1] = '25%';
$table->size[2] = '5%';
$table->size[3] = '20%';
$table->style[0] = 'font-weight: bold; ';
$table->style[1] = 'font-weight: bold; ';
$table->style[2] = 'font-weight: bold; ';
$table->style[3] = 'font-weight: bold; ';
$table->style[0] = 'font-weight: bold;';
$table->style[1] = 'font-weight: bold;display: flex;align-items: baseline;';
$table->style[2] = 'font-weight: bold;';
$table->style[3] = 'font-weight: bold;';
// This is because if this view is reused after list alert view then
// styles in the previous view can affect this table.
@ -89,7 +85,7 @@ $table->data[0][1] = html_print_select(
true,
'',
($id_agente == 0),
'width: 250px;'
'min-width: 250px;margin-right: 0.5em;'
);
$table->data[0][1] .= ' <span id="latest_value" class="invisible">'.__('Latest value').': ';
$table->data[0][1] .= '<span id="value">&nbsp;</span></span>';
@ -117,7 +113,7 @@ $table->data[1][1] = html_print_select(
true,
'',
false,
'width: 250px;'
'min-width: 250px;'
);
$table->data[1][1] .= '<span id="advanced_action" class="advanced_actions invisible"><br>';
$table->data[1][1] .= __('Number of alerts match from').' ';
@ -127,9 +123,9 @@ $table->data[1][1] .= html_print_input_text('fires_max', '', '', 4, 10, true);
$table->data[1][1] .= '</span>';
if (check_acl($config['id_user'], 0, 'LM')) {
$table->data[1][1] .= '<a style="margin-left:5px;" href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
$table->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
$table->data[1][1] .= html_print_image('images/add.png', true);
$table->data[1][1] .= '<span style="margin-left:5px;vertical-align:middle;">'.__('Create Action').'</span>';
$table->data[1][1] .= '<span style="margin-left:0.5em;">'.__('Create Action').'</span>';
$table->data[1][1] .= '</a>';
}
@ -162,13 +158,13 @@ if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
if (check_acl($config['id_user'], 0, 'LM')) {
$table->data[2][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
$table->data[2][1] .= html_print_image('images/add.png', true);
$table->data[2][1] .= '<span style="margin-left:5px;vertical-align:middle;">'.__('Create Template').'</span>';
$table->data[2][1] .= '<span style="margin-left:0.5em;">'.__('Create Template').'</span>';
$table->data[2][1] .= '</a>';
}
$table->data[3][0] = __('Threshold');
$table->data[3][1] = html_print_input_text('module_action_threshold', '0', '', 5, 7, true);
$table->data[3][1] .= ' '.__('seconds');
$table->data[3][1] .= '<span style="margin-left:0.5em;">'.__('seconds').'</span>';
if (!isset($step)) {
echo '<form class="add_alert_form" method="post">';

View File

@ -438,11 +438,11 @@ if (! $id_agente) {
$table->style = [];
$table->style[0] = 'font-weight: bold;';
$table->head[0] = __('Agent').ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectAgentUp, $selectAgentDown);
$table->size[0] = '4%';
$table->size[1] = '8%';
$table->size[2] = '8%';
$table->size[3] = '4%';
$table->size[4] = '4%';
$table->headstyle[0] = 'width: 100%; min-width: 12em;';
$table->headstyle[1] = 'min-width: 15em;';
$table->headstyle[2] = 'min-width: 20em;';
$table->headstyle[3] = 'min-width: 1em;';
$table->headstyle[4] = 'min-width: 15em;';
/*
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
@ -450,16 +450,11 @@ if (! $id_agente) {
}*/
} else {
$table->head[0] = __('Module').ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown);
// Different sizes or the layout screws up
$table->size[0] = '0%';
$table->size[1] = '10%';
$table->size[2] = '30%';
/*
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->size[4] = '25%';
} */
$table->size[3] = '1%';
$table->size[4] = '1%';
$table->headstyle[0] = 'width: 100%; min-width: 15em;';
$table->headstyle[1] = 'min-width: 15em;';
$table->headstyle[2] = 'min-width: 20em;';
$table->headstyle[3] = 'min-width: 1em;';
$table->headstyle[4] = 'min-width: 15em;';
}
$table->head[1] = __('Template').ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown);

View File

@ -60,96 +60,12 @@ $fields_selected = explode(',', $config['event_fields']);
$result_selected = [];
// show list of fields selected.
// Show list of fields selected.
if ($fields_selected[0] != '') {
foreach ($fields_selected as $field_selected) {
switch ($field_selected) {
case 'id_evento':
$result = __('Event Id');
break;
case 'evento':
$result = __('Event Name');
break;
case 'id_agente':
$result = __('Agent Name');
break;
case 'id_usuario':
$result = __('User');
break;
case 'id_grupo':
$result = __('Group');
break;
case 'estado':
$result = __('Status');
break;
case 'timestamp':
$result = __('Timestamp');
break;
case 'event_type':
$result = __('Event Type');
break;
case 'id_agentmodule':
$result = __('Module Name');
break;
case 'id_alert_am':
$result = __('Alert');
break;
case 'criticity':
$result = __('Severity');
break;
case 'user_comment':
$result = __('Comment');
break;
case 'tags':
$result = __('Tags');
break;
case 'source':
$result = __('Source');
break;
case 'id_extra':
$result = __('Extra Id');
break;
case 'owner_user':
$result = __('Owner');
break;
case 'ack_utimestamp':
$result = __('ACK Timestamp');
break;
case 'instructions':
$result = __('Instructions');
break;
case 'server_name':
$result = __('Server Name');
break;
case 'data':
$result = __('Data');
break;
case 'module_status':
$result = __('Module Status');
break;
}
$result_selected[$field_selected] = $result;
$result_selected[$field_selected] = events_get_column_name(
$field_selected
);
}
}
@ -177,7 +93,8 @@ $fields_available = [];
$fields_available['id_evento'] = __('Event Id');
$fields_available['evento'] = __('Event Name');
$fields_available['id_agente'] = __('Agent Name');
$fields_available['id_agente'] = __('Agent ID');
$fields_available['agent_name'] = __('Agent Name');
$fields_available['id_usuario'] = __('User');
$fields_available['id_grupo'] = __('Group');
$fields_available['estado'] = __('Status');
@ -197,12 +114,10 @@ $fields_available['server_name'] = __('Server Name');
$fields_available['data'] = __('Data');
$fields_available['module_status'] = __('Module Status');
// remove fields already selected
// Remove fields already selected.
foreach ($fields_available as $key => $available) {
foreach ($result_selected as $selected) {
if ($selected == $available) {
unset($fields_available[$key]);
}
if (isset($result_selected[$key])) {
unset($fields_available[$key]);
}
}

View File

@ -31,6 +31,7 @@ require_once $config['homedir'].'/include/functions_users.php';
if (is_ajax()) {
$get_agents = (bool) get_parameter('get_agents');
$recursion = (int) get_parameter('recursion');
$disabled_modules = (int) get_parameter('disabled_modules');
if ($get_agents) {
$id_group = (int) get_parameter('id_group');
@ -44,12 +45,18 @@ if (is_ajax()) {
$groups = [$id_group];
}
if ($disabled_modules == 0) {
$filter['tagente_modulo.disabled'] = '<> 1';
} else {
unset($filter['tagente_modulo.disabled']);
}
$agents_alerts = [];
foreach ($groups as $group) {
$agents_alerts_one_group = alerts_get_agents_with_alert_template(
$id_alert_template,
$group,
false,
$filter,
[
'tagente.alias',
'tagente.id_agente',
@ -253,6 +260,11 @@ $table->data[1][1] = html_print_select_groups(
'',
$id_alert_template == 0
);
$table->data[0][2] = __('Show alerts on disabled modules');
$table->data[0][3] = html_print_checkbox('disabled_modules', 1, false, true, false);
$table->data[1][2] = __('Group recursion');
$table->data[1][3] = html_print_checkbox('recursion', 1, false, true, false);
@ -360,6 +372,7 @@ $(document).ready (function () {
"get_agents" : 1,
"id_group" : this.value,
"recursion" : $("#checkbox-recursion").is(":checked") ? 1 : 0,
"disabled_modules" : $("#checkbox-disabled_modules").is(":checked") ? 1 : 0,
"id_alert_template" : $("#id_alert_template").val(),
// Add a key prefix to avoid auto sorting in js object conversion
"keys_prefix" : "_"
@ -387,6 +400,10 @@ $(document).ready (function () {
$("#modules_selection_mode").change (function() {
$("#id_agents").trigger('change');
});
$("#checkbox-disabled_modules").click(function () {
$("#id_group").trigger("change");
});
});
/* ]]> */
</script>

View File

@ -418,9 +418,11 @@ if (is_array($config['extensions'])) {
$sub['godmode/extensions']['type'] = 'direct';
$sub['godmode/extensions']['subtype'] = 'nolink';
$submenu = array_merge($menu_godmode['gextensions']['sub'], $sub);
if ($menu_godmode['gextensions']['sub'] != null) {
$menu_godmode['gextensions']['sub'] = $submenu;
if (is_array($menu_godmode['gextensions']['sub'])) {
$submenu = array_merge($menu_godmode['gextensions']['sub'], $sub);
if ($menu_godmode['gextensions']['sub'] != null) {
$menu_godmode['gextensions']['sub'] = $submenu;
}
}
}

View File

@ -36,6 +36,9 @@ require_once $config['homedir'].'/include/functions_component_groups.php';
if (defined('METACONSOLE')) {
components_meta_print_header();
$sec = 'advanced';
$id_modulo = (int) get_parameter('id_component_type');
$new_component = (bool) get_parameter('new_component');
} else {
/*
Hello there! :)

View File

@ -414,7 +414,7 @@ if ($edit_container) {
echo "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>";
echo '<tr>';
echo '<td>';
echo ui_toggle($single_table, 'Simple module graph', '', true, true);
echo ui_toggle($single_table, 'Simple module graph', '', '', true);
echo '</td>';
echo '</tr>';
echo '</table>';
@ -466,7 +466,7 @@ if ($edit_container) {
echo "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>";
echo '<tr>';
echo '<td>';
echo ui_toggle(html_print_table($table, true), 'Custom graph', '', true, true);
echo ui_toggle(html_print_table($table, true), 'Custom graph', '', '', true);
echo '</td>';
echo '</tr>';
echo '</table>';
@ -561,7 +561,7 @@ if ($edit_container) {
echo "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>";
echo '<tr>';
echo '<td>';
echo ui_toggle(html_print_table($table, true), 'Dynamic rules for simple module graph', '', true, true);
echo ui_toggle(html_print_table($table, true), 'Dynamic rules for simple module graph', '', '', true);
echo '</td>';
echo '</tr>';
echo '</table>';

View File

@ -356,9 +356,35 @@ echo "<td style='vertical-align: top;'>".__('Agents').'</td>';
echo '<td></td>';
echo "<td style='vertical-align: top;'>".__('Modules').'</td>';
echo '</tr><tr>';
echo '<td>'.html_print_select(agents_get_group_agents(), 'id_agents[]', 0, false, '', '', true, true, true, '', false, '').'</td>';
echo "<td style='vertical-align: center; text-align: center;'>".html_print_image('images/darrowright.png', true).'</td>';
echo '<td>'.html_print_select([], 'module[]', 0, false, '', 0, true, true, true, '', false, '').'</td>';
echo '<td style="width: 50%;">'.html_print_select(
agents_get_group_agents(),
'id_agents[]',
0,
false,
'',
'',
true,
true,
true,
'w100p',
false,
''
).'</td>';
echo "<td style='width: 3em;vertical-align: center; text-align: center;'>".html_print_image('images/darrowright.png', true).'</td>';
echo '<td style="width: 50%;">'.html_print_select(
[],
'module[]',
0,
false,
'',
0,
true,
true,
true,
'w100p',
false,
''
).'</td>';
echo '</tr><tr>';
echo "<td colspan='3'>";
echo "<table cellpadding='4'><tr>";

View File

@ -221,7 +221,7 @@ switch ($action) {
$server_name = $item['server_name'];
// Metaconsole db connection.
if ($meta && $server_name != '') {
if ($meta && !empty($server_name)) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
continue;
@ -547,8 +547,43 @@ switch ($action) {
break;
case 'event_report_agent':
case 'event_report_group':
$description = $item['description'];
$period = $item['period'];
$group = $item['id_group'];
$recursion = $item['recursion'];
$idAgent = $item['id_agent'];
$idAgentModule = $item['id_agent_module'];
$show_summary_group = $style['show_summary_group'];
$filter_event_severity = json_decode($style['filter_event_severity'], true);
$filter_event_status = json_decode($style['filter_event_status'], true);
$filter_event_type = json_decode($style['filter_event_type'], true);
$event_graph_by_user_validator = $style['event_graph_by_user_validator'];
$event_graph_by_criticity = $style['event_graph_by_criticity'];
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
$include_extended_events = $item['show_extended_events'];
$filter_search = $style['event_filter_search'];
break;
case 'event_report_group':
$description = $item['description'];
$period = $item['period'];
$group = $item['id_group'];
$recursion = $item['recursion'];
$event_graph_by_agent = $style['event_graph_by_agent'];
$event_graph_by_user_validator = $style['event_graph_by_user_validator'];
$event_graph_by_criticity = $style['event_graph_by_criticity'];
$event_graph_validated_vs_unvalidated = $style['event_graph_validated_vs_unvalidated'];
$filter_search = $style['event_filter_search'];
$include_extended_events = $item['show_extended_events'];
break;
@ -2805,7 +2840,7 @@ function print_SLA_list($width, $action, $idItem=null)
foreach ($itemsSLA as $item) {
$server_name = $item['server_name'];
// Metaconsole db connection.
if ($meta && $server_name != '') {
if ($meta && !empty($server_name)) {
$connection = metaconsole_get_connection(
$server_name
);
@ -3133,7 +3168,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
foreach ($itemsGeneral as $item) {
$server_name = $item['server_name'];
// Metaconsole db connection.
if ($meta && $server_name != '') {
if ($meta && !empty($server_name)) {
$connection = metaconsole_get_connection(
$server_name
);
@ -3491,6 +3526,7 @@ $(document).ready (function () {
$("#submit-create_item").click(function () {
var type = $('#type').val();
var name = $('#text-name').val();
switch (type){
case 'alert_report_module':
case 'alert_report_agent':
@ -3521,6 +3557,13 @@ $(document).ready (function () {
default:
break;
}
if($('#text-name').val() == ''){
alert( <?php echo "'".__('Please insert a name')."'"; ?> );
return false;
}
});
$("#submit-edit_item").click(function () {

View File

@ -774,31 +774,28 @@ switch ($action) {
$table->head[1] = __('Description');
$table->head[2] = __('HTML');
$table->head[3] = __('XML');
$table->size[0] = '20%';
$table->size[1] = '30%';
$table->size[0] = '60%';
$table->size[1] = '20%';
$table->size[2] = '2%';
$table->headstyle[2] = 'min-width: 35px;';
$table->headstyle[2] = 'min-width: 35px;text-align: center;';
$table->size[3] = '2%';
$table->headstyle[3] = 'min-width: 35px;';
$table->headstyle[3] = 'min-width: 35px;text-align: center;';
$table->size[4] = '2%';
$table->headstyle[4] = 'min-width: 35px;';
$table->size[5] = '2%';
$table->headstyle[5] = 'min-width: 35px;';
$table->size[6] = '2%';
$table->headstyle[6] = 'min-width: 35px;';
$table->size[7] = '5%';
$table->headstyle['csv'] = 'min-width: 65px;';
$table->style[7] = 'text-align: center;';
$table->headstyle[9] = 'min-width: 100px;';
$table->style[9] = 'text-align: center;';
$table->headstyle[4] = 'min-width: 35px;text-align: center;';
$next = 4;
// Calculate dinamically the number of the column.
if (enterprise_hook('load_custom_reporting_1') !== ENTERPRISE_NOT_HOOK) {
if (enterprise_hook('load_custom_reporting_1', [$table]) !== ENTERPRISE_NOT_HOOK) {
$next = 7;
}
$table->size[$next] = '2%';
$table->style[$next] = 'text-align: center;';
$table->headstyle[($next + 2)] = 'min-width: 100px;';
$table->style[($next + 2)] = 'text-align: center;';
// Admin options only for RM flag.
if (check_acl($config['id_user'], 0, 'RM')) {
$table->head[$next] = __('Private');
@ -1348,6 +1345,8 @@ switch ($action) {
$values['description'] = get_parameter('description');
$values['type'] = get_parameter('type', null);
$values['recursion'] = get_parameter('recursion', null);
$values['show_extended_events'] = get_parameter('include_extended_events', null);
$label = get_parameter('label', '');
// Add macros name.
@ -1903,8 +1902,8 @@ switch ($action) {
$style['event_graph_by_user_validator'] = $event_graph_by_user_validator;
$style['event_graph_by_criticity'] = $event_graph_by_criticity;
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
$style['event_filter_search'] = $event_filter_search;
if ($label != '') {
$style['label'] = $label;
} else {
@ -2010,6 +2009,7 @@ switch ($action) {
);
$name_it = (string) get_parameter('name');
$values['recursion'] = get_parameter('recursion', null);
$values['show_extended_events'] = get_parameter('include_extended_events', null);
$values['name'] = reporting_label_macro(
$items_label,
$name_it
@ -2421,6 +2421,7 @@ switch ($action) {
case 'event_report_agent':
case 'event_report_group':
case 'event_report_module':
$show_summary_group = get_parameter(
'show_summary_group',
0
@ -2476,22 +2477,11 @@ switch ($action) {
$style['event_graph_by_user_validator'] = $event_graph_by_user_validator;
$style['event_graph_by_criticity'] = $event_graph_by_criticity;
$style['event_graph_validated_vs_unvalidated'] = $event_graph_validated_vs_unvalidated;
switch ($values['type']) {
case 'event_report_group':
case 'event_report_agent':
$style['event_filter_search'] = $event_filter_search;
if ($label != '') {
$style['label'] = $label;
} else {
$style['label'] = '';
}
break;
default:
// Default.
break;
$style['event_filter_search'] = $event_filter_search;
if ($label != '') {
$style['label'] = $label;
} else {
$style['label'] = '';
}
break;

View File

@ -25,6 +25,8 @@ if (empty($visualConsole)) {
exit;
}
ui_require_css_file('visual_maps');
// ACL for the existing visual console
// if (!isset($vconsole_read))
// $vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR");
@ -170,6 +172,7 @@ echo "<div id='delete_in_progress_dialog' style='display: none; text-align: cent
// CSS
ui_require_css_file('color-picker', 'include/styles/js/');
ui_require_css_file('jquery-ui.min', 'include/styles/js/');
ui_require_jquery_file('jquery-ui_custom');
// Javascript
ui_require_jquery_file('colorpicker');

View File

@ -51,11 +51,11 @@ $table->style[0] = 'font-weight: bold';
$table->align = [];
$table->align[1] = 'center';
$table->align[3] = 'center';
$table->align[8] = 'center';
$table->align[8] = 'right';
$table->headstyle[1] = 'text-align:center';
$table->headstyle[3] = 'text-align:center';
$table->headstyle[8] = 'text-align:center';
$table->headstyle[8] = 'text-align:right;width: 120px;';
// $table->title = __('Tactical server information');
$table->titleclass = 'tabletitle';
@ -234,7 +234,8 @@ if ($tiny) {
ui_toggle(
html_print_table($table, true),
__('Tactical server information'),
false,
'',
'',
$hidden_toggle
);
} else {

View File

@ -135,7 +135,9 @@ $table->data[9][0] = '<strong>'.__('Licensed to').'</strong>';
$table->data[9][1] = html_print_input_text('licensed_to', $license['licensed_to'], '', 64, 255, true, true);
html_print_table($table);
if (enterprise_installed()) {
// If DESTDIR is defined the enterprise license is expired.
if (enterprise_installed() || defined('DESTDIR')) {
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('update_settings', 1);
html_print_submit_button(__('Validate'), 'update_button', false, 'class="sub upd"');

View File

@ -1275,7 +1275,7 @@ if ($create_alert || $update_alert) {
$table->align[7] = 'left';
$table->head[8] = __('Action');
$table->size[8] = '90px';
$table->size[8] = '120px';
$table->align[8] = 'left';
$table->head[9] = html_print_checkbox('all_delete_box', '1', false, true);

View File

@ -34,7 +34,7 @@
float: none;
}
#drop_file a {
background-color: #80ba27;
background-color: #82b92e;
border-radius: 2px;
color: #ffffff;
cursor: pointer;
@ -101,7 +101,7 @@
width: 15px;
}
.fileupload_form ul li div {
display: block !important;
display: block;
}
.fileupload_form ul li.working span {
background-position: 0 -12px;
@ -183,39 +183,22 @@ div#box_online * {
.update_text a {
font-size: 11pt;
color: #82b92e !important;
color: #82b92e;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
float: left !important;
float: left;
padding-left: 19px;
padding-bottom: 5px;
}
.ui-dialog-buttonset > button.ui-button.ui-corner-all.ui-widget {
background-color: #cecece !important;
border: none !important;
border-radius: 2px !important;
text-transform: uppercase !important;
font-weight: bold !important;
}
.ui-dialog-buttonset > button.success_button.ui-button.ui-corner-all.ui-widget,
.update_manager_button {
background-color: #82b92e !important;
color: #fff !important;
border-radius: 2px !important;
text-transform: uppercase !important;
font-weight: bold !important;
}
a.update_manager_button {
padding: 10px 12px;
margin-top: 10px;
display: inline-flex;
align-items: center;
font-size: 16px !important;
border-radius: 4px !important;
font-size: 16px;
border-radius: 4px;
text-decoration: none;
font-family: "Open Sans", sans-serif;
}
@ -231,7 +214,7 @@ a.update_manager_button:after {
.ui-draggable,
.ui-draggable .ui-dialog-titlebar {
cursor: default !important;
cursor: default;
}
#box_online #pkg_version {
@ -242,10 +225,10 @@ a.update_manager_button:after {
/* METACONSOLE */
.box_online_meta {
background: none !important;
min-height: 400px !important;
background: none;
min-height: 400px;
text-align: center;
border: none !important;
border: none;
}
div#box_online.box_online_meta * {
@ -277,7 +260,7 @@ div#box_online.box_online_meta * {
}
.update_manager_warning p {
font-size: 10pt !important;
font-size: 10pt;
}
.update_manager_warning img {
@ -287,8 +270,8 @@ div#box_online.box_online_meta * {
a.update_manager_button_open {
padding: 5px 10px;
font-size: 16px !important;
border-radius: 4px !important;
font-size: 16px;
border-radius: 4px;
text-decoration: none;
border: 1px solid #82b92e;
color: #82b92e;

View File

@ -297,7 +297,14 @@ if (defined('METACONSOLE')) {
$form_filter = "<form method='post'>";
$form_filter .= html_print_table($table, true);
$form_filter .= '</form>';
ui_toggle($form_filter, __('Users control filter'), __('Toggle filter(s)'), !$search);
ui_toggle(
$form_filter,
__('Users control filter'),
__('Toggle filter(s)'),
'',
'',
!$search
);
}
// Urls to sort the table.

View File

@ -651,20 +651,24 @@ class DiscoveryTaskList extends Wizard
array_push($table->data, $data);
}
echo '<h2>'.__('Server tasks').'</h2>';
if (empty($table->data)) {
echo '<div class="nf">'.__('Server').' '.$server_name.' '.__('has no discovery tasks assigned').'</div>';
return false;
$content = '<div class="nf">'.__('Server').' '.$server_name.' '.__('has no discovery tasks assigned').'</div>';
$return = false;
} else {
html_print_table($table);
$content = html_print_table($table, true);
$return = true;
}
ui_toggle($content, __('Server Tasks'), '', '', false);
// Div neccesary for modal map task.
echo '<div id="map_task" style="display:none"></div>';
unset($table);
ui_require_javascript_file('pandora_taskList');
return $return;
}
return true;

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -26,6 +26,9 @@
* ============================================================================
*/
// Begin.
global $config;
require_once 'include/functions_events.php';
require_once 'include/functions_agents.php';
require_once 'include/functions_ui.php';
@ -35,6 +38,21 @@ require_once 'include/functions.php';
enterprise_include_once('meta/include/functions_events_meta.php');
enterprise_include_once('include/functions_metaconsole.php');
// Check access.
check_login();
if (! check_acl($config['id_user'], 0, 'ER')
&& ! check_acl($config['id_user'], 0, 'EW')
&& ! check_acl($config['id_user'], 0, 'EM')
) {
db_pandora_audit(
'ACL Violation',
'Trying to access event viewer'
);
include 'general/noaccess.php';
return;
}
$get_events_details = (bool) get_parameter('get_events_details');
$get_list_events_agents = (bool) get_parameter('get_list_events_agents');
$get_extended_event = (bool) get_parameter('get_extended_event');
@ -55,6 +73,680 @@ $total_events = (bool) get_parameter('total_events');
$total_event_graph = (bool) get_parameter('total_event_graph');
$graphic_event_group = (bool) get_parameter('graphic_event_group');
$get_table_response_command = (bool) get_parameter('get_table_response_command');
$save_filter_modal = get_parameter('save_filter_modal', 0);
$load_filter_modal = get_parameter('load_filter_modal', 0);
$save_filter = get_parameter('save_filter', 0);
$get_filter_values = get_parameter('get_filter_values', 0);
$update_event_filter = get_parameter('update_event_filter', 0);
$save_event_filter = get_parameter('save_event_filter', 0);
$in_process_event = get_parameter('in_process_event', 0);
$validate_event = get_parameter('validate_event', 0);
$delete_event = get_parameter('delete_event', 0);
// Delete event (filtered or not).
if ($delete_event) {
$filter = get_parameter('filter', []);
$id_evento = get_parameter('id_evento', 0);
$event_rep = get_parameter('event_rep', 0);
if ($event_rep === 0) {
// Disable group by when there're result is unique.
$filter['group_rep'] = 0;
}
// Check acl.
if (! check_acl($config['id_user'], 0, 'EM')) {
echo 'unauthorized';
return;
}
$r = events_delete($id_evento, $filter);
if ($r === false) {
echo 'Failed';
} else {
echo $r;
}
return;
}
// Validates an event (filtered or not).
if ($validate_event) {
$filter = get_parameter('filter', []);
$id_evento = get_parameter('id_evento', 0);
$event_rep = get_parameter('event_rep', 0);
if ($event_rep === 0) {
// Disable group by when there're result is unique.
$filter['group_rep'] = 0;
}
// Check acl.
if (! check_acl($config['id_user'], 0, 'EW')) {
echo 'unauthorized';
return;
}
$r = events_update_status($id_evento, EVENT_VALIDATE, $filter);
if ($r === false) {
echo 'Failed';
} else {
echo $r;
}
return;
}
// Sets status to in progress.
if ($in_process_event) {
$filter = get_parameter('filter', []);
$id_evento = get_parameter('id_evento', 0);
$event_rep = get_parameter('event_rep', 0);
if ($event_rep === 0) {
// Disable group by when there're result is unique.
$filter['group_rep'] = 0;
}
// Check acl.
if (! check_acl($config['id_user'], 0, 'EW')) {
echo 'unauthorized';
return;
}
$r = events_update_status($id_evento, EVENT_PROCESS, $filter);
if ($r === false) {
echo 'Failed';
} else {
echo $r;
}
return;
}
// Saves an event filter.
if ($save_event_filter) {
$values = [];
$values['id_name'] = get_parameter('id_name');
$values['id_group'] = get_parameter('id_group');
$values['event_type'] = get_parameter('event_type');
$values['severity'] = get_parameter('severity');
$values['status'] = get_parameter('status');
$values['search'] = get_parameter('search');
$values['text_agent'] = get_parameter('text_agent');
$values['id_agent'] = get_parameter('id_agent');
$values['id_agent_module'] = get_parameter('id_agent_module');
$values['pagination'] = get_parameter('pagination');
$values['event_view_hr'] = get_parameter('event_view_hr');
$values['id_user_ack'] = get_parameter('id_user_ack');
$values['group_rep'] = get_parameter('group_rep');
$values['tag_with'] = get_parameter('tag_with', io_json_mb_encode([]));
$values['tag_without'] = get_parameter(
'tag_without',
io_json_mb_encode([])
);
$values['filter_only_alert'] = get_parameter('filter_only_alert');
$values['id_group_filter'] = get_parameter('id_group_filter');
$values['date_from'] = get_parameter('date_from');
$values['date_to'] = get_parameter('date_to');
$values['source'] = get_parameter('source');
$values['id_extra'] = get_parameter('id_extra');
$values['user_comment'] = get_parameter('user_comment');
$exists = (bool) db_get_value_filter(
'id_filter',
'tevent_filter',
$values
);
if ($exists) {
echo 'duplicate';
} else {
$result = db_process_sql_insert('tevent_filter', $values);
if ($result === false) {
echo 'error';
} else {
echo $result;
}
}
}
if ($update_event_filter) {
$values = [];
$id = get_parameter('id');
$values['id_group'] = get_parameter('id_group');
$values['event_type'] = get_parameter('event_type');
$values['severity'] = get_parameter('severity');
$values['status'] = get_parameter('status');
$values['search'] = get_parameter('search');
$values['text_agent'] = get_parameter('text_agent');
$values['id_agent'] = get_parameter('id_agent');
$values['id_agent_module'] = get_parameter('id_agent_module');
$values['pagination'] = get_parameter('pagination');
$values['event_view_hr'] = get_parameter('event_view_hr');
$values['id_user_ack'] = get_parameter('id_user_ack');
$values['group_rep'] = get_parameter('group_rep');
$values['tag_with'] = get_parameter('tag_with', io_json_mb_encode([]));
$values['tag_without'] = get_parameter(
'tag_without',
io_json_mb_encode([])
);
$values['filter_only_alert'] = get_parameter('filter_only_alert');
$values['id_group_filter'] = get_parameter('id_group_filter');
$values['date_from'] = get_parameter('date_from');
$values['date_to'] = get_parameter('date_to');
$values['source'] = get_parameter('source');
$values['id_extra'] = get_parameter('id_extra');
$values['user_comment'] = get_parameter('user_comment');
if (io_safe_output($values['tag_with']) == '["0"]') {
$values['tag_with'] = '[]';
}
if (io_safe_output($values['tag_without']) == '["0"]') {
$values['tag_without'] = '[]';
}
$result = db_process_sql_update(
'tevent_filter',
$values,
['id_filter' => $id]
);
if ($result === false) {
echo 'error';
} else {
echo 'ok';
}
}
// Get db values of a single filter.
if ($get_filter_values) {
$id_filter = get_parameter('id');
$event_filter = events_get_event_filter($id_filter);
$event_filter['search'] = io_safe_output($event_filter['search']);
$event_filter['id_name'] = io_safe_output($event_filter['id_name']);
$event_filter['tag_with'] = base64_encode(
io_safe_output($event_filter['tag_with'])
);
$event_filter['tag_without'] = base64_encode(
io_safe_output($event_filter['tag_without'])
);
echo io_json_mb_encode($event_filter);
}
if ($load_filter_modal) {
$current = get_parameter('current_filter', '');
$filters = events_get_event_filter_select();
$user_groups_array = users_get_groups_for_select(
$config['id_user'],
$access,
true,
true,
false
);
echo '<div id="load-filter-select" class="load-filter-modal">';
$table = new StdClass;
$table->id = 'load_filter_form';
$table->width = '100%';
$table->cellspacing = 4;
$table->cellpadding = 4;
$table->class = 'databox';
if (is_metaconsole()) {
$table->cellspacing = 0;
$table->cellpadding = 0;
$table->class = 'databox filters';
}
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
if (!is_metaconsole()) {
$table->style[0] = 'width: 50%; width:50%;';
}
$data = [];
$table->rowid[3] = 'update_filter_row1';
$data[0] = __('Load filter').$jump;
$data[0] .= html_print_select(
$filters,
'filter_id',
$current,
'',
__('None'),
0,
true
);
$data[1] = html_print_submit_button(
__('Load filter'),
'load_filter',
false,
'class="sub upd" onclick="load_form_filter();"',
true
);
$table->data[] = $data;
$table->rowclass[] = '';
html_print_table($table);
echo '</div>';
?>
<script type="text/javascript">
function show_filter() {
$("#load-filter-select").dialog({
resizable: true,
draggable: true,
modal: false,
closeOnEscape: true
});
}
function load_form_filter() {
jQuery.post (
"<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
{
"page" : "include/ajax/events",
"get_filter_values" : 1,
"id" : $('#filter_id').val()
},
function (data) {
jQuery.each (data, function (i, val) {
if (i == 'id_name')
$("#hidden-id_name").val(val);
if (i == 'id_group')
$("#id_group").val(val);
if (i == 'event_type')
$("#event_type").val(val);
if (i == 'severity')
$("#severity").val(val);
if (i == 'status')
$("#status").val(val);
if (i == 'search')
$("#text-search").val(val);
if (i == 'text_agent')
$("#text_id_agent").val(val);
if (i == 'id_agent')
$('input:hidden[name=id_agent]').val(val);
if (i == 'id_agent_module')
$('input:hidden[name=module_search_hidden]').val(val);
if (i == 'pagination')
$("#pagination").val(val);
if (i == 'event_view_hr')
$("#text-event_view_hr").val(val);
if (i == 'id_user_ack')
$("#id_user_ack").val(val);
if (i == 'group_rep')
$("#group_rep").val(val);
if (i == 'tag_with')
$("#hidden-tag_with").val(val);
if (i == 'tag_without')
$("#hidden-tag_without").val(val);
if (i == 'filter_only_alert')
$("#filter_only_alert").val(val);
if (i == 'id_group_filter')
$("#id_group_filter").val(val);
if (i == 'source')
$("#text-source").val(val);
if (i == 'id_extra')
$("#text-id_extra").val(val);
if (i == 'user_comment')
$("#text-user_comment").val(val);
});
reorder_tags_inputs();
// Update the info with the loaded filter
$('#filterid').val($('#filter_id').val());
$('#filter_loaded_span').html($('#filter_loaded_text').html() + ': ' + $("#hidden-id_name").val());
},
"json"
);
// Close dialog.
$("#load-filter-select").dialog('close');
// Update indicator.
$("#current_filter").text($('#filter_id option:selected').text());
// Search.
dt_events.draw(false);
}
$(document).ready (function() {
show_filter();
})
</script>
<?php
return;
}
if ($save_filter_modal) {
echo '<div id="save-filter-select">';
if (check_acl($config['id_user'], 0, 'EW')
|| check_acl($config['id_user'], 0, 'EM')
) {
echo '<div id="#info_box"></div>';
$table = new StdClass;
$table->id = 'save_filter_form';
$table->width = '100%';
$table->cellspacing = 4;
$table->cellpadding = 4;
$table->class = 'databox';
if (is_metaconsole()) {
$table->class = 'databox filters';
$table->cellspacing = 0;
$table->cellpadding = 0;
}
$table->styleTable = 'font-weight: bold; text-align:left;';
if (!is_metaconsole()) {
$table->style[0] = 'width: 50%; width:50%;';
}
$data = [];
$table->rowid[0] = 'update_save_selector';
$data[0] = html_print_radio_button(
'filter_mode',
'new',
'',
true,
true
).__('New filter').'';
$data[1] = html_print_radio_button(
'filter_mode',
'update',
'',
false,
true
).__('Update filter').'';
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$table->rowid[1] = 'save_filter_row1';
$data[0] = __('Filter name').$jump;
$data[0] .= html_print_input_text('id_name', '', '', 15, 255, true);
if (is_metaconsole()) {
$data[1] = __('Save in Group').$jump;
} else {
$data[1] = __('Filter group').$jump;
}
$user_groups_array = users_get_groups_for_select(
$config['id_user'],
'EW',
users_can_manage_group_all(),
true
);
$data[1] .= html_print_select(
$user_groups_array,
'id_group_filter',
$id_group_filter,
'',
'',
0,
true,
false,
false,
'w130'
);
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$table->rowid[2] = 'save_filter_row2';
$table->data[] = $data;
$table->rowclass[] = '';
$data = [];
$table->rowid[3] = 'update_filter_row1';
$data[0] = __('Overwrite filter').$jump;
// Fix : Only admin user can see filters of group ALL for update.
$_filters_update = events_get_event_filter_select(false);
$data[0] .= html_print_select(
$_filters_update,
'overwrite_filter',
'',
'',
'',
0,
true
);
$data[1] = html_print_submit_button(
__('Update filter'),
'update_filter',
false,
'class="sub upd" onclick="save_update_filter();"',
true
);
$table->data[] = $data;
$table->rowclass[] = '';
html_print_table($table);
echo '<div>';
echo html_print_submit_button(
__('Save filter'),
'save_filter',
false,
'class="sub upd" style="float:right;" onclick="save_new_filter();"',
true
);
echo '</div>';
} else {
include 'general/noaccess.php';
}
echo '</div>';
?>
<script type="text/javascript">
function show_save_filter() {
$('#save_filter_row1').show();
$('#save_filter_row2').show();
$('#update_filter_row1').hide();
// Filter save mode selector
$("[name='filter_mode']").click(function() {
if ($(this).val() == 'new') {
$('#save_filter_row1').show();
$('#save_filter_row2').show();
$('#submit-save_filter').show();
$('#update_filter_row1').hide();
}
else {
$('#save_filter_row1').hide();
$('#save_filter_row2').hide();
$('#update_filter_row1').show();
$('#submit-save_filter').hide();
}
});
$("#save-filter-select").dialog({
resizable: true,
draggable: true,
modal: false,
closeOnEscape: true
});
}
function save_new_filter() {
// If the filter name is blank show error
if ($('#text-id_name').val() == '') {
$('#show_filter_error').html("<h3 class='error'><?php echo __('Filter name cannot be left blank'); ?></h3>");
// Close dialog
$('.ui-dialog-titlebar-close').trigger('click');
return false;
}
var id_filter_save;
jQuery.post ("<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
{
"page" : "operation/events/events_list",
"save_event_filter" : 1,
"id_name" : $("#text-id_name").val(),
"id_group" : $("select#id_group").val(),
"event_type" : $("#event_type").val(),
"severity" : $("#severity").val(),
"status" : $("#status").val(),
"search" : $("#text-search").val(),
"text_agent" : $("#text_id_agent").val(),
"id_agent" : $('input:hidden[name=id_agent]').val(),
"id_agent_module" : $('input:hidden[name=module_search_hidden]').val(),
"pagination" : $("#pagination").val(),
"event_view_hr" : $("#text-event_view_hr").val(),
"id_user_ack" : $("#id_user_ack").val(),
"group_rep" : $("#group_rep").val(),
"tag_with": Base64.decode($("#hidden-tag_with").val()),
"tag_without": Base64.decode($("#hidden-tag_without").val()),
"filter_only_alert" : $("#filter_only_alert").val(),
"id_group_filter": $("#id_group_filter").val(),
"date_from": $("#text-date_from").val(),
"date_to": $("#text-date_to").val(),
"source": $("#text-source").val(),
"id_extra": $("#text-id_extra").val(),
"user_comment": $("#text-user_comment").val()
},
function (data) {
$("#info_box").hide();
if (data == 'error') {
$("#info_box").filter(function(i, item) {
if ($(item).data('type_info_box') == "error_create_filter") {
return true;
}
else
return false;
}).show();
}
else if (data == 'duplicate') {
$("#info_box").filter(function(i, item) {
if ($(item).data('type_info_box') == "duplicate_create_filter") {
return true;
}
else
return false;
}).show();
}
else {
id_filter_save = data;
$("#info_box").filter(function(i, item) {
if ($(item).data('type_info_box') == "success_create_filter") {
return true;
}
else
return false;
}).show();
}
// Close dialog.
$("#save-filter-select").dialog('close');
}
);
}
// This updates an event filter
function save_update_filter() {
var id_filter_update = $("#overwrite_filter").val();
var name_filter_update = $("#overwrite_filter option[value='"+id_filter_update+"']").text();
jQuery.post ("<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
{"page" : "operation/events/events_list",
"update_event_filter" : 1,
"id" : $("#overwrite_filter").val(),
"id_group" : $("select#id_group").val(),
"event_type" : $("#event_type").val(),
"severity" : $("#severity").val(),
"status" : $("#status").val(),
"search" : $("#text-search").val(),
"text_agent" : $("#text_id_agent").val(),
"id_agent" : $('input:hidden[name=id_agent]').val(),
"id_agent_module" : $('input:hidden[name=module_search_hidden]').val(),
"pagination" : $("#pagination").val(),
"event_view_hr" : $("#text-event_view_hr").val(),
"id_user_ack" : $("#id_user_ack").val(),
"group_rep" : $("#group_rep").val(),
"tag_with" : Base64.decode($("#hidden-tag_with").val()),
"tag_without" : Base64.decode($("#hidden-tag_without").val()),
"filter_only_alert" : $("#filter_only_alert").val(),
"id_group_filter": $("#id_group_filter").val(),
"date_from": $("#text-date_from").val(),
"date_to": $("#text-date_to").val(),
"source": $("#text-source").val(),
"id_extra": $("#text-id_extra").val(),
"user_comment": $("#text-user_comment").val()
},
function (data) {
$(".info_box").hide();
if (data == 'ok') {
$(".info_box").filter(function(i, item) {
if ($(item).data('type_info_box') == "success_update_filter") {
return true;
}
else
return false;
}).show();
}
else {
$(".info_box").filter(function(i, item) {
if ($(item).data('type_info_box') == "error_create_filter") {
return true;
}
else
return false;
}).show();
}
});
// First remove all options of filters select
$('#filter_id').find('option').remove().end();
// Add 'none' option the first
$('#filter_id').append ($('<option></option>').html ( <?php echo "'".__('none')."'"; ?> ).attr ("value", 0));
// Reload filters select
jQuery.post ("<?php echo ui_get_full_url('ajax.php', false, false, false); ?>",
{"page" : "operation/events/events_list",
"get_event_filters" : 1
},
function (data) {
jQuery.each (data, function (i, val) {
s = js_html_entity_decode(val);
if (i == id_filter_update) {
$('#filter_id').append ($('<option selected="selected"></option>').html (s).attr ("value", i));
}
else {
$('#filter_id').append ($('<option></option>').html (s).attr ("value", i));
}
});
},
"json"
);
// Close dialog
$('.ui-dialog-titlebar-close').trigger('click');
// Update the info with the loaded filter
$("#hidden-id_name").val($('#text-id_name').val());
$('#filter_loaded_span').html($('#filter_loaded_text').html() + ': ' + name_filter_update);
return false;
}
$(document).ready(function (){
show_save_filter();
});
</script>
<?php
return;
}
if ($get_event_name) {
$event_id = get_parameter('event_id');
@ -342,26 +1034,26 @@ if ($change_owner) {
return;
}
// Generate a modal window with extended information of given event.
if ($get_extended_event) {
global $config;
$event_id = get_parameter('event_id', false);
$childrens_ids = get_parameter('childrens_ids');
$childrens_ids = json_decode($childrens_ids);
$event = get_parameter('event', false);
if ($meta) {
$event = events_meta_get_event($event_id, false, $history, 'ER');
} else {
$event = events_get_event($event_id);
if ($event === false) {
return;
}
$event_id = $event['id_evento'];
$readonly = false;
if (!$meta
&& isset($config['event_replication'])
&& $config['event_replication'] == 1
&& $config['show_events_in_local'] == 1
) {
$readonly = true;
$readonly = true;
}
// Clean url from events and store in array.
@ -374,17 +1066,17 @@ if ($get_extended_event) {
}
$dialog_page = get_parameter('dialog_page', 'general');
$similar_ids = get_parameter('similar_ids', $event_id);
$group_rep = get_parameter('group_rep', false);
$event_rep = get_parameter('event_rep', 1);
$timestamp_first = get_parameter('timestamp_first', $event['utimestamp']);
$timestamp_last = get_parameter('timestamp_last', $event['utimestamp']);
$server_id = get_parameter('server_id', 0);
$filter = get_parameter('filter', []);
$group_rep = $filter['group_rep'];
$event_rep = $event['event_rep'];
$timestamp_first = $event['min_timestamp'];
$timestamp_last = $event['max_timestamp'];
$server_id = $event['server_id'];
$comments = $event['comments'];
$event['similar_ids'] = $similar_ids;
$event['timestamp_first'] = $timestamp_first;
$event['timestamp_last'] = $timestamp_last;
$event['event_rep'] = $event_rep;
if (!isset($comments)) {
$comments = $event['user_comment'];
}
// Check ACLs.
if (is_user_admin($config['id_user'])) {
@ -418,7 +1110,7 @@ if ($get_extended_event) {
}
// Tabs.
$tabs = "<ul class='events_tabs'>";
$tabs = "<ul class=''>";
$tabs .= "<li><a href='#extended_event_general_page' id='link_general'>".html_print_image('images/lightning_go.png', true).'<span>'.__('General').'</span></a></li>';
if (events_has_extended_info($event['id_evento']) === true) {
$tabs .= "<li><a href='#extended_event_related_page' id='link_related'>".html_print_image('images/zoom.png', true).'<span>'.__('Related').'</span></a></li>';
@ -443,11 +1135,11 @@ if ($get_extended_event) {
$childrens_ids
)))
) {
$tabs .= "<li><a href='#extended_event_responses_page' id='link_responses'>".html_print_image('images/event_responses_col.png', true)."<span style='position:relative;top:-6px;left:3px;margin-right:10px;'>".__('Responses').'</span></a></li>';
$tabs .= "<li><a href='#extended_event_responses_page' id='link_responses'>".html_print_image('images/event_responses_col.png', true).'<span>'.__('Responses').'</span></a></li>';
}
if ($event['custom_data'] != '') {
$tabs .= "<li><a href='#extended_event_custom_data_page' id='link_custom_data'>".html_print_image('images/custom_field_col.png', true)."<span style='position:relative;top:-6px;left:3px;margin-right:10px;'>".__('Custom data').'</span></a></li>';
$tabs .= "<li><a href='#extended_event_custom_data_page' id='link_custom_data'>".html_print_image('images/custom_field_col.png', true).'<span>'.__('Custom data').'</span></a></li>';
}
$tabs .= '</ul>';
@ -498,7 +1190,7 @@ if ($get_extended_event) {
$childrens_ids
)))
) {
$responses = events_page_responses($event, $childrens_ids);
$responses = events_page_responses($event);
} else {
$responses = '';
}
@ -535,7 +1227,7 @@ if ($get_extended_event) {
$general = events_page_general($event);
$comments = events_page_comments($event, $childrens_ids);
$comments = events_page_comments($event);
$notifications = '<div id="notification_comment_error" style="display:none">'.ui_print_error_message(__('Error adding comment'), '', true).'</div>';
$notifications .= '<div id="notification_comment_success" style="display:none">'.ui_print_success_message(__('Comment added successfully'), '', true).'</div>';
@ -718,7 +1410,7 @@ if ($table_events) {
'AND'
);
echo '<div style="display: flex;" id="div_all_events_24h">';
echo '<label style="margin-right: 1em;"><b>'.__('Show all Events 24h').'</b></label>';
echo '<label style="margin: 0 1em 0 2em;"><b>'.__('Show all Events 24h').'</b></label>';
echo html_print_switch(
[
'name' => 'all_events_24h',

View File

@ -392,11 +392,16 @@ if (check_login()) {
switch ($row['module_type']) {
case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module_id);
// System Uptime:
// In case of System Uptime module, shows data in format "Days hours minutes seconds" if and only if
// selected module unit is "_timeticks_"
// Take notice that selected unit may not be postrocess unit
if ($value == '.1.3.6.1.2.1.1.3.0' || $value == '.1.3.6.1.2.1.25.1.1.0') {
if ($post_process > 0) {
$data[] = human_milliseconds_to_string(($row['data'] / $post_process));
$data_macro = modules_get_unit_macro($row[$attr[0]], $unit);
if ($data_macro) {
$data[] = $data_macro;
} else {
$data[] = human_milliseconds_to_string($row['data']);
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
}
} else {
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
@ -824,23 +829,28 @@ if (check_login()) {
$table->head[7] = __('Data');
$table->head[8] = __('Graph');
$table->head[9] = __('Last contact').ui_get_sorting_arrows($url_up_last, $url_down_last, $selectLastContactUp, $selectLastContactDown);
$table->align = [
'left',
'left',
'left',
'left',
'left',
'left',
'left',
'left',
'left',
];
$table->align = [];
$table->align[0] = 'center';
$table->align[1] = 'left';
$table->align[2] = 'left';
$table->align[3] = 'left';
$table->align[4] = 'left';
$table->align[5] = 'left';
$table->align[6] = 'center';
$table->align[7] = 'left';
$table->align[8] = 'center';
$table->align[9] = 'right';
$table->headstyle[2] = 'min-width: 60px';
$table->headstyle[3] = 'min-width: 100px';
$table->headstyle[5] = 'min-width: 60px';
$table->headstyle[8] = 'min-width: 85px';
$table->headstyle[9] = 'min-width: 100px';
$table->headstyle[2] = 'min-width: 85px';
$table->headstyle[3] = 'min-width: 130px';
$table->size[3] = '30%';
$table->style[3] = 'max-width: 28em;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;';
$table->size[4] = '30%';
$table->headstyle[5] = 'min-width: 85px';
$table->headstyle[6] = 'min-width: 125px; text-align: center;';
$table->headstyle[7] = 'min-width: 125px;';
$table->headstyle[8] = 'min-width: 100px; text-align: center;';
$table->headstyle[9] = 'min-width: 120px; text-align: right;';
$last_modulegroup = 0;
$rowIndex = 0;
@ -879,14 +889,14 @@ if (check_login()) {
$last_modulegroup = $module['id_module_group'];
}
// End of title of group
// End of title of group.
}
$data = [];
if (($module['id_modulo'] != 1) && ($module['id_tipo_modulo'] != 100)) {
if ($agent_w) {
if ($module['flag'] == 0) {
$data[0] = '<a href="index.php?'.'sec=estado&amp;'.'sec2=operation/agentes/ver_agente&amp;'.'id_agente='.$id_agente.'&amp;'.'id_agente_modulo='.$module['id_agente_modulo'].'&amp;'.'flag=1&amp;'.'refr=60">'.html_print_image('images/target.png', true, ['border' => '0', 'title' => __('Force')]).'</a>';
$data[0] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;id_agente_modulo='.$module['id_agente_modulo'].'&amp;flag=1&amp;refr=60">'.html_print_image('images/target.png', true, ['border' => '0', 'title' => __('Force')]).'</a>';
} else {
$data[0] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$id_agente.'&amp;id_agente_modulo='.$module['id_agente_modulo'].'&amp;refr=60">'.html_print_image('images/refresh.png', true, ['border' => '0', 'title' => __('Refresh')]).'</a>';
}
@ -1074,7 +1084,7 @@ if (check_login()) {
if ($data_macro) {
$salida = $data_macro;
} else {
$salida .= '&nbsp;'.'<i>'.io_safe_output($module['unit']).'</i>';
$salida .= '&nbsp;<i>'.io_safe_output($module['unit']).'</i>';
}
}
} else {
@ -1120,17 +1130,17 @@ if (check_login()) {
$draw_events = 0;
}
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&amp;".'period='.SECONDS_1DAY.'&amp;'.'id='.$module['id_agente_modulo'].'&amp;'.'label='.rawurlencode(
$link = "winopeng_var('".'operation/agentes/stat_win.php?'."type=$graph_type&amp;".'period='.SECONDS_1DAY.'&amp;id='.$module['id_agente_modulo'].'&amp;label='.rawurlencode(
urlencode(
base64_encode($module['nombre'])
)
).'&amp;'.'refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 650)";
).'&amp;refresh='.SECONDS_10MINUTES.'&amp;'."draw_events=$draw_events', 'day_".$win_handle."', 1000, 650)";
if (!is_snapshot_data($module['datos'])) {
$data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a> &nbsp;&nbsp;';
}
$server_name = '';
$data[8] .= "<a href='javascript: ".'show_module_detail_dialog('.$module['id_agente_modulo'].', '.$id_agente.', '.'"'.$server_name.'", '.(0).', '.SECONDS_1DAY.', " '.modules_get_agentmodule_name($module['id_agente_modulo'])."\")'>".html_print_image('images/binary.png', true, ['border' => '0', 'alt' => '']).'</a>';
$data[8] .= "<a href='javascript: ".'show_module_detail_dialog('.$module['id_agente_modulo'].', '.$id_agente.', "'.$server_name.'", '.(0).', '.SECONDS_1DAY.', " '.modules_get_agentmodule_name($module['id_agente_modulo'])."\")'>".html_print_image('images/binary.png', true, ['border' => '0', 'alt' => '']).'</a>';
}
if ($module['estado'] == 3) {
@ -1177,7 +1187,7 @@ if (check_login()) {
ui_print_info_message([ 'no_close' => true, 'message' => __('This agent doesn\'t have any active monitors.') ]);
}
} else {
$url = 'index.php?'.'sec=estado&'.'sec2=operation/agentes/ver_agente&'.'id_agente='.$id_agente.'&'.'refr=&filter_monitors=1&'.'status_filter_monitor='.$status_filter_monitor.'&'.'status_text_monitor='.$status_text_monitor.'&'.'status_module_group='.$status_module_group;
$url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'&refr=&filter_monitors=1&status_filter_monitor='.$status_filter_monitor.'&status_text_monitor='.$status_text_monitor.'&status_module_group='.$status_module_group;
if ($paginate_module) {
ui_pagination(

View File

@ -151,6 +151,10 @@ if (is_ajax()) {
ob_clean();
echo '<style type="text/css">';
include_once __DIR__.'/../styles/progress.css';
echo '</style>';
echo '<div class="left_align">';
if (!empty($id) && !empty($type)) {
switch ($type) {

View File

@ -1206,6 +1206,8 @@ switch ($action) {
switch ($type) {
case 'auto_sla_graph':
$elementFields['event_max_time_row'] = $elementFields['period'];
break;
case 'percentile_item':
case 'percentile_bar':
$elementFields['width_percentile'] = $elementFields['width'];

View File

@ -62,6 +62,7 @@ if (file_exists('languages/'.$user_language.'.mo')) {
<link rel="stylesheet" href="styles/pandora.css" type="text/css" />
<link rel="stylesheet" href="styles/pandora_minimal.css" type="text/css" />
<link rel="stylesheet" href="styles/js/jquery-ui.min.css" type="text/css" />
<link rel="stylesheet" href="styles/js/jquery-ui_custom.css" type="text/css" />
<script language="javascript" type='text/javascript' src='javascript/pandora.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery-3.3.1.min.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery.pandora.js'></script>

View File

@ -32,6 +32,7 @@ require_once $config['homedir'].'/include/functions_db.php';
require_once $config['homedir'].'/include/functions_io.php';
require_once $config['homedir'].'/include/functions_notifications.php';
require_once $config['homedir'].'/include/functions_servers.php';
require_once $config['homedir'].'/include/functions_update_manager.php';
// Enterprise includes.
enterprise_include_once('include/functions_metaconsole.php');
@ -1940,6 +1941,7 @@ class ConsoleSupervisor
public function checkUpdateManagerRegistration()
{
global $config;
include_once $config['homedir'].'/include/functions_update_manager.php';
$login = get_parameter('login', false);
if (update_manager_verify_registration() === false) {
@ -2244,6 +2246,7 @@ class ConsoleSupervisor
public function getUMMessages()
{
global $config;
include_once $config['homedir'].'/include/functions_update_manager.php';
if (update_manager_verify_registration() === false) {
// Console not subscribed.
@ -2261,8 +2264,6 @@ class ConsoleSupervisor
$future = (time() + 2 * SECONDS_1HOUR);
config_update_value('last_um_check', $future);
include_once $config['homedir'].'/include/functions_update_manager.php';
$params = [
'pandora_uid' => $config['pandora_uid'],
'timezone' => $config['timezone'],

View File

@ -2845,6 +2845,7 @@ class NetworkMap
html_print_table($table, true),
__('Node Details'),
__('Node Details'),
'',
false,
true
);
@ -2897,6 +2898,7 @@ class NetworkMap
html_print_table($table, true),
__('Node Details'),
__('Node Details'),
'',
false,
true
);
@ -2922,6 +2924,7 @@ class NetworkMap
html_print_table($table, true),
__('Interface Information (SNMP)'),
__('Interface Information (SNMP)'),
'',
true,
true
);
@ -2996,6 +2999,7 @@ class NetworkMap
html_print_table($table, true),
__('Node options'),
__('Node options'),
'',
true,
true
);
@ -3056,6 +3060,7 @@ class NetworkMap
html_print_table($table, true),
__('Relations'),
__('Relations'),
'',
true,
true
);
@ -3165,6 +3170,7 @@ class NetworkMap
$add_agent_node_html,
__('Add agent node'),
__('Add agent node'),
'',
false,
true
);
@ -3216,6 +3222,7 @@ class NetworkMap
$add_agent_node_html,
__('Add agent node (filter by group)'),
__('Add agent node'),
'',
true,
true
);
@ -3256,6 +3263,7 @@ class NetworkMap
$add_agent_node_html,
__('Add fictional point'),
__('Add agent node'),
'',
true,
true
);

View File

@ -72,6 +72,8 @@ class TreeService extends Tree
protected function getFirstLevel()
{
global $config;
$processed_items = $this->getProcessedServices();
$ids = array_keys($processed_items);

View File

@ -20,7 +20,7 @@
/**
* Pandora build version and version
*/
$build_version = 'PC190614';
$build_version = 'PC190625';
$pandora_version = 'v7.0NG.735';
// Do not overwrite default timezone set if defined.

View File

@ -39,10 +39,11 @@ define('TIME_FORMAT', 'H:i:s');
define('TIME_FORMAT_JS', 'HH:mm:ss');
// Events state constants.
define('EVENT_ALL', -1);
define('EVENT_NEW', 0);
define('EVENT_VALIDATE', 1);
define('EVENT_PROCESS', 2);
define('EVENT_NO_VALIDATED', 3);
// Agents disabled status.
@ -65,7 +66,7 @@ define('ERR_NODATA', -70000);
define('ERR_CONNECTION', -80000);
define('ERR_DISABLED', -90000);
define('ERR_WRONG', -100000);
define('ERR_WRONG_NAME', -100001);
define('ERR_WRONG_MR', -100001);
define('ERR_WRONG_PARAMETERS', -100002);
define('ERR_ACL', -110000);
define('ERR_AUTH', -120000);
@ -137,19 +138,19 @@ switch ($config['dbtype']) {
// Color constants.
define('COL_CRITICAL', '#FC4444');
define('COL_WARNING', '#FAD403');
define('COL_CRITICAL', '#e63c52');
define('COL_WARNING', '#f3b200');
define('COL_WARNING_DARK', '#FFB900');
define('COL_NORMAL', '#80BA27');
define('COL_NOTINIT', '#3BA0FF');
define('COL_NORMAL', '#82b92e');
define('COL_NOTINIT', '#4a83f3');
define('COL_UNKNOWN', '#B2B2B2');
define('COL_DOWNTIME', '#976DB1');
define('COL_IGNORED', '#DDD');
define('COL_ALERTFIRED', '#FFA631');
define('COL_MINOR', '#F099A2');
define('COL_MINOR', '#B2B2B2');
define('COL_MAJOR', '#C97A4A');
define('COL_INFORMATIONAL', '#E4E4E4');
define('COL_MAINTENANCE', '#3BA0FF');
define('COL_MAINTENANCE', '#4a83f3');
define('COL_GRAPH1', '#C397F2');
define('COL_GRAPH2', '#FFE66C');

View File

@ -902,6 +902,47 @@ function set_cookie($name, $value)
}
/**
* Returns database ORDER clause from datatables AJAX call.
*
* @param boolean $as_array Return as array or as string.
*
* @return string Order or empty.
*/
function get_datatable_order($as_array=false)
{
$order = get_parameter('order');
if (is_array($order)) {
$column = $order[0]['column'];
$direction = $order[0]['dir'];
}
if (!isset($column) || !isset($direction)) {
return '';
}
$columns = get_parameter('columns');
if (is_array($columns)) {
$column_name = $columns[$column]['data'];
}
if (!isset($column_name)) {
return '';
}
if ($as_array) {
return [
'direction' => $direction,
'field' => $column_name,
];
}
return $column_name.' '.$direction;
}
/**
* Get a parameter from a request.
*
@ -1392,6 +1433,11 @@ function enterprise_installed()
{
$return = false;
// Load enterprise extensions.
if (defined('DESTDIR')) {
return $return;
}
if (defined('PANDORA_ENTERPRISE')) {
if (PANDORA_ENTERPRISE) {
$return = true;
@ -1444,7 +1490,7 @@ function enterprise_include($filename)
{
global $config;
// Load enterprise extensions
// Load enterprise extensions.
if (defined('DESTDIR')) {
$destdir = DESTDIR;
} else {
@ -1470,11 +1516,24 @@ function enterprise_include($filename)
}
/**
* Includes a file from enterprise section.
*
* @param string $filename Target file.
*
* @return mixed Result code.
*/
function enterprise_include_once($filename)
{
global $config;
// Load enterprise extensions
// Load enterprise extensions.
if (defined('DESTDIR')) {
$destdir = DESTDIR;
} else {
$destdir = '';
}
$filepath = realpath($config['homedir'].'/'.ENTERPRISE_DIR.'/'.$filename);
if ($filepath === false) {
@ -1574,6 +1633,11 @@ function safe_sql_string($string)
}
/**
* Verifies if current Pandora FMS installation is a Metaconsole.
*
* @return boolean True metaconsole installation, false if not.
*/
function is_metaconsole()
{
global $config;
@ -1581,6 +1645,18 @@ function is_metaconsole()
}
/**
* Check if current Pandora FMS installation has joined a Metaconsole env.
*
* @return boolean True joined, false if not.
*/
function has_metaconsole()
{
global $config;
return (bool) $config['node_metaconsole'] && (bool) $config['metaconsole_node_id'];
}
/**
* @brief Check if there is management operations are allowed in current context
* (node // meta)

View File

@ -1614,9 +1614,9 @@ function agents_get_interval($id_agent)
*
* @param Agent object.
*
* @return The interval value and status of last contact
* @return The interval value and status of last contact or True /False
*/
function agents_get_interval_status($agent)
function agents_get_interval_status($agent, $return_html=true)
{
$return = '';
$last_time = time_w_fixed_tz($agent['ultimo_contacto']);
@ -1624,9 +1624,18 @@ function agents_get_interval_status($agent)
$diferencia = ($now - $last_time);
$time = ui_print_timestamp($last_time, true, ['style' => 'font-size:6.5pt']);
$min_interval = modules_get_agentmodule_mininterval_no_async($agent['id_agente']);
$return = $time;
if ($return_html) {
$return = $time;
} else {
$return = true;
}
if ($diferencia > ($min_interval['min_interval'] * 2) && $min_interval['num_interval'] > 0) {
$return = '<b><span style="color: #ff0000;">'.$time.'</span></b>';
if ($return_html) {
$return = '<b><span style="color: #ff0000;">'.$time.'</span></b>';
} else {
$return = false;
}
}
return $return;
@ -3367,3 +3376,35 @@ function agents_get_image_status($status)
return $image_status;
}
/**
* Animation GIF to show agent's status.
*
* @return string HTML code with heartbeat image.
*/
function agents_get_status_animation($up=true)
{
switch ($up) {
case true:
default:
return html_print_image(
'images/heartbeat_green.gif',
true,
[
'width' => '170',
'height' => '40',
]
);
case false:
return html_print_image(
'images/heartbeat_red.gif',
true,
[
'width' => '170',
'height' => '40',
]
);
}
}

View File

@ -1783,12 +1783,14 @@ function alerts_validate_alert_agent_module($id_alert_agent_module, $noACLs=fals
['id' => $id]
);
$template_name = io_safe_output(db_get_value('name', 'talert_templates', 'id', $alert['id_alert_template']));
$module_name = io_safe_output(db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $alert['id_agent_module']));
if ($result > 0) {
// Update fired alert count on the agent
db_process_sql(sprintf('UPDATE tagente SET update_alert_count=1 WHERE id_agente = %d', $agent_id));
events_create_event(
'Manual validation of alert for '.alerts_get_alert_template_description($alert['id_alert_template']),
'Manual validation of alert '.$template_name.' assigned to '.$module_name.'',
$group_id,
$agent_id,
1,
@ -1914,7 +1916,6 @@ function alerts_get_agents_with_alert_template($id_alert_template, $id_group, $f
$filter[] = 'tagente_modulo.id_agente_modulo = talert_template_modules.id_agent_module';
$filter[] = 'tagente_modulo.id_agente = tagente.id_agente';
$filter['id_alert_template'] = $id_alert_template;
$filter['tagente_modulo.disabled'] = '<> 1';
$filter['delete_pending'] = '<> 1';
if (empty($id_agents)) {

View File

@ -11518,7 +11518,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
if ($other['data'][18] != '') {
$values['id_extra'] = $other['data'][18];
$sql_validation = 'SELECT id_evento FROM tevento where estado=0 and id_extra ="'.$other['data'][18].'";';
$sql_validation = 'SELECT id_evento FROM tevento where estado IN (0,2) and id_extra ="'.$other['data'][18].'";';
$validation = db_get_all_rows_sql($sql_validation);
if ($validation) {
foreach ($validation as $val) {

View File

@ -180,7 +180,7 @@ function config_update_config()
$error_update[] = __('Automatic check for updates');
}
if (!config_update_value('cert_path', (bool) get_parameter('cert_path'))) {
if (!config_update_value('cert_path', get_parameter('cert_path'))) {
$error_update[] = __('SSL cert path');
}

File diff suppressed because it is too large Load Diff

View File

@ -2235,6 +2235,7 @@ function combined_graph_summatory_average(
$data_array_pop[$key_reverse] = array_pop(
$data_array_reverse[$key_reverse]
);
$count_data_array_reverse--;
}
}
@ -2343,14 +2344,21 @@ function graphic_agentaccess(
$date = get_system_time();
$datelimit = ($date - $period);
$data_array = [];
$interval = agents_get_interval($id_agent);
$data = db_get_all_rows_sql(
"SELECT count(*) as data, min(utimestamp) as utimestamp
FROM tagent_access
WHERE id_agent = $id_agent
AND utimestamp > $datelimit
AND utimestamp < $date
GROUP by ROUND(utimestamp / 1800)"
sprintf(
'SELECT utimestamp, count(*) as data
FROM tagent_access
WHERE id_agent = %d
AND utimestamp > %d
AND utimestamp < %d
GROUP BY ROUND(utimestamp/%d)',
$id_agent,
$datelimit,
$date,
$interval
)
);
if (isset($data) && is_array($data)) {
@ -2532,13 +2540,13 @@ function graph_agent_status($id_agent=false, $width=300, $height=200, $return=fa
}
// $colors = array(COL_CRITICAL, COL_WARNING, COL_NORMAL, COL_UNKNOWN);
$colors[__('Critical')] = COL_CRITICAL;
$colors[__('Warning')] = COL_WARNING;
$colors[__('Normal')] = COL_NORMAL;
$colors[__('Unknown')] = COL_UNKNOWN;
$colors['Critical'] = COL_CRITICAL;
$colors['Warning'] = COL_WARNING;
$colors['Normal'] = COL_NORMAL;
$colors['Unknown'] = COL_UNKNOWN;
if ($show_not_init) {
$colors[__('Not init')] = COL_NOTINIT;
$colors['Not init'] = COL_NOTINIT;
}
if (array_sum($data) == 0) {

View File

@ -1241,7 +1241,9 @@ function html_print_input_text_extended($name, $value, $id, $alt, $size, $maxlen
$maxlength = 255;
}
if ($size == 0) {
if ($size === false) {
$size = '';
} else if ($size == 0) {
$size = 10;
}
@ -1442,7 +1444,9 @@ function html_print_input_password(
$maxlength = 255;
}
if ($size == 0) {
if ($size === false) {
$size = false;
} else if ($size == 0) {
$size = 10;
}
@ -1480,7 +1484,9 @@ function html_print_input_text($name, $value, $alt='', $size=50, $maxlength=255,
$maxlength = 255;
}
if ($size == 0) {
if ($size === false) {
$size = false;
} else if ($size == 0) {
$size = 10;
}
@ -2731,20 +2737,22 @@ function html_html2rgb($htmlcolor)
/**
* Print a magic-ajax control to select the module.
*
* @param string $name The name of ajax control, by default is "module".
* @param string $default The default value to show in the ajax control.
* @param array $id_agents The array list of id agents as array(1,2,3), by default is false and the function use all agents (if the ACL desactive).
* @param boolean $ACL Filter the agents by the ACL list of user.
* @param string $scriptResult The source code of script to call, by default is
* empty. And the example is:
* function (e, data, formatted) {
* ...
* }
* @param string $name The name of ajax control, by default is "module".
* @param string $default The default value to show in the ajax control.
* @param array $id_agents The array list of id agents as array(1,2,3), by default is false and the function use all agents (if the ACL desactive).
* @param boolean $ACL Filter the agents by the ACL list of user.
* @param string $scriptResult The source code of script to call, by default is
* empty. And the example is:
* function (e, data, formatted) {
* ...
* }
*
* And the formatted is the select item as string.
* And the formatted is the select item as string.
*
* @param array $filter Other filter of modules.
* @param boolean $return If it is true return a string with the output instead to echo the output.
* @param array $filter Other filter of modules.
* @param boolean $return If it is true return a string with the output instead to echo the output.
* @param integer $id_agent_module Id agent module.
* @param string $size Size.
*
* @return mixed If the $return is true, return the output as string.
*/
@ -2756,7 +2764,8 @@ function html_print_autocomplete_modules(
$scriptResult='',
$filter=[],
$return=false,
$id_agent_module=0
$id_agent_module=0,
$size='30'
) {
global $config;
@ -2797,7 +2806,7 @@ function html_print_autocomplete_modules(
$default,
'text-'.$name,
'',
30,
$size,
100,
false,
'',
@ -2933,7 +2942,10 @@ function html_print_sort_arrows($params, $order_tag, $up='up', $down='down')
$url_down = 'index.php?'.http_build_query($params, '', '&amp;');
// Build the links
return '&nbsp;'.'<a href="'.$url_up.'">'.html_print_image('images/sort_up.png', true).'</a>'.'<a href="'.$url_down.'">'.html_print_image('images/sort_down.png', true).'</a>';
$out = '&nbsp;<a href="'.$url_up.'">';
$out .= html_print_image('images/sort_up_black.png', true);
$out .= '</a><a href="'.$url_down.'">';
$out .= html_print_image('images/sort_down_black.png', true).'</a>';
}

View File

@ -87,7 +87,7 @@ function menu_print_menu(&$menu)
// ~ if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $mainsec)) == false)
// ~ continue;
if (! isset($main['id'])) {
$id = 'menu_'.++$idcounter;
$id = 'menu_'.(++$idcounter);
} else {
$id = $main['id'];
}
@ -405,9 +405,9 @@ function menu_print_menu(&$menu)
$padding_top = ( $length >= 18) ? 6 : 12;
if ($config['menu_type'] == 'classic') {
$output .= '<div id="title_menu" class="title_menu_classic" style="padding-top:'.$padding_top.'px; display:none;">'.$main['text'].'</div>';
$output .= '<div id="title_menu" class="title_menu_classic">'.$main['text'].'</div>';
} else {
$output .= '<div id="title_menu" class="title_menu_collapsed" style="padding-top:'.$padding_top.'px; display:none;">'.$main['text'].'</div>';
$output .= '<div id="title_menu" class="title_menu_collapsed">'.$main['text'].'</div>';
}
// Add the notification ball if defined

View File

@ -2230,6 +2230,7 @@ function modules_get_agentmodule_data(
'module_name' => $values[$key]['module_name'],
'agent_id' => $values[$key]['agent_id'],
'agent_name' => $values[$key]['agent_name'],
'module_type' => $values[$key]['module_type'],
];
}

View File

@ -1807,9 +1807,9 @@ function networkmap_links_to_js_links(
if (($relation['parent_type'] == NODE_MODULE) && ($relation['child_type'] == NODE_MODULE)) {
if (($item['status_start'] == AGENT_MODULE_STATUS_CRITICAL_BAD) || ($item['status_end'] == AGENT_MODULE_STATUS_CRITICAL_BAD)) {
$item['link_color'] = '#FC4444';
$item['link_color'] = '#e63c52';
} else if (($item['status_start'] == AGENT_MODULE_STATUS_WARNING) || ($item['status_end'] == AGENT_MODULE_STATUS_WARNING)) {
$item['link_color'] = '#FAD403';
$item['link_color'] = '#f3b200';
}
$agent = agents_get_agent_id_by_module_id(
@ -1837,9 +1837,9 @@ function networkmap_links_to_js_links(
}
} else if ($relation['child_type'] == NODE_MODULE) {
if ($item['status_start'] == AGENT_MODULE_STATUS_CRITICAL_BAD) {
$item['link_color'] = '#FC4444';
$item['link_color'] = '#e63c52';
} else if ($item['status_start'] == AGENT_MODULE_STATUS_WARNING) {
$item['link_color'] = '#FAD403';
$item['link_color'] = '#f3b200';
}
$agent2 = agents_get_agent_id_by_module_id(
@ -1864,9 +1864,9 @@ function networkmap_links_to_js_links(
}
} else if ($relation['parent_type'] == NODE_MODULE) {
if ($item['status_end'] == AGENT_MODULE_STATUS_CRITICAL_BAD) {
$item['link_color'] = '#FC4444';
$item['link_color'] = '#e63c52';
} else if ($item['status_end'] == AGENT_MODULE_STATUS_WARNING) {
$item['link_color'] = '#FAD403';
$item['link_color'] = '#f3b200';
}
$agent = agents_get_agent_id_by_module_id(

View File

@ -151,11 +151,13 @@ function reporting_make_reporting_data(
$contents = $report['contents'];
} else {
$report = io_safe_output(db_get_row('treport', 'id_report', $id_report));
$contents = db_get_all_rows_field_filter(
'treport_content',
'id_report',
$id_report,
db_escape_key_identifier('order')
$contents = io_safe_output(
db_get_all_rows_field_filter(
'treport_content',
'id_report',
$id_report,
db_escape_key_identifier('order')
)
);
}
@ -326,26 +328,32 @@ function reporting_make_reporting_data(
break;
case 'general':
$report['contents'][] = reporting_general(
$report,
$content
$report['contents'][] = io_safe_output(
reporting_general(
$report,
$content
)
);
break;
case 'availability':
$report['contents'][] = reporting_availability(
$report,
$content,
$date,
$time
$report['contents'][] = io_safe_output(
reporting_availability(
$report,
$content,
$date,
$time
)
);
break;
case 'availability_graph':
$report['contents'][] = reporting_availability_graph(
$report,
$content,
$pdf
$report['contents'][] = io_safe_output(
reporting_availability_graph(
$report,
$content,
$pdf
)
);
break;
@ -475,9 +483,11 @@ function reporting_make_reporting_data(
break;
case 'agent_configuration':
$report['contents'][] = reporting_agent_configuration(
$report,
$content
$report['contents'][] = io_safe_output(
reporting_agent_configuration(
$report,
$content
)
);
break;
@ -673,12 +683,14 @@ function reporting_make_reporting_data(
case 'agent_detailed_event':
case 'event_report_agent':
$report_control = reporting_event_report_agent(
$report,
$content,
$type,
$force_width_chart,
$force_height_chart
$report_control = io_safe_output(
reporting_event_report_agent(
$report,
$content,
$type,
$force_width_chart,
$force_height_chart
)
);
if ($report_control['total_events'] == 0 && $content['hide_no_data'] == 1) {
continue;
@ -1383,7 +1395,7 @@ function reporting_event_top_n(
foreach ($tops as $key => $row) {
// Metaconsole connection.
$server_name = $row['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -1426,7 +1438,7 @@ function reporting_event_top_n(
}
// Restore dbconnection.
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
}
@ -2176,7 +2188,7 @@ function reporting_agent_module($report, $content)
foreach ($agents as $agent) {
$row = [];
$row['agent_status'][$agent] = agents_get_status($agent);
$row['agent_name'] = agents_get_alias($agent);
$row['agent_name'] = io_safe_output(agents_get_alias($agent));
$agent_modules = agents_get_modules($agent);
$row['modules'] = [];
@ -2330,7 +2342,7 @@ function reporting_exception(
do {
// Metaconsole connection.
$server_name = $exceptions[$i]['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -2372,7 +2384,7 @@ function reporting_exception(
$i++;
// Restore dbconnection.
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
} while ($min === false && $i < count($exceptions));
@ -2385,7 +2397,7 @@ function reporting_exception(
foreach ($exceptions as $exc) {
// Metaconsole connection.
$server_name = $exc['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -2499,7 +2511,7 @@ function reporting_exception(
}
// Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
}
@ -2693,7 +2705,7 @@ function reporting_group_report($report, $content)
{
global $config;
$metaconsole_on = ($config['metaconsole'] == 1) && defined('METACONSOLE');
$metaconsole_on = ($config['metaconsole'] == 1) && is_metaconsole();
$return['type'] = 'group_report';
@ -2777,7 +2789,7 @@ function reporting_event_report_agent(
}
$return['title'] = $content['name'];
$return['subtitle'] = agents_get_alias($content['id_agent']);
$return['subtitle'] = io_safe_output(agents_get_alias($content['id_agent']));
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -6073,7 +6085,7 @@ function reporting_advanced_sla(
// SLA.
$return['SLA'] = reporting_sla_get_compliance_from_array($return);
$return['SLA_fixed'] = sla_truncate(
$return['sla_fixed'] = sla_truncate(
$return['SLA'],
$config['graph_precision']
);
@ -6173,7 +6185,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
foreach ($items as $item) {
// aaMetaconsole connection
$server_name = $item['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -6185,7 +6197,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
|| modules_is_not_init($item['id_agent_module'])
) {
// Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
@ -6242,7 +6254,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
$text = $row['data']['agent'].' ('.$text.')';
// Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
@ -6396,10 +6408,12 @@ function reporting_availability_graph($report, $content, $pdf=false)
$edge_interval = 10;
if (empty($content['subitems'])) {
$slas = db_get_all_rows_field_filter(
'treport_content_sla_combined',
'id_report_content',
$content['id_rc']
$slas = io_safe_output(
db_get_all_rows_field_filter(
'treport_content_sla_combined',
'id_report_content',
$content['id_rc']
)
);
} else {
$slas = $content['subitems'];
@ -6807,7 +6821,7 @@ function reporting_increment($report, $content)
$return['data'] = [];
if (defined('METACONSOLE')) {
if (is_metaconsole()) {
$sql1 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.'
AND utimestamp <= '.(time() - $period).' ORDER BY utimestamp DESC';
$sql2 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' ORDER BY utimestamp DESC';
@ -6845,7 +6859,7 @@ function reporting_increment($report, $content)
$last_data = db_get_value_sql('SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' ORDER BY utimestamp DESC');
}
if (!defined('METACONSOLE')) {
if (!is_metaconsole()) {
}
if ($old_data === false || $last_data === false) {
@ -6934,7 +6948,7 @@ function reporting_general($report, $content)
foreach ($generals as $row) {
// Metaconsole connection
$server_name = $row['server_name'];
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
$connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name);
@ -7085,7 +7099,7 @@ function reporting_general($report, $content)
$i++;
// Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) {
if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db();
}
}
@ -10980,10 +10994,10 @@ function reporting_get_stats_servers()
$tdata = [];
'<span class="big_data">'.format_numeric($server_performance['total_local_modules']).'</span>';
$tdata[0] = html_print_image('images/module.png', true, ['title' => __('Total running modules'), 'width' => '25px']);
$tdata[0] = html_print_image('images/module.png', true, ['title' => __('Total running modules')]);
$tdata[1] = '<span class="big_data">'.format_numeric($server_performance['total_modules']).'</span>';
$tdata[2] = '<span class="med_data">'.format_numeric($server_performance['total_modules_rate'], 2).'</span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second'), 'width' => '16px']).'/sec </span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second')]).'/sec </span>';
$table_srv->rowclass[] = '';
$table_srv->data[] = $tdata;
@ -10995,22 +11009,22 @@ function reporting_get_stats_servers()
$table_srv->data[] = $tdata;
$tdata = [];
$tdata[0] = html_print_image('images/database.png', true, ['title' => __('Local modules'), 'width' => '25px']);
$tdata[0] = html_print_image('images/database.png', true, ['title' => __('Local modules')]);
$tdata[1] = '<span class="big_data">'.format_numeric($server_performance['total_local_modules']).'</span>';
$tdata[2] = '<span class="med_data">'.format_numeric($server_performance['local_modules_rate'], 2).'</span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second'), 'width' => '16px']).'/sec </span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second')]).'/sec </span>';
$table_srv->rowclass[] = '';
$table_srv->data[] = $tdata;
if (isset($server_performance['total_network_modules'])) {
$tdata = [];
$tdata[0] = html_print_image('images/network.png', true, ['title' => __('Network modules'), 'width' => '25px']);
$tdata[0] = html_print_image('images/network.png', true, ['title' => __('Network modules')]);
$tdata[1] = '<span class="big_data">'.format_numeric($server_performance['total_network_modules']).'</span>';
$tdata[2] = '<span class="med_data">'.format_numeric($server_performance['network_modules_rate'], 2).'</span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second'), 'width' => '16px']).'/sec </span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second')]).'/sec </span>';
if ($server_performance['total_remote_modules'] > 10000 && !enterprise_installed()) {
$tdata[4] = "<div id='remotemodulesmodal' class='publienterprise' title='Community version' style='text-align:left;'><img data-title='Enterprise version' class='img_help forced_title' data-use_title_for_force_title='1' src='images/alert_enterprise.png'></div>";
@ -11024,11 +11038,11 @@ function reporting_get_stats_servers()
if (isset($server_performance['total_plugin_modules'])) {
$tdata = [];
$tdata[0] = html_print_image('images/plugin.png', true, ['title' => __('Plugin modules'), 'width' => '25px']);
$tdata[0] = html_print_image('images/plugin.png', true, ['title' => __('Plugin modules')]);
$tdata[1] = '<span class="big_data">'.format_numeric($server_performance['total_plugin_modules']).'</span>';
$tdata[2] = '<span class="med_data">'.format_numeric($server_performance['plugin_modules_rate'], 2).'</span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second'), 'width' => '16px']).'/sec </span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second')]).'/sec </span>';
$table_srv->rowclass[] = '';
$table_srv->data[] = $tdata;
@ -11036,11 +11050,11 @@ function reporting_get_stats_servers()
if (isset($server_performance['total_prediction_modules'])) {
$tdata = [];
$tdata[0] = html_print_image('images/chart_bar.png', true, ['title' => __('Prediction modules'), 'width' => '25px']);
$tdata[0] = html_print_image('images/chart_bar.png', true, ['title' => __('Prediction modules')]);
$tdata[1] = '<span class="big_data">'.format_numeric($server_performance['total_prediction_modules']).'</span>';
$tdata[2] = '<span class="med_data">'.format_numeric($server_performance['prediction_modules_rate'], 2).'</span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second'), 'width' => '16px']).'/sec </span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second')]).'/sec </span>';
$table_srv->rowclass[] = '';
$table_srv->data[] = $tdata;
@ -11048,11 +11062,11 @@ function reporting_get_stats_servers()
if (isset($server_performance['total_wmi_modules'])) {
$tdata = [];
$tdata[0] = html_print_image('images/wmi.png', true, ['title' => __('WMI modules'), 'width' => '25px']);
$tdata[0] = html_print_image('images/wmi.png', true, ['title' => __('WMI modules')]);
$tdata[1] = '<span class="big_data">'.format_numeric($server_performance['total_wmi_modules']).'</span>';
$tdata[2] = '<span class="med_data">'.format_numeric($server_performance['wmi_modules_rate'], 2).'</span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second'), 'width' => '16px']).'/sec </span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second')]).'/sec </span>';
$table_srv->rowclass[] = '';
$table_srv->data[] = $tdata;
@ -11060,11 +11074,11 @@ function reporting_get_stats_servers()
if (isset($server_performance['total_web_modules'])) {
$tdata = [];
$tdata[0] = html_print_image('images/world.png', true, ['title' => __('Web modules'), 'width' => '25px']);
$tdata[0] = html_print_image('images/world.png', true, ['title' => __('Web modules')]);
$tdata[1] = '<span class="big_data">'.format_numeric($server_performance['total_web_modules']).'</span>';
$tdata[2] = '<span class="med_data">'.format_numeric($server_performance['web_modules_rate'], 2).'</span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second'), 'width' => '16px']).'/sec </span>';
$tdata[3] = html_print_image('images/module.png', true, ['title' => __('Ratio').': '.__('Modules by second')]).'/sec </span>';
$table_srv->rowclass[] = '';
$table_srv->data[] = $tdata;
@ -11082,7 +11096,6 @@ function reporting_get_stats_servers()
true,
[
'title' => __('Total events'),
'width' => '25px',
]
);
$tdata[1] = '<span class="big_data" id="total_events">'.html_print_image('images/spinner.gif', true).'</span>';

View File

@ -4270,16 +4270,16 @@ function reporting_get_agents_by_status($data, $graph_width=250, $graph_height=1
$agent_data = [];
$agent_data[0] = html_print_image('images/agent_critical.png', true, ['title' => __('Agents critical')]);
$agent_data[1] = "<a style='color: ".COL_CRITICAL.";' href='".$links['agents_critical']."'><b><span style='font-size: 12pt; font-weight: bold; color: #FC4444;'>".format_numeric($data['agent_critical']).'</span></b></a>';
$agent_data[1] = "<a style='color: ".COL_CRITICAL.";' href='".$links['agents_critical']."'><b><span style='font-size: 12pt; font-weight: bold; color: #e63c52;'>".format_numeric($data['agent_critical']).'</span></b></a>';
$agent_data[2] = html_print_image('images/agent_warning.png', true, ['title' => __('Agents warning')]);
$agent_data[3] = "<a style='color: ".COL_WARNING.";' href='".$links['agents_warning']."'><b><span style='font-size: 12pt; font-weight: bold; color: #FAD403;'>".format_numeric($data['agent_warning']).'</span></b></a>';
$agent_data[3] = "<a style='color: ".COL_WARNING.";' href='".$links['agents_warning']."'><b><span style='font-size: 12pt; font-weight: bold; color: #f3b200;'>".format_numeric($data['agent_warning']).'</span></b></a>';
$table_agent->data[] = $agent_data;
$agent_data = [];
$agent_data[0] = html_print_image('images/agent_ok.png', true, ['title' => __('Agents ok')]);
$agent_data[1] = "<a style='color: ".COL_NORMAL.";' href='".$links['agents_ok']."'><b><span style='font-size: 12pt; font-weight: bold; color: #80BA27;'>".format_numeric($data['agent_ok']).'</span></b></a>';
$agent_data[1] = "<a style='color: ".COL_NORMAL.";' href='".$links['agents_ok']."'><b><span style='font-size: 12pt; font-weight: bold; color: #82b92e;'>".format_numeric($data['agent_ok']).'</span></b></a>';
$agent_data[2] = html_print_image('images/agent_unknown.png', true, ['title' => __('Agents unknown')]);
$agent_data[3] = "<a style='color: ".COL_UNKNOWN.";' href='".$links['agents_unknown']."'><b><span style='font-size: 12pt; font-weight: bold; color: #B2B2B2;'>".format_numeric($data['agent_unknown']).'</span></b></a>';
@ -4367,13 +4367,13 @@ function reporting_get_events($data, $links=false)
}
if (defined('METACONSOLE')) {
$table_events->style[0] = 'background-color:#FC4444';
$table_events->style[0] = 'background-color:#e63c52';
$table_events->data[0][0] = html_print_image('images/module_event_critical.png', true, ['title' => __('Critical events')]);
$table_events->data[0][0] .= '&nbsp;&nbsp;&nbsp;'."<a style='color:#FFF; font-size: 12pt; font-weight: bold;".$style."' href='".$links['critical']."'>".format_numeric($data['critical']).'</a>';
$table_events->style[1] = 'background-color:#FAD403';
$table_events->style[1] = 'background-color:#f3b200';
$table_events->data[0][1] = html_print_image('images/module_event_warning.png', true, ['title' => __('Warning events')]);
$table_events->data[0][1] .= '&nbsp;&nbsp;&nbsp;'."<a style='color:#FFF; font-size: 12pt; font-weight: bold;".$style."' href='".$links['warning']."'>".format_numeric($data['warning']).'</a>';
$table_events->style[2] = 'background-color:#80BA27';
$table_events->style[2] = 'background-color:#82b92e';
$table_events->data[0][2] = html_print_image('images/module_event_ok.png', true, ['title' => __('OK events')]);
$table_events->data[0][2] .= '&nbsp;&nbsp;&nbsp;'."<a style='color:#FFF; font-size: 12pt; font-weight: bold;".$style."' href='".$links['normal']."'>".format_numeric($data['normal']).'</a>';
$table_events->style[3] = 'background-color:#B2B2B2';
@ -4381,11 +4381,11 @@ function reporting_get_events($data, $links=false)
$table_events->data[0][3] .= '&nbsp;&nbsp;&nbsp;'."<a style='color:#FFF; font-size: 12pt; font-weight: bold;".$style."' href='".$links['unknown']."'>".format_numeric($data['unknown']).'</a>';
} else {
$table_events->data[0][0] = html_print_image('images/module_critical.png', true, ['title' => __('Critical events')]);
$table_events->data[0][0] .= '&nbsp;&nbsp;&nbsp;'."<a style='color: #FC4444;".$style."' href='".$links['critical']."'><b><span style='font-size: 12pt; font-weight: bold; color: #FC4444;'>".format_numeric($data['critical']).'</span></b></a>';
$table_events->data[0][0] .= '&nbsp;&nbsp;&nbsp;'."<a style='color: #e63c52;".$style."' href='".$links['critical']."'><b><span style='font-size: 12pt; font-weight: bold; color: #e63c52;'>".format_numeric($data['critical']).'</span></b></a>';
$table_events->data[0][1] = html_print_image('images/module_warning.png', true, ['title' => __('Warning events')]);
$table_events->data[0][1] .= '&nbsp;&nbsp;&nbsp;'."<a style='color: #FAD403;".$style."' href='".$links['warning']."'><b><span style='font-size: 12pt; font-weight: bold; color: #FAD403;'>".format_numeric($data['warning']).'</span></b></a>';
$table_events->data[0][1] .= '&nbsp;&nbsp;&nbsp;'."<a style='color: #f3b200;".$style."' href='".$links['warning']."'><b><span style='font-size: 12pt; font-weight: bold; color: #f3b200;'>".format_numeric($data['warning']).'</span></b></a>';
$table_events->data[0][2] = html_print_image('images/module_ok.png', true, ['title' => __('OK events')]);
$table_events->data[0][2] .= '&nbsp;&nbsp;&nbsp;'."<a style='color: #80BA27;".$style."' href='".$links['normal']."'><b style='font-size: 12pt; font-weight: bold; color: #80BA27;'>".format_numeric($data['normal']).'</b></a>';
$table_events->data[0][2] .= '&nbsp;&nbsp;&nbsp;'."<a style='color: #82b92e;".$style."' href='".$links['normal']."'><b style='font-size: 12pt; font-weight: bold; color: #82b92e;'>".format_numeric($data['normal']).'</b></a>';
$table_events->data[0][3] = html_print_image('images/module_unknown.png', true, ['title' => __('Unknown events')]);
$table_events->data[0][3] .= '&nbsp;&nbsp;&nbsp;'."<a style='color: #B2B2B2;".$style."' href='".$links['unknown']."'><b><span style='font-size: 12pt; font-weight: bold; color: #B2B2B2;'>".format_numeric($data['unknown']).'</span></b></a>';
}

View File

@ -756,10 +756,10 @@ function snmp_browser_print_container($return=false, $width='100%', $height='500
$output .= '<div id="snmp3_browser_options" style="display: none;">';
}
$output .= ui_toggle(html_print_table($table3, true), __('SNMP v3 options'), '', true, true);
$output .= ui_toggle(html_print_table($table3, true), __('SNMP v3 options'), '', '', true, true);
$output .= '</div>';
$output .= '<div style="width: 100%; padding-top: 10px;">';
$output .= ui_toggle(html_print_table($table2, true), __('Search options'), '', true, true);
$output .= ui_toggle(html_print_table($table2, true), __('Search options'), '', '', true, true);
$output .= '</div>';
// SNMP tree container

View File

@ -744,7 +744,8 @@ function tags_get_acl_tags(
$query_table='',
$meta=false,
$childrens_ids=[],
$force_group_and_tag=false
$force_group_and_tag=false,
$id_grupo_table_pretag=''
) {
global $config;
@ -814,7 +815,13 @@ function tags_get_acl_tags(
case 'event_condition':
// Return the condition of the tags for tevento table.
$condition = tags_get_acl_tags_event_condition($acltags, $meta, $force_group_and_tag);
$condition = tags_get_acl_tags_event_condition(
$acltags,
$meta,
$force_group_and_tag,
false,
$id_grupo_table_pretag
);
if (!empty($condition)) {
return " $query_prefix ".'('.$condition.')';
@ -905,8 +912,13 @@ function tags_get_acl_tags_module_condition($acltags, $modules_table='', $force_
*/
function tags_get_acl_tags_event_condition($acltags, $meta=false, $force_group_and_tag=false, $force_equal=false)
{
function tags_get_acl_tags_event_condition(
$acltags,
$meta=false,
$force_group_and_tag=false,
$force_equal=false,
$id_grupo_table_pretag=''
) {
global $config;
$condition = [];
@ -923,7 +935,7 @@ function tags_get_acl_tags_event_condition($acltags, $meta=false, $force_group_a
// Group condition (The module belongs to an agent of the group X)
// $group_condition = sprintf('id_grupo IN (%s)', implode(',', array_values(groups_get_id_recursive($group_id, true))));.
$group_condition = "(id_grupo = $group_id OR id_group = $group_id)";
$group_condition = '('.$id_grupo_table_pretag.'id_grupo = '.$group_id.' OR id_group = '.$group_id.')';
// Tags condition (The module has at least one of the restricted tags).
$tags_condition = '';
@ -959,7 +971,7 @@ function tags_get_acl_tags_event_condition($acltags, $meta=false, $force_group_a
}
$in_group = implode(',', $without_tags);
$condition .= sprintf('(id_grupo IN (%s) OR id_group IN (%s))', $in_group, $in_group);
$condition .= sprintf('('.$id_grupo_table_pretag.'id_grupo IN (%s) OR id_group IN (%s))', $in_group, $in_group);
}
$condition = !empty($condition) ? "($condition)" : '';
@ -1097,6 +1109,12 @@ function tags_get_user_tags($id_user=false, $access='AR', $return_tag_any=false)
if (empty($user_tags_id)) {
$user_tags_id = $t;
} else {
if (empty($t)) {
// Empty is 'all of them'.
// TODO: Review this...
$t = [];
}
$user_tags_id = array_unique(array_merge($t, $user_tags_id));
}
}

View File

@ -327,7 +327,7 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals
if ($user_access_node && check_acl($config['id_user'], $id_group, 'AW')) {
// Actions table
echo '<div style="width:100%; text-align: right; min-width: 300px;">';
echo '<div style="width:100%; text-align: right; min-width: 300px;padding-right: 1em;">';
echo '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$module['id_agente'].'&tab=module&edit_module=1&id_agent_module='.$module['id_agente_modulo'].$url_hash.'">';
html_print_submit_button(__('Go to module edition'), 'upd_button', false, 'class="sub config"');
echo '</a>';
@ -637,7 +637,13 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
$row = [];
$row['title'] = __('Next agent contact');
$row['data'] = progress_bar($progress, 150, 20);
$row['data'] = ui_progress(
$progress,
'100%',
'1.5',
'#82b92e',
true
);
$table->data['next_contact'] = $row;
// End of table
@ -664,7 +670,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
$agent_table .= '<br>';
// print agent data toggle
ui_toggle($agent_table, __('Agent data'), '', false);
ui_toggle($agent_table, __('Agent data'), '', '', false);
// Advanced data
$table = new StdClass();

View File

@ -1441,11 +1441,16 @@ function ui_require_css_file($name, $path='include/styles/')
if (! file_exists($filename)
&& ! file_exists($config['homedir'].'/'.$filename)
&& ! file_exists($config['homedir'].'/'.ENTERPRISE_DIR.'/'.$filename)
) {
return false;
}
$config['css'][$name] = $filename;
if (is_metaconsole()) {
$config['css'][$name] = '/../../'.$filename;
} else {
$config['css'][$name] = $filename;
}
return true;
}
@ -1738,6 +1743,7 @@ function ui_process_page_head($string, $bitfield)
// Add the jquery UI styles CSS.
$config['css']['jquery-UI'] = 'include/styles/js/jquery-ui.min.css';
$config['css']['jquery-UI-custom'] = 'include/styles/js/jquery-ui_custom.css';
// Add the dialog styles CSS.
$config['css']['dialog'] = 'include/styles/dialog.css';
// Add the dialog styles CSS.
@ -1756,6 +1762,7 @@ function ui_process_page_head($string, $bitfield)
[
'common' => 'include/styles/common.css',
'menu' => 'include/styles/menu.css',
'tables' => 'include/styles/tables.css',
$config['style'] => 'include/styles/'.$config['style'].'.css',
],
$config['css']
@ -1783,47 +1790,6 @@ function ui_process_page_head($string, $bitfield)
* End load CSS
*/
/*
* Load JS
*/
if (empty($config['js'])) {
$config['js'] = [];
// If it's empty, false or not init set array to empty just in case.
}
// Pandora specific JavaScript should go first.
$config['js'] = array_merge(['pandora' => 'include/javascript/pandora.js'], $config['js']);
// Load base64 javascript library.
$config['js']['base64'] = 'include/javascript/encode_decode_base64.js';
// Load webchat javascript library.
$config['js']['webchat'] = 'include/javascript/webchat.js';
// Load qrcode library.
$config['js']['qrcode'] = 'include/javascript/qrcode.js';
// Load intro.js library (for bubbles and clippy).
$config['js']['intro'] = 'include/javascript/intro.js';
$config['js']['clippy'] = 'include/javascript/clippy.js';
// Load Underscore.js library.
$config['js']['underscore'] = 'include/javascript/underscore-min.js';
// Load other javascript.
// We can't load empty.
$loaded = [''];
foreach ($config['js'] as $name => $filename) {
if (in_array($name, $loaded)) {
continue;
}
array_push($loaded, $name);
$url_js = ui_get_full_url($filename);
$output .= '<script type="text/javascript" src="'.$url_js.'"></script>'."\n\t";
}
/*
* End load JS
*/
/*
* Load jQuery
*/
@ -1881,6 +1847,47 @@ function ui_process_page_head($string, $bitfield)
* End load JQuery
*/
/*
* Load JS
*/
if (empty($config['js'])) {
$config['js'] = [];
// If it's empty, false or not init set array to empty just in case.
}
// Pandora specific JavaScript should go first.
$config['js'] = array_merge(['pandora' => 'include/javascript/pandora.js'], $config['js']);
// Load base64 javascript library.
$config['js']['base64'] = 'include/javascript/encode_decode_base64.js';
// Load webchat javascript library.
$config['js']['webchat'] = 'include/javascript/webchat.js';
// Load qrcode library.
$config['js']['qrcode'] = 'include/javascript/qrcode.js';
// Load intro.js library (for bubbles and clippy).
$config['js']['intro'] = 'include/javascript/intro.js';
$config['js']['clippy'] = 'include/javascript/clippy.js';
// Load Underscore.js library.
$config['js']['underscore'] = 'include/javascript/underscore-min.js';
// Load other javascript.
// We can't load empty.
$loaded = [''];
foreach ($config['js'] as $name => $filename) {
if (in_array($name, $loaded)) {
continue;
}
array_push($loaded, $name);
$url_js = ui_get_full_url($filename);
$output .= '<script type="text/javascript" src="'.$url_js.'"></script>'."\n\t";
}
/*
* End load JS
*/
include_once __DIR__.'/graphs/functions_flot.php';
$output .= include_javascript_dependencies_flot_graph(true);
@ -2717,6 +2724,15 @@ function ui_print_module_status(
* @param string $color Color.
* @param boolean $return Return or paint (if false).
* @param boolean $text Text to be displayed,by default progress %.
* @param array $ajax Ajax: [ 'page' => 'page', 'data' => 'data' ] Sample:
* [
* 'page' => 'operation/agentes/ver_agente', Target page.
* 'interval' => 100 / $agent["intervalo"], Ask every interval seconds.
* 'data' => [ Data to be sent to target page.
* 'id_agente' => $id_agente,
* 'refresh_contact' => 1,
* ],
* ].
*
* @return string HTML code.
*/
@ -2724,9 +2740,10 @@ function ui_progress(
$progress,
$width='100%',
$height='2.5',
$color='#80ba27',
$color='#82b92e',
$return=true,
$text=''
$text='',
$ajax=false
) {
if (!$progress) {
$progress = 0;
@ -2745,10 +2762,56 @@ function ui_progress(
}
ui_require_css_file('progress');
$output .= '<div class="progress_main" style="width: '.$width.'; height: '.$height.'em; border: 1px solid '.$color.'">';
$output .= '<span class="progress_text" style="font-size:'.($height - 0.5).'em;">'.$text.'</span>';
$output .= '<div class="progress" style="width: '.$progress.'%; background: '.$color.'"></div>';
$output .= '</div>';
$output .= '<span class="progress_main" data-label="'.$text;
$output .= '" style="width: '.$width.'; height: '.$height.'em; border: 1px solid '.$color.'">';
$output .= '<span class="progress" style="width: '.$progress.'%; background: '.$color.'"></span>';
$output .= '</span>';
if ($ajax !== false && is_array($ajax)) {
$output .= '<script type="text/javascript">
$(document).ready(function() {
setInterval(() => {
last = $(".progress_main").attr("data-label").split(" ")[0]*1;
width = $(".progress").width() / $(".progress").parent().width() * 100;
width_interval = '.$ajax['interval'].';
if (last % 10 == 0) {
$.post({
url: "'.ui_get_full_url('ajax.php').'",
data: {';
if (is_array($ajax['data'])) {
foreach ($ajax['data'] as $token => $value) {
$output .= '
'.$token.':"'.$value.'",';
}
}
$output .= '
page: "'.$ajax['page'].'"
},
success: function(data) {
try {
val = JSON.parse(data);
$(".progress_main").attr("data-label", val["last_contact"]+" s");
$(".progress").width(val["progress"]+"%");
} catch (e) {
console.error(e);
$(".progress_text").attr("data-label", (last -1) + " s");
if (width < 100) {
$(".progress").width((width+width_interval) + "%");
}
}
}
});
} else {
$(".progress_main").attr("data-label", (last -1) + " s");
if (width < 100) {
$(".progress").width((width+width_interval) + "%");
}
}
}, 1000);
});
</script>';
}
if (!$return) {
echo $output;
@ -2758,6 +2821,462 @@ function ui_progress(
}
/**
* Generate needed code to print a datatables jquery plugin.
*
* @param array $parameters All desired data using following format:
* [
* 'print' => true (by default printed)
* 'id' => datatable id.
* 'class' => datatable class.
* 'style' => datatable style.
* 'order' => [
* 'field' => column name
* 'direction' => asc or desc
* ],
* 'default_pagination' => integer, default pagination is set to block_size
* 'ajax_url' => 'include/ajax.php' ajax_url.
* 'ajax_data' => [ operation => 1 ] extra info to be sent.
* 'ajax_postprocess' => a javscript function to postprocess data received
* by ajax call. It is applied foreach row and must
* use following format:
* * [code]
* * function (item) {
* * // Process received item, for instance, name:
* * tmp = '<span class=label>' + item.name + '</span>';
* * item.name = tmp;
* * }
* * [/code]
* 'columns_names' => [
* 'column1' :: Used as th text. Direct text entry. It could be array:
* OR
* [
* 'id' => th id.
* 'class' => th class.
* 'style' => th style.
* 'text' => 'column1'.
* ]
* ],
* 'columns' => [
* 'column1',
* 'column2',
* ...
* ],
* 'no_sortable_columns' => [ indexes ] 1,2... -1 etc. Avoid sorting.
* 'form' => [
* 'html' => 'html code' a directly defined inputs in HTML.
* 'extra_buttons' => [
* [
* 'id' => button id,
* 'class' => button class,
* 'style' => button style,
* 'text' => button text,
* 'onclick' => button onclick,
* ]
* ],
* 'search_button_class' => search button class.
* 'class' => form class.
* 'id' => form id.
* 'style' => form style.
* 'js' => optional extra actions onsubmit.
* 'inputs' => [
* 'label' => Input label.
* 'type' => Input type.
* 'value' => Input value.
* 'name' => Input name.
* 'id' => Input id.
* 'options' => [
* 'option1'
* 'option2'
* ...
* ]
* ]
* ],
* 'extra_html' => HTML content to be placed after 'filter' section.
* 'drawCallback' => function to be called after draw. Sample in:
* https://datatables.net/examples/advanced_init/row_grouping.html
* ]
* End.
*
* @return string HTML code with datatable.
* @throws Exception On error.
*/
function ui_print_datatable(array $parameters)
{
global $config;
if (isset($parameters['id'])) {
$table_id = $parameters['id'];
} else {
$table_id = uniqid('datatable_');
}
if (!isset($parameters['columns']) || !is_array($parameters['columns'])) {
throw new Exception('[ui_print_datatable]: You must define columns for datatable');
}
if (!isset($parameters['ajax_url'])) {
throw new Exception('[ui_print_datatable]: Parameter ajax_url is required');
}
if (!isset($parameters['default_pagination'])) {
$parameters['default_pagination'] = $config['block_size'];
}
$no_sortable_columns = [];
if (isset($parameters['no_sortable_columns'])) {
$no_sortable_columns = json_encode($parameters['no_sortable_columns']);
}
if (!is_array($parameters['order'])) {
$order = '0, "asc"';
} else {
if (!isset($parameters['order']['direction'])) {
$direction = 'asc';
}
if (!isset($parameters['order']['field'])) {
$order = 1;
} else {
$order = array_search(
$parameters['order']['field'],
$parameters['columns']
);
if (empty($order)) {
$order = 1;
}
}
$order .= ', "'.$parameters['order']['direction'].'"';
}
if (!isset($parameters['ajax_data'])) {
$parameters['ajax_data'] = '';
}
$search_button_class = 'sub filter';
if (isset($parameters['search_button_class'])) {
$search_button_class = $parameters['search_button_class'];
}
if (isset($parameters['pagination_options'])) {
$pagination_options = $parameters['pagination_options'];
} else {
$pagination_options = [
[
$parameters['default_pagination'],
10,
25,
100,
200,
500,
1000,
-1,
],
[
$parameters['default_pagination'],
10,
25,
100,
200,
500,
1000,
'All',
],
];
}
if (!is_array($parameters['datacolumns'])) {
$parameters['datacolumns'] = $parameters['columns'];
}
// Datatable filter.
if (isset($parameters['form']) && is_array($parameters['form'])) {
if (isset($parameters['form']['id'])) {
$form_id = $parameters['form']['id'];
} else {
$form_id = uniqid('datatable_filter_');
}
if (isset($parameters['form']['class'])) {
$form_class = $parameters['form']['class'];
} else {
$form_class = '';
}
if (isset($parameters['form']['style'])) {
$form_style = $parameters['form']['style'];
} else {
$form_style = '';
}
if (isset($parameters['form']['js'])) {
$form_js = $parameters['form']['js'];
} else {
$form_js = '';
}
$filter = '<form class="'.$form_class.'" ';
$filter .= ' id="'.$form_id.'" ';
$filter .= ' style="'.$form_style.'" ';
$filter .= ' onsubmit="'.$form_js.';return false;">';
if (isset($parameters['form']['html'])) {
$filter .= $parameters['form']['html'];
}
$filter .= '<ul class="content">';
foreach ($parameters['form']['inputs'] as $input) {
$filter .= '<li>';
$filter .= '<label>'.$input['label'].'</label>';
if ($input['type'] != 'select') {
$filter .= '<input type="'.$input['type'].'" ';
$filter .= ' value="'.$input['value'].'" ';
$filter .= ' name="'.$input['name'].'" id="'.$input['id'].'" />';
} else {
// Select.
$filter .= '<select name="'.$input['name'].'" ';
$filter .= 'id="'.$input['id'].'">';
foreach ($input['options'] as $opt => $selected) {
$filter .= '<option value="'.$opt['value'].'"';
if ($selected) {
$filter .= ' selected="yes" >';
}
$filter .= __($opt['text']).'</option>';
}
$filter .= '</select>';
}
$filter .= '</li>';
}
$filter .= '<li>';
// Search button.
$filter .= '<input type="submit" class="'.$search_button_class.'" ';
$filter .= ' id="'.$form_id.'_search_bt" value="'.__('Filter').'"/>';
// Extra buttons.
if (is_array($parameters['form']['extra_buttons'])) {
foreach ($parameters['form']['extra_buttons'] as $button) {
$filter .= '<button id="'.$button['id'].'" ';
$filter .= ' class="'.$button['class'].'" ';
$filter .= ' style="'.$button['style'].'" ';
$filter .= ' onclick="'.$button['onclick'].'" >';
$filter .= $button['text'];
$filter .= '</button>';
}
}
$filter .= '</li>';
$filter .= '</ul></form>';
$filter = ui_toggle(
$filter,
__('Filter'),
'',
'',
true,
false,
'white_box white_box_opened',
'no-border'
);
} else if (isset($parameters['form_html'])) {
$filter = ui_toggle(
$parameters['form_html'],
__('Filter'),
'',
'',
true,
false,
'white_box white_box_opened',
'no-border'
);
}
// Extra html.
$extra = '';
if (isset($parameters['extra_html']) && !empty($parameters['extra_html'])) {
$extra = $parameters['extra_html'];
}
// Base table.
$table = '<table id="'.$table_id.'" ';
$table .= 'class="'.$parameters['class'].'"';
$table .= 'style="'.$parameters['style'].'">';
$table .= '<thead><tr>';
if (isset($parameters['column_names'])
&& is_array($parameters['column_names'])
) {
$names = $parameters['column_names'];
} else {
$names = $parameters['columns'];
}
foreach ($names as $column) {
if (is_array($column)) {
$table .= '<th id="'.$column['id'].'" class="'.$column['class'].'" ';
$table .= ' style="'.$column['style'].'">'.__($column['text']);
$table .= $column['extra'];
$table .= '</th>';
} else {
$table .= '<th>'.__($column).'</th>';
}
}
$table .= '</tr></thead>';
$table .= '</table>';
$pagination_class = 'pandora_pagination';
if (!empty($parameters['pagination_class'])) {
$pagination_class = $parameters['pagination_class'];
}
// Javascript controller.
$js = '<script type="text/javascript">
$(document).ready(function(){
$.fn.dataTable.ext.errMode = "none";
$.fn.dataTable.ext.classes.sPageButton = "'.$pagination_class.'";
dt_'.$table_id.' = $("#'.$table_id.'").DataTable({
';
if (isset($parameters['drawCallback'])) {
$js .= 'drawCallback: function(settings) {
'.$parameters['drawCallback'].'
},';
}
$js .= '
processing: true,
serverSide: true,
paging: true,
pageLength: '.$parameters['default_pagination'].',
searching: false,
responsive: true,
dom: "plfrtiBp",
buttons: [
{
extend: "csv",
text : "'.__('Export current page to CSV').'",
exportOptions : {
modifier : {
// DataTables core
order : "current",
page : "All",
search : "applied"
}
}
}
],
lengthMenu: '.json_encode($pagination_options).',
ajax: {
url: "'.ui_get_full_url('ajax.php').'",
type: "POST",
dataSrc: function (json) {
if (json.error) {
console.log(json.error);
$("#error-'.$table_id.'").html(json.error);
$("#error-'.$table_id.'").dialog({
title: "Filter failed",
width: 630,
resizable: true,
draggable: true,
modal: false,
closeOnEscape: true,
buttons: {
"Ok" : function () {
$(this).dialog("close");
}
}
}).parent().addClass("ui-state-error");
} else {';
if (isset($parameters['ajax_postprocess'])) {
$js .= '
if (json.data) {
json.data.forEach(function(item) {
'.$parameters['ajax_postprocess'].'
});
} else {
json.data = {};
}';
}
$js .= '
return json.data;
}
},
data: function (data) {
inputs = $("#'.$form_id.' :input");
values = {};
inputs.each(function() {
values[this.name] = $(this).val();
})
$.extend(data, {
filter: values,'."\n";
foreach ($parameters['ajax_data'] as $k => $v) {
$js .= $k.':'.json_encode($v).",\n";
}
$js .= 'page: "'.$parameters['ajax_url'].'"
});
return data;
}
},
"columnDefs": [
{ className: "no-class", targets: "_all" },
{ bSortable: false, targets: '.$no_sortable_columns.' }
],
columns: [';
foreach ($parameters['datacolumns'] as $data) {
if (is_array($data)) {
$js .= '{data : "'.$data['text'].'",className: "'.$data['class'].'"},';
} else {
$js .= '{data : "'.$data.'",className: "no-class"},';
}
}
$js .= '
],
order: [[ '.$order.' ]]
});
$("#'.$form_id.'_search_bt").click(function (){
dt_'.$table_id.'.draw().page(0)
});
});
</script>';
// Order.
$err_msg = '<div id="error-'.$table_id.'"></div>';
$output = $err_msg.$filter.$extra.$table.$js;
ui_require_css_file('datatables.min', 'include/styles/js/');
ui_require_javascript_file('datatables.min');
ui_require_javascript_file('buttons.dataTables.min');
ui_require_javascript_file('dataTables.buttons.min');
ui_require_javascript_file('buttons.html5.min');
ui_require_javascript_file('buttons.print.min');
$output = $include.$output;
// Print datatable if needed.
if (!(isset($parameters['print']) && $parameters['print'] === false)) {
echo $output;
}
return $output;
}
/**
* Returns a div wich represents the type received.
*
@ -2919,12 +3438,15 @@ function ui_print_event_priority(
/**
* Print a code into a DIV and enable a toggle to show and hide it.
*
* @param string $code Html code.
* @param string $name Name of the link.
* @param string $title Title of the link.
* @param boolean $hidden_default If the div will be hidden by default (default: true).
* @param boolean $return Whether to return an output string or echo now (default: true).
* @param string $toggle_class Toggle class.
* @param string $code Html code.
* @param string $name Name of the link.
* @param string $title Title of the link.
* @param string $id Block id.
* @param boolean $hidden_default If the div will be hidden by default (default: true).
* @param boolean $return Whether to return an output string or echo now (default: true).
* @param string $toggle_class Toggle class.
* @param string $container_class Container class.
* @param string $main_class Main object class.
*
* @return string HTML.
*/
@ -2932,10 +3454,12 @@ function ui_toggle(
$code,
$name,
$title='',
$id='',
$hidden_default=true,
$return=false,
$toggle_class='',
$container_class='white-box-content'
$container_class='white-box-content',
$main_class='box-shadow white_table_graph'
) {
// Generate unique Id.
$uniqid = uniqid('');
@ -2952,7 +3476,7 @@ function ui_toggle(
}
// Link to toggle.
$output = '<div class="box-shadow white_table_graph">';
$output = '<div class="'.$main_class.'" id="'.$id.'">';
$output .= '<div class="white_table_graph_header" style="cursor: pointer;" id="tgl_ctrl_'.$uniqid.'">'.html_print_image(
$original,
true,
@ -3295,11 +3819,11 @@ function ui_print_page_header(
if ($godmode == true) {
$type = 'view';
$type2 = (empty($breadcrumbs)) ? 'menu_tab_frame_view' : 'menu_tab_frame_view_bc';
$type2 = 'menu_tab_frame_view';
$separator_class = 'separator';
} else {
$type = 'view';
$type2 = (empty($breadcrumbs)) ? 'menu_tab_frame_view' : 'menu_tab_frame_view_bc';
$type2 = 'menu_tab_frame_view';
$separator_class = 'separator_view';
}

View File

@ -468,7 +468,7 @@ function registration_wiz_modal(
__('Cancel'),
'cancel_registration',
false,
'class="ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel" style="color: red; width:100px;"',
'class="ui-widget ui-state-default ui-corner-all ui-button-text-only sub upd submit-cancel"',
true
);
$output .= '</div>';

View File

@ -249,13 +249,13 @@ function groups_combine_acl($acl_group_a, $acl_group_b)
/**
* Get all the groups a user has reading privileges.
*
* @param string User id
* @param string The privilege to evaluate, and it is false then no check ACL.
* @param boolean $returnAllGroup Flag the return group, by default true.
* @param boolean $returnAllColumns Flag to return all columns of groups.
* @param array $id_groups The list of group to scan to bottom child. By default null.
* @param string $keys_field The field of the group used in the array keys. By default ID
* @param boolean $cache Set it to false to not use cache
* @param string $id_user User id
* @param string $privilege The privilege to evaluate, and it is false then no check ACL.
* @param boolean $returnAllGroup Flag the return group, by default true.
* @param boolean $returnAllColumns Flag to return all columns of groups.
* @param array $id_groups The list of group to scan to bottom child. By default null.
* @param string $keys_field The field of the group used in the array keys. By default ID
* @param boolean $cache Set it to false to not use cache
*
* @return array A list of the groups the user has certain privileges.
*/

View File

@ -1966,7 +1966,7 @@ function visual_map_print_item(
echo '</tr>';
echo "<tr style='background-color:whitesmoke;height:90%;'>";
echo '<td>';
echo "<div style='margin-left:2%;color: #FFF;font-size: 12px;display:inline;background-color:#FC4444;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'>".remove_right_zeros(number_format($stat_agent_cr, 2)).'%</div>';
echo "<div style='margin-left:2%;color: #FFF;font-size: 12px;display:inline;background-color:#e63c52;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'>".remove_right_zeros(number_format($stat_agent_cr, 2)).'%</div>';
echo "<div style='background-color:white;color: black ;font-size: 12px;display:inline;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'>Critical</div>";
echo "<div style='margin-left:2%;color: #FFF;font-size: 12px;display:inline;background-color:#f8db3f;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'>".remove_right_zeros(number_format($stat_agent_wa, 2)).'%</div>';
echo "<div style='background-color:white;color: black ;font-size: 12px;display:inline;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'>Warning</div>";

View File

@ -152,12 +152,12 @@ function pandoraFlotPieCustom(
colors = colors.split(separator);
}
var colors_data = [
"#FC4444",
"#e63c52",
"#FFA631",
"#FAD403",
"#f3b200",
"#5BB6E5",
"#F2919D",
"#80BA27"
"#82b92e"
];
var color = null;
for (var i = 0; i < data.length; i++) {
@ -380,12 +380,12 @@ function pandoraFlotHBars(
max
) {
var colors_data = [
"#FC4444",
"#e63c52",
"#FFA631",
"#FAD403",
"#f3b200",
"#5BB6E5",
"#F2919D",
"#80BA27"
"#82b92e"
];
values = values.split(separator2);
font = font
@ -639,7 +639,7 @@ function pandoraFlotVBars(
var colors_data =
colors.length > 0
? colors
: ["#FFA631", "#FC4444", "#FAD403", "#5BB6E5", "#F2919D", "#80BA27"];
: ["#FFA631", "#e63c52", "#f3b200", "#5BB6E5", "#F2919D", "#82b92e"];
var datas = new Array();
for (i = 0; i < values.length; i++) {
@ -2681,13 +2681,13 @@ function pandoraFlotArea(
if (events_data.event_type.search("alert") >= 0) {
extra_color = "#FFA631";
} else if (events_data.event_type.search("critical") >= 0) {
extra_color = "#FC4444";
extra_color = "#e63c52";
} else if (events_data.event_type.search("warning") >= 0) {
extra_color = "#FAD403";
extra_color = "#f3b200";
} else if (events_data.event_type.search("unknown") >= 0) {
extra_color = "#3BA0FF";
extra_color = "#4a83f3";
} else if (events_data.event_type.search("normal") >= 0) {
extra_color = "#80BA27";
extra_color = "#82b92e";
} else {
extra_color = "#ffffff";
}

View File

@ -190,8 +190,8 @@ function d3_bullet_chart(
}
.bullet { font: 7px sans-serif; }
.bullet .marker.s0 { stroke: #FC4444; stroke-width: 2px; }
.bullet .marker.s1 { stroke: #FAD403; stroke-width: 2px; }
.bullet .marker.s0 { stroke: #e63c52; stroke-width: 2px; }
.bullet .marker.s1 { stroke: #f3b200; stroke-width: 2px; }
.bullet .marker.s2 { stroke: steelblue; stroke-width: 2px; }
.bullet .tick line { stroke: #666; stroke-width: .5px; }
.bullet .range.s0 { fill: #ddd; }

View File

@ -1614,9 +1614,9 @@ function print_phases_donut(recipient, phases) {
.insert("path")
.style("fill", function(d) {
if (d.data.value == 0) {
return "#80BA27";
return "#82b92e";
} else {
return "#FC4444";
return "#e63c52";
}
})
.attr("class", "slice");
@ -2849,7 +2849,6 @@ function donutNarrowGraph(colores, width, height, total) {
})
.attr("d", arc)
.attr("stroke", "white")
.style("stroke-width", 2)
.style("fill", function(d) {
return color(d.data.key);
});
@ -2873,8 +2872,6 @@ function donutNarrowGraph(colores, width, height, total) {
.attr("y", 0 + radius / 10)
.attr("class", "text-tooltip")
.style("text-anchor", "middle")
.attr("font-weight", "bold")
.style("font-family", "Arial, Verdana")
//.attr("fill", "#82b92e")
.style("font-size", function(d) {
if (normal_status) {

View File

@ -0,0 +1,5 @@
/*!
DataTables styling wrapper for Buttons
©2018 SpryMedia Ltd - datatables.net/license
*/
(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-dt","datatables.net-buttons"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);b&&b.fn.dataTable||(b=require("datatables.net-dt")(a,b).$);b.fn.dataTable.Buttons||require("datatables.net-buttons")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c,a,b,d){return c.fn.dataTable});

View File

@ -0,0 +1,9 @@
/*!
Print button for Buttons and DataTables.
2016 SpryMedia Ltd - datatables.net/license
*/
(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(e){return c(e,window,document)}):"object"===typeof exports?module.exports=function(e,a){e||(e=window);a&&a.fn.dataTable||(a=require("datatables.net")(e,a).$);a.fn.dataTable.Buttons||require("datatables.net-buttons")(e,a);return c(a,e,e.document)}:c(jQuery,window,document)})(function(c,e,a,q){var k=c.fn.dataTable,d=a.createElement("a"),p=function(b){d.href=b;b=d.host;-1===b.indexOf("/")&&
0!==d.pathname.indexOf("/")&&(b+="/");return d.protocol+"//"+b+d.pathname+d.search};k.ext.buttons.print={className:"buttons-print",text:function(b){return b.i18n("buttons.print","Print")},action:function(b,a,d,g){b=a.buttons.exportData(c.extend({decodeEntities:!1},g.exportOptions));d=a.buttons.exportInfo(g);var k=a.columns(g.exportOptions.columns).flatten().map(function(b){return a.settings()[0].aoColumns[a.column(b).index()].sClass}).toArray(),m=function(b,a){for(var d="<tr>",c=0,e=b.length;c<e;c++)d+=
"<"+a+" "+(k[c]?'class="'+k[c]+'"':"")+">"+(null===b[c]||b[c]===q?"":b[c])+"</"+a+">";return d+"</tr>"},h='<table class="'+a.table().node().className+'">';g.header&&(h+="<thead>"+m(b.header,"th")+"</thead>");h+="<tbody>";for(var n=0,r=b.body.length;n<r;n++)h+=m(b.body[n],"td");h+="</tbody>";g.footer&&b.footer&&(h+="<tfoot>"+m(b.footer,"th")+"</tfoot>");h+="</table>";var f=e.open("","");f.document.close();var l="<title>"+d.title+"</title>";c("style, link").each(function(){var b=l,a=c(this).clone()[0];
"link"===a.nodeName.toLowerCase()&&(a.href=p(a.href));l=b+a.outerHTML});try{f.document.head.innerHTML=l}catch(t){c(f.document.head).html(l)}f.document.body.innerHTML="<h1>"+d.title+"</h1><div>"+(d.messageTop||"")+"</div>"+h+"<div>"+(d.messageBottom||"")+"</div>";c(f.document.body).addClass("dt-print-view");c("img",f.document.body).each(function(b,a){a.setAttribute("src",p(a.getAttribute("src")))});g.customize&&g.customize(f,g,a);b=function(){g.autoPrint&&(f.print(),f.close())};navigator.userAgent.match(/Trident\/\d.\d/)?
b():f.setTimeout(b,1E3)},title:"*",messageTop:"*",messageBottom:"*",exportOptions:{},header:!0,footer:!1,autoPrint:!0,customize:null};return k.Buttons});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -669,7 +669,7 @@ function update_link(row_index, id_link) {
temp_link["arrow_start"] = "module";
temp_link["id_module_start"] = interface_source;
temp_link["status_start"] = data["status"];
temp_link["link_color"] = data["status"] == "1" ? "#FC4444" : "#999";
temp_link["link_color"] = data["status"] == "1" ? "#e63c52" : "#999";
} else {
temp_link["arrow_start"] = "";
temp_link["id_agent_start"] = interface_source;
@ -679,7 +679,7 @@ function update_link(row_index, id_link) {
temp_link["arrow_end"] = "module";
temp_link["id_module_end"] = interface_target;
temp_link["status_end"] = data["status"];
temp_link["link_color"] = data["status"] == "1" ? "#FC4444" : "#999";
temp_link["link_color"] = data["status"] == "1" ? "#e63c52" : "#999";
} else {
temp_link["arrow_end"] = "";
temp_link["id_agent_end"] = interface_target;
@ -2329,7 +2329,7 @@ function add_interface_link_js() {
temp_link["id_module_start"] = source_value;
temp_link["status_start"] = data["status_start"];
temp_link["link_color"] =
data["status_start"] == "1" ? "#FC4444" : "#999";
data["status_start"] == "1" ? "#e63c52" : "#999";
} else {
temp_link["arrow_start"] = "";
temp_link["id_agent_start"] = source_value;
@ -2340,7 +2340,7 @@ function add_interface_link_js() {
temp_link["id_module_end"] = target_value;
temp_link["status_end"] = data["status_end"];
temp_link["link_color"] =
data["status_end"] == "1" ? "#FC4444" : "#999";
data["status_end"] == "1" ? "#e63c52" : "#999";
} else {
temp_link["arrow_end"] = "";
temp_link["id_agent_end"] = target_value;

View File

@ -1599,7 +1599,7 @@ function paint_graph_status(
.attr("y", height_x - 30)
.attr("width", 10)
.attr("height", 10)
.style("fill", "#fc4444");
.style("fill", "#e63c52");
//styles for number and axes
svg
@ -1683,7 +1683,7 @@ function paint_graph_status(
)
.attr("width", 300)
.attr("height", (max_c - min_c) * position)
.style("fill", "#fc4444");
.style("fill", "#e63c52");
} else {
svg
.append("g")
@ -1695,7 +1695,7 @@ function paint_graph_status(
.attr("y", height_x + 200 - (min_c - range_min) * position)
.attr("width", 300)
.attr("height", (min_c - range_min) * position)
.style("fill", "#fc4444");
.style("fill", "#e63c52");
svg
.append("g")
.append("rect")
@ -1709,7 +1709,7 @@ function paint_graph_status(
"height",
(range_max - min_c) * position - (max_c - min_c) * position
)
.style("fill", "#fc4444");
.style("fill", "#e63c52");
}
} else {
d3.select("#svg_dinamic rect").remove();

View File

@ -1,18 +1,28 @@
/*global jQuery,$,forced_title_callback,Base64, dt_events*/
// Show the modal window of an event
function show_event_dialog(event_id, group_rep, dialog_page, result) {
var current_event;
function show_event_dialog(event, dialog_page, result) {
var ajax_file = $("#hidden-ajax_file").val();
if (dialog_page == undefined) {
dialog_page = "general";
}
var similar_ids = $("#hidden-similar_ids_" + event_id).val();
var timestamp_first = $("#hidden-timestamp_first_" + event_id).val();
var timestamp_last = $("#hidden-timestamp_last_" + event_id).val();
var user_comment = $("#hidden-user_comment_" + event_id).val();
var event_rep = $("#hidden-event_rep_" + event_id).val();
var server_id = $("#hidden-server_id_" + event_id).val();
var childrens_ids = $("#hidden-childrens_ids").val();
current_event = event;
try {
event = JSON.parse(atob(event));
} catch (e) {
console.error(e);
return;
}
var inputs = $("#events_form :input");
var values = {};
inputs.each(function() {
values[this.name] = $(this).val();
});
// Metaconsole mode flag
var meta = $("#hidden-meta").val();
@ -25,26 +35,19 @@ function show_event_dialog(event_id, group_rep, dialog_page, result) {
{
page: "include/ajax/events",
get_extended_event: 1,
group_rep: group_rep,
event_rep: event_rep,
dialog_page: dialog_page,
similar_ids: similar_ids,
timestamp_first: timestamp_first,
timestamp_last: timestamp_last,
user_comment: user_comment,
event_id: event_id,
server_id: server_id,
event: event,
meta: meta,
childrens_ids: childrens_ids,
history: history
history: history,
filter: values
},
function(data, status) {
function(data) {
$("#event_details_window")
.hide()
.empty()
.append(data)
.dialog({
title: get_event_name(event_id, meta, history),
title: event.evento,
resizable: true,
draggable: true,
modal: true,
@ -56,8 +59,8 @@ function show_event_dialog(event_id, group_rep, dialog_page, result) {
opacity: 0.5,
background: "black"
},
width: 725,
height: 530
width: 710,
height: 600
})
.show();
@ -92,45 +95,6 @@ function show_event_dialog(event_id, group_rep, dialog_page, result) {
return false;
}
function show_save_filter_dialog() {
$('input:radio[name="filter_mode"]')
.filter('[value="new"]')
.trigger("click");
$("#save_filter_layer")
.dialog({
title: $("#save_filter_text").html(),
resizable: true,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
width: 688,
height: 200
})
.show();
return false;
}
function show_load_filter_dialog() {
$("#load_filter_layer")
.dialog({
title: $("#load_filter_text").html(),
resizable: true,
draggable: true,
modal: true,
overlay: {
opacity: 0.5,
background: "black"
},
width: 520,
height: 300
})
.show();
return false;
}
// Check the response type and open it in a modal dialog or new window
function execute_response(event_id, server_id) {
var response_id = $("#select_custom_response option:selected").val();
@ -160,8 +124,6 @@ function execute_response(event_id, server_id) {
//Show the modal window of an event response
function show_response_dialog(event_id, response_id, response) {
var ajax_file = $("#hidden-ajax_file").val();
var params = [];
params.push("page=include/ajax/events");
params.push("dialogue_event_response=1");
@ -173,7 +135,7 @@ function show_response_dialog(event_id, response_id, response) {
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
dataType: "html",
success: function(data) {
$("#event_response_window")
@ -185,7 +147,7 @@ function show_response_dialog(event_id, response_id, response) {
resizable: true,
draggable: true,
modal: false,
open: function(event, ui) {
open: function() {
perform_response(response["target"], response_id);
},
width: response["modal_width"],
@ -204,8 +166,6 @@ function show_massive_response_dialog(
out_iterator,
end
) {
var ajax_file = $("#hidden-ajax_file").val();
var params = [];
params.push("page=include/ajax/events");
params.push("dialogue_event_response=1");
@ -222,7 +182,7 @@ function show_massive_response_dialog(
response_id: response_id,
out_iterator: out_iterator,
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
dataType: "html",
success: function(data) {
if (out_iterator === 0) $("#event_response_window").empty();
@ -235,11 +195,11 @@ function show_massive_response_dialog(
resizable: true,
draggable: true,
modal: false,
open: function(event, ui) {
open: function() {
$("#response_loading_dialog").hide();
$("#button-submit_event_response").show();
},
close: function(event, ui) {
close: function() {
$(".chk_val").prop("checked", false);
$("#event_response_command_window").dialog("close");
},
@ -259,8 +219,6 @@ function show_massive_response_dialog(
// Get an event response from db
function get_response(response_id) {
var ajax_file = $("#hidden-ajax_file").val();
var response = "";
var params = [];
@ -271,7 +229,7 @@ function get_response(response_id) {
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
async: false,
timeout: 10000,
dataType: "json",
@ -285,8 +243,6 @@ function get_response(response_id) {
// Get an event response params from db
function get_response_params(response_id) {
var ajax_file = $("#hidden-ajax_file").val();
var response_params;
var params = [];
@ -297,7 +253,7 @@ function get_response_params(response_id) {
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
async: false,
timeout: 10000,
dataType: "json",
@ -311,8 +267,6 @@ function get_response_params(response_id) {
// Get an event response description from db
function get_response_description(response_id) {
var ajax_file = $("#hidden-ajax_file").val();
var response_description = "";
var params = [];
@ -323,7 +277,7 @@ function get_response_description(response_id) {
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
async: false,
timeout: 10000,
dataType: "html",
@ -337,8 +291,6 @@ function get_response_description(response_id) {
// Get an event response description from db
function get_event_name(event_id, meta, history) {
var ajax_file = $("#hidden-ajax_file").val();
var name = "";
var params = [];
@ -351,7 +303,7 @@ function get_event_name(event_id, meta, history) {
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
async: false,
timeout: 10000,
dataType: "html",
@ -382,8 +334,6 @@ function get_response_target(
server_id,
response_command
) {
var ajax_file = $("#hidden-ajax_file").val();
var target = "";
// Replace the main macros
@ -397,7 +347,7 @@ function get_response_target(
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
async: false,
timeout: 10000,
dataType: "html",
@ -409,7 +359,7 @@ function get_response_target(
// Replace the custom params macros.
var response_params = get_response_params(response_id);
if (response_params.length > 1 || response_params[0] != "") {
for (i = 0; i < response_params.length; i++) {
for (var i = 0; i < response_params.length; i++) {
if (!response_command) {
target = target.replace(
"_" + response_params[i] + "_",
@ -429,16 +379,10 @@ function get_response_target(
// Perform a response and put the output into a div
function perform_response(target, response_id) {
var ajax_file = $("#hidden-ajax_file").val();
$("#re_exec_command").hide();
$("#response_loading_command").show();
$("#response_out").html("");
var finished = 0;
var time = Math.round(+new Date() / 1000);
var timeout = time + 10;
var params = [];
params.push("page=include/ajax/events");
params.push("perform_event_response=1");
@ -448,7 +392,7 @@ function perform_response(target, response_id) {
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
async: true,
timeout: 10000,
dataType: "html",
@ -465,8 +409,6 @@ function perform_response(target, response_id) {
// Perform a response and put the output into a div
function perform_response_massive(target, response_id, out_iterator) {
var ajax_file = $("#hidden-ajax_file").val();
$("#re_exec_command").hide();
$("#response_loading_command_" + out_iterator).show();
$("#response_out_" + out_iterator).html("");
@ -480,7 +422,7 @@ function perform_response_massive(target, response_id, out_iterator) {
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
async: true,
timeout: 10000,
dataType: "html",
@ -497,8 +439,6 @@ function perform_response_massive(target, response_id, out_iterator) {
// Change the status of an event to new, in process or validated.
function event_change_status(event_ids) {
var ajax_file = $("#hidden-ajax_file").val();
var new_status = $("#estado").val();
var event_id = $("#hidden-id_event").val();
var meta = $("#hidden-meta").val();
@ -518,7 +458,7 @@ function event_change_status(event_ids) {
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
async: true,
timeout: 10000,
dataType: "html",
@ -531,9 +471,6 @@ function event_change_status(event_ids) {
"responses",
data
);
if (data == "status_ok") {
} else {
}
}
});
return false;
@ -541,8 +478,6 @@ function event_change_status(event_ids) {
// Change te owner of an event to one user of empty
function event_change_owner() {
var ajax_file = $("#hidden-ajax_file").val();
var event_id = $("#hidden-id_event").val();
var new_owner = $("#id_owner").val();
var meta = $("#hidden-meta").val();
@ -562,7 +497,7 @@ function event_change_owner() {
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
async: true,
timeout: 10000,
dataType: "html",
@ -584,20 +519,21 @@ function event_change_owner() {
// Save a comment into an event
function event_comment() {
var ajax_file = $("#hidden-ajax_file").val();
var event;
try {
event = JSON.parse(atob(current_event));
} catch (e) {
console.error(e);
return;
}
var event_id = $("#hidden-id_event").val();
var event_id = event.id_evento;
var comment = $("#textarea_comment").val();
var meta = $("#hidden-meta").val();
var history = $("#hidden-history").val();
if (comment == "") {
show_event_dialog(
event_id,
$("#hidden-group_rep").val(),
"comments",
"comment_error"
);
show_event_dialog(current_event, "comments", "comment_error");
return false;
}
@ -615,20 +551,15 @@ function event_comment() {
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
async: true,
timeout: 10000,
dataType: "html",
success: function(data) {
$("#button-comment_button").removeAttr("disabled");
$("#response_loading").show();
show_event_dialog(
event_id,
$("#hidden-group_rep").val(),
"comments",
data
);
dt_events.draw(false);
show_event_dialog(current_event, "comments", data);
}
});
@ -637,8 +568,7 @@ function event_comment() {
//Show event list when fielter repetead is Group agents
function show_events_group_agent(id_insert, id_agent, server_id) {
var ajax_file = $("#hidden-ajax_file").val();
parameter = [];
var parameter = [];
parameter.push({ name: "id_agent", value: id_agent });
parameter.push({ name: "server_id", value: server_id });
parameter.push({ name: "event_type", value: $("#event_type").val() });
@ -680,7 +610,7 @@ function show_events_group_agent(id_insert, id_agent, server_id) {
jQuery.ajax({
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
data: parameter,
dataType: "html",
success: function(data) {
@ -691,8 +621,6 @@ function show_events_group_agent(id_insert, id_agent, server_id) {
}
function show_event_response_command_dialog(id, response, total_checked) {
var ajax_file = $("#hidden-ajax_file").val();
var params = [];
params.push("page=include/ajax/events");
params.push("get_table_response_command=1");
@ -701,7 +629,7 @@ function show_event_response_command_dialog(id, response, total_checked) {
jQuery.ajax({
data: params.join("&"),
type: "POST",
url: (action = ajax_file),
url: $("#hidden-ajax_file").val(),
dataType: "html",
success: function(data) {
$("#event_response_command_window")
@ -739,3 +667,230 @@ function show_event_response_command_dialog(id, response, total_checked) {
}
});
}
var processed = 0;
function update_event(table, id_evento, type, event_rep, row) {
var inputs = $("#events_form :input");
var values = {};
var redraw = false;
inputs.each(function() {
values[this.name] = $(this).val();
});
var t1 = new Date();
// Update events matching current filters and id_evento selected.
$.ajax({
async: true,
timeout: 10000,
type: "POST",
url: $("#hidden-ajax_file").val(),
data: {
page: "include/ajax/events",
validate_event: type.validate_event,
in_process_event: type.in_process_event,
delete_event: type.delete_event,
id_evento: id_evento,
event_rep: event_rep,
filter: values
},
success: function(d) {
processed += 1;
var t2 = new Date();
var diff_g = t2.getTime() - t1.getTime();
var diff_s = diff_g / 1000;
if (processed >= $(".chk_val:checked").length) {
// If operation takes less than 2 seconds, redraw.
if (diff_s < 2) {
redraw = true;
}
if (redraw) {
table.draw(false);
} else {
$(row)
.closest("tr")
.remove();
}
}
},
error: function() {
processed += 1;
}
});
}
function validate_event(table, id_evento, event_rep, row) {
var button = document.getElementById("val-" + id_evento);
if (!button) {
// Button does not exist. Ignore.
return;
}
button.children[0];
button.children[0].src = "images/spinner.gif";
return update_event(table, id_evento, { validate_event: 1 }, event_rep, row);
}
function in_process_event(table, id_evento, event_rep, row) {
var button = document.getElementById("proc-" + id_evento);
if (!button) {
// Button does not exist. Ignore.
return;
}
button.children[0];
button.children[0].src = "images/spinner.gif";
return update_event(
table,
id_evento,
{ in_process_event: 1 },
event_rep,
row
);
}
function delete_event(table, id_evento, event_rep, row) {
var button = document.getElementById("del-" + id_evento);
if (!button) {
// Button does not exist. Ignore.
return;
}
button.children[0];
button.children[0].src = "images/spinner.gif";
return update_event(table, id_evento, { delete_event: 1 }, event_rep, row);
}
// Imported from old files.
function execute_event_response(event_list_btn) {
processed = 0;
$("#max_custom_event_resp_msg").hide();
$("#max_custom_selected").hide();
var response_id = $("select[name=response_id]").val();
var total_checked = $(".chk_val:checked").length;
// Check select an event.
if (total_checked == 0) {
$("#max_custom_selected").show();
return;
}
if (!isNaN(response_id)) {
// It is a custom response
var response = get_response(response_id);
// If cannot get response abort it
if (response == null) {
return;
}
// Limit number of events to apply custom responses
// due performance reasons.
if (total_checked > $("#max_execution_event_response").val()) {
$("#max_custom_event_resp_msg").show();
return;
}
var response_command = [];
$(".response_command_input").each(function() {
response_command[$(this).attr("name")] = $(this).val();
});
if (event_list_btn) {
$("#button-submit_event_response").hide(function() {
$("#response_loading_dialog").show(function() {
var check_params = get_response_params(response_id);
if (check_params[0] !== "") {
show_event_response_command_dialog(
response_id,
response,
total_checked
);
} else {
check_massive_response_event(
response_id,
response,
total_checked,
response_command
);
}
});
});
} else {
$("#button-btn_str").hide(function() {
$("#execute_again_loading").show(function() {
check_massive_response_event(
response_id,
response,
total_checked,
response_command
);
});
});
}
} else {
// It is not a custom response
switch (response_id) {
case "in_progress_selected":
$(".chk_val:checked").each(function() {
// Parent: TD. GrandParent: TR.
in_process_event(
dt_events,
$(this).val(),
$(this).attr("event_rep"),
this.parentElement.parentElement
);
});
break;
case "validate_selected":
$(".chk_val:checked").each(function() {
validate_event(
dt_events,
$(this).val(),
$(this).attr("event_rep"),
this.parentElement.parentElement
);
});
break;
case "delete_selected":
$(".chk_val:checked").each(function() {
delete_event(
dt_events,
$(this).val(),
$(this).attr("event_rep"),
this.parentElement.parentElement
);
});
break;
}
}
}
function check_massive_response_event(
response_id,
response,
total_checked,
response_command
) {
var counter = 0;
var end = 0;
$(".chk_val:checked").each(function() {
var event_id = $(this).val();
var server_id = $("#hidden-server_id_" + event_id).val();
response["target"] = get_response_target(
event_id,
response_id,
server_id,
response_command
);
if (total_checked - 1 === counter) end = 1;
show_massive_response_dialog(event_id, response_id, response, counter, end);
counter++;
});
}

View File

@ -67,6 +67,13 @@ function createVisualConsole(
? JSON.parse(data.items)
: data.items;
// Add the datetime when the item was received.
var receivedAt = new Date();
items.map(function(item) {
item["receivedAt"] = receivedAt;
return item;
});
var prevProps = visualConsole.props;
// Update the data structure.
visualConsole.props = props;

View File

@ -44,7 +44,7 @@ function form_upload(homeurl) {
"<li>" +
'<input type="text" id="input-progress" ' +
'value="0" data-width="55" data-height="55" ' +
'data-fgColor="#80BA27" data-readOnly="1" ' +
'data-fgColor="#82b92e" data-readOnly="1" ' +
'data-bgColor="#3E4043" />' +
"<p></p><span></span>" +
"</li>"

View File

@ -355,7 +355,7 @@ final class Group extends Item
'color: #FFF;',
'font-size: 12px;',
'display: inline;',
'background-color: #FC4444;',
'background-color: #e63c52;',
'position: relative;',
'height: 80%;',
'width: 9.4%;',
@ -389,7 +389,7 @@ final class Group extends Item
$html .= '<td>';
// Critical.
$html .= '<div style="'.$valueStyle.'background-color: #FC4444;">';
$html .= '<div style="'.$valueStyle.'background-color: #e63c52;">';
$html .= \number_format($agentStats['critical'], 2).'%';
$html .= '</div>';
$html .= '<div style="'.$nameStyle.'">'.__('Critical').'</div>';

View File

@ -16,6 +16,7 @@
.agent_options_update {
width: 85%;
margin-right: 20px;
min-width: 640px;
}
.agent_options_column_left,
@ -43,6 +44,20 @@ a#qr_code_agent_view {
margin-top: 5px;
}
.p-switch {
margin-right: 1em;
}
.sg_source,
.sg_target {
width: 35%;
}
.sg_source select,
.sg_target select {
width: 100%;
}
.first_row .agent_options_column_right select,
.first_row .agent_options_column_right input,
.first_row .agent_options_column_left select#grupo {
@ -100,38 +115,44 @@ a#qr_code_agent_view {
}
.custom_fields_table .custom_field_row_opened td {
border-bottom-left-radius: 0px !important;
border-bottom-right-radius: 0px !important;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
.secondary_groups_select {
.adv_right,
.adv_left,
.secondary_groups_list {
flex: 1;
}
.secondary_groups_list {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
margin-bottom: 15px;
flex-wrap: wrap;
min-width: 640px;
}
.secondary_group_arrows {
display: flex;
flex-direction: column;
padding: 0 2em;
}
.secondary_groups_select .secondary_groups_select_arrows input {
display: grid;
margin: 0 auto;
.no-border.flex {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: start;
align-items: start;
}
.secondary_groups_select .secondary_groups_list_left {
text-align: right;
width: 50%;
.no-border.flex > div {
margin: 1em;
}
.secondary_groups_select .secondary_groups_list_right {
text-align: left;
width: 50%;
}
.secondary_groups_select .secondary_groups_select_arrows {
padding: 0 50px;
}
.secondary_groups_select_arrows a {
display: block;
.adv_left input,
.adv_left select {
width: 100%;
}
.agent_options_adv .agent_options_column_right .label_select select,
@ -147,12 +168,16 @@ a#qr_code_agent_view {
}
.agent_description {
min-height: 4.8em !important;
min-height: 4.8em;
}
.agent_custom_id {
padding-bottom: 0.7em;
padding-top: 0.5em;
display: inline-block;
border-radius: 5px !important;
border-radius: 5px;
border: 1px solid #ccc;
}
#safe_mode_module {
margin-top: 0.6em;
}

View File

@ -1,13 +1,14 @@
text.text-tooltip {
font-family: "lato-bolder", "Open Sans", sans-serif !important;
font-family: "lato-bolder", "Open Sans", sans-serif;
font-weight: bold;
}
div#bullets_modules span {
font-family: "lato-bolder", "Open Sans", sans-serif !important;
font-family: "lato-bolder", "Open Sans", sans-serif;
}
table#agent_interface_info .noresizevc.graph {
width: 500px !important;
width: 500px;
}
div.agent_details_agent_alias {
@ -15,5 +16,66 @@ div.agent_details_agent_alias {
}
div.agent_details_agent_alias * {
font-family: "lato-bolder", "Open Sans", sans-serif !important;
font-family: "lato-bolder", "Open Sans", sans-serif;
}
#module_list {
width: 100%;
}
#module_filter_agent_view tr td {
padding-bottom: 3em;
}
#div_all_events_24h {
border-bottom: 1px solid #ebebeb;
padding-bottom: 3em;
}
#rect1,
#rect2 {
z-index: 10;
position: absolute;
height: 238px;
width: 0px;
background: #3d84a8;
}
.agent-animation {
height: 300px;
width: 600px;
background: #3d84a8;
border-radius: 3px;
position: relative;
padding: 32px;
}
.agent-animation:before {
content: "";
position: absolute;
left: 30px;
top: 30px;
height: 240px;
width: 2px;
background: #48466d;
}
.agent-animation:after {
content: "";
position: absolute;
left: 30px;
bottom: 30px;
height: 2px;
width: 540px;
background: #48466d;
}
.agent-animation svg {
position: absolute;
left: 32px;
top: 30px;
width: 540px !important;
}
.agent-animation svg .cls-1 {
fill: none;
stroke: #abedd8;
stroke-miterlimit: 10;
stroke-width: 2px;
}

View File

@ -1,7 +1,7 @@
/* Debug styles */
pre.debug,
div.backtrace {
font-family: monospace !important;
font-family: monospace;
text-align: left;
padding: 10px;
margin: 5px;
@ -66,9 +66,9 @@ img.right {
text-align: right;
}
.noshadow {
-moz-box-shadow: 0px !important;
-webkit-box-shadow: 0px !important;
box-shadow: 0px !important;
-moz-box-shadow: 0px;
-webkit-box-shadow: 0px;
box-shadow: 0px;
}
.center_align {
text-align: center;

View File

@ -1,38 +1,38 @@
/* This file skins dialog */
.ui-dialog {
background: none repeat scroll 0 0 #3f3f3f !important;
border: 1px solid #3f3f3f !important;
color: #333333 !important;
padding: 0.2em !important;
overflow: hidden !important;
background: none repeat scroll 0 0 #3f3f3f;
border: 1px solid #3f3f3f;
color: #333333;
padding: 0.2em;
overflow: hidden;
-moz-border-radius: 6px !important;
-webkit-border-radius: 6px !important;
border-radius: 6px !important;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
-moz-box-shadow: 0px 5px 5px #010e1b !important;
-webkit-box-shadow: 0px 5px 5px #010e1b !important;
box-shadow: 0px 5px 5px #010e1b !important;
-moz-box-shadow: 0px 5px 5px #010e1b;
-webkit-box-shadow: 0px 5px 5px #010e1b;
box-shadow: 0px 5px 5px #010e1b;
}
.ui-widget-header {
background: #3f3f3f !important;
background: #3f3f3f;
}
.ui-dialog .ui-dialog-titlebar {
background-color: #ececec;
height: 24px !important;
padding: 0.3em 1em !important;
height: 24px;
padding: 0.3em 1em;
position: relative;
margin: 0px auto 0 auto !important;
font-weight: bold !important;
border-bottom: none !important;
border-top: none !important;
border-left: none !important;
border-right: none !important;
color: #ffffff !important;
#padding: 0.1em 1em !important;
margin: 0px auto 0 auto;
font-weight: bold;
border-bottom: none;
border-top: none;
border-left: none;
border-right: none;
color: #ffffff;
#padding: 0.1em 1em;
-moz-border-radius: 4px 4px 0 0;
-webkit-border-radius: 4px 4px 0 0;
@ -40,114 +40,114 @@
}
.ui-dialog .ui-dialog-title {
margin-left: 5px !important;
color: white !important;
font-weight: bold !important;
position: relative !important;
margin-left: 5px;
color: white;
font-weight: bold;
position: relative;
top: 3px;
font-size: 10pt;
left: 4px !important;
float: none !important;
left: 4px;
float: none;
}
.ui-dialog.ui-draggable .ui-dialog-titlebar {
cursor: move !important;
cursor: move;
}
.ui-dialog .ui-dialog-titlebar-close {
width: 23px !important;
height: 23px !important;
background: url(images/dialog-titlebar-close.png) no-repeat !important;
position: absolute !important;
width: 23px;
height: 23px;
background: url(images/dialog-titlebar-close.png) no-repeat;
position: absolute;
top: 6px;
right: 3px !important;
cursor: pointer !important;
right: 3px;
cursor: pointer;
}
.ui-dialog .ui-dialog-titlebar-close span {
display: none !important;
display: none;
}
.ui-dialog .ui-dialog-titlebar-close-hover {
color: #000000 !important;
color: #000000;
}
.ui-dialog .ui-dialog-titlebar-close:hover span {
display: none !important;
display: none;
}
.ui-dialog .ui-dialog-titlebar-close:hover {
color: #000000 !important;
color: #000000;
}
.ui-dialog .ui-dialog-content {
margin: 12px !important;
#padding: 0.5em 1em !important;
overflow: auto !important;
margin: 12px;
#padding: 0.5em 1em;
overflow: auto;
-moz-border-left: 1px solid #a9a9a9 !important;
-moz-border-right: 1px solid #a9a9a9 !important;
-moz-border-bottom: 1px solid #a9a9a9 !important;
-moz-border-radius: 8px 8px 8px 8px !important;
-moz-border-left: 1px solid #a9a9a9;
-moz-border-right: 1px solid #a9a9a9;
-moz-border-bottom: 1px solid #a9a9a9;
-moz-border-radius: 8px 8px 8px 8px;
-webkit-border-left: 1px solid #a9a9a9 !important;
-webkit-border-right: 1px solid #a9a9a9 !important;
-webkit-border-bottom: 1px solid #a9a9a9 !important;
-webkit-border-radius: 8px 8px 8px 8px !important;
-webkit-border-left: 1px solid #a9a9a9;
-webkit-border-right: 1px solid #a9a9a9;
-webkit-border-bottom: 1px solid #a9a9a9;
-webkit-border-radius: 8px 8px 8px 8px;
border-left: 1px solid #a9a9a9 !important;
border-right: 1px solid #a9a9a9 !important;
border-bottom: 1px solid #a9a9a9 !important;
border-radius: 8px 8px 8px 8px !important;
border-left: 1px solid #a9a9a9;
border-right: 1px solid #a9a9a9;
border-bottom: 1px solid #a9a9a9;
border-radius: 8px 8px 8px 8px;
background: #ffffff !important;
position: relative !important;
background: #ffffff;
position: relative;
}
.ui-tabs .ui-tabs-nav {
background-color: white !important;
background-color: white;
}
.ui-tabs-panel {
background: #ececec !important;
-moz-border-radius: 8px !important;
-webkit-border-radius: 8px !important;
border-radius: 8px !important;
-moz-border-top-left-radius: 0px !important;
-webkit-border-top-left-radius: 0px !important;
border-top-left-radius: 0px !important;
background: #ececec;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
-moz-border-top-left-radius: 0px;
-webkit-border-top-left-radius: 0px;
border-top-left-radius: 0px;
-moz-box-shadow: -1px 1px 6px #aaa;
-webkit-box-shadow: -1px 1px 6px #aaa;
box-shadow: 1px 1px 6px #aaa;
}
.ui-widget .ui-widget {
border: 0px !important;
border: 0px;
}
.ui-state-default:first-child {
margin-left: -3px !important;
margin-left: -3px;
}
.ui-state-default {
background: #fff !important;
border: 2px solid #ececec !important;
-moz-border-top-left-radius: 10px !important;
-webkit-top-left-border-radius: 10px !important;
border-top-left-radius: 10px !important;
-moz-border-top-right-radius: 10px !important;
-webkit-top-right-border-radius: 10px !important;
border-top-right-radius: 10px !important;
margin-left: 2px !important;
background: #fff;
border: 2px solid #ececec;
-moz-border-top-left-radius: 10px;
-webkit-top-left-border-radius: 10px;
border-top-left-radius: 10px;
-moz-border-top-right-radius: 10px;
-webkit-top-right-border-radius: 10px;
border-top-right-radius: 10px;
margin-left: 2px;
}
.ui-state-active {
background: #ececec !important;
background: #ececec;
}
.ui-dialog-content {
overflow: auto !important;
width: auto !important;
#height: auto !important;
overflow: auto;
width: auto;
#height: auto;
}
.ui-dialog .ui-dialog-buttonpane {
@ -185,8 +185,8 @@
font-weight: bold;
outline: medium none;
cursor: pointer;
margin: 0.5em 0.4em 0.5em 0 !important;
border-radius: 4px 4px 4px 4px !important;
margin: 0.5em 0.4em 0.5em 0;
border-radius: 4px 4px 4px 4px;
}
.ui-dialog .ui-button-dialog:hover {
@ -199,5 +199,5 @@
.ui-dialog-overlay {
background: url("images/ui-bg_diagonals-thick_20_666666_40x40.png") repeat
scroll 50% 50% #666666 !important;
scroll 50% 50% #666666;
}

View File

@ -6,7 +6,6 @@ li.discovery {
display: inline-block;
float: left;
width: 250px;
height: 120px;
margin: 15px;
padding-bottom: 50px;
}
@ -28,7 +27,7 @@ li.discovery > a label {
}
div.data_container > label {
font-family: "lato-bolder", "Open Sans", sans-serif !important;
font-family: "lato-bolder", "Open Sans", sans-serif;
font-weight: lighter;
}
@ -117,7 +116,7 @@ div.arrow_box:before {
min-height: 55px;
width: 100%;
padding-right: 0px;
margin-left: 0px !important;
margin-left: 0px;
margin-bottom: 20px;
height: 55px;
box-sizing: border-box;
@ -132,21 +131,21 @@ div.arrow_box:before {
}
.breadcrumbs_container {
padding-left: 10px;
padding-top: 4px;
text-indent: 0.25em;
padding-left: 2.5em;
}
.breadcrumb_link {
color: #848484;
font-size: 10pt !important;
font-family: "lato-bolder", "Open Sans", sans-serif !important;
text-decoration: none !important;
font-size: 10pt;
font-family: "lato-bolder", "Open Sans", sans-serif;
text-decoration: none;
}
span.breadcrumb_link {
color: #d0d0d0;
font-size: 12pt !important;
font-size: 12pt;
}
.breadcrumb_link.selected {
@ -168,6 +167,11 @@ form.discovery * {
font-size: 10pt;
}
form.discovery .label_select b {
font-family: "lato", "Open Sans", sans-serif;
font-weight: bolder;
}
.edit_discovery_info {
display: flex;
align-items: flex-start;
@ -188,7 +192,7 @@ form.discovery * {
}
label {
color: #343434 !important;
color: #343434;
font-weight: bold;
}
@ -201,11 +205,11 @@ li > input[type="password"],
.discovery_text_input > input[type="password"],
.discovery_text_input > input[type="text"],
#interval_manual > input[type="text"] {
background-color: transparent !important;
background-color: transparent;
border: none;
border-radius: 0 !important;
border-radius: 0;
border-bottom: 1px solid #ccc;
font-family: "lato-bolder", "Open Sans", sans-serif !important;
font-family: "lato-bolder", "Open Sans", sans-serif;
font-weight: lighter;
padding: 0px 0px 2px 0px;
box-sizing: border-box;
@ -234,7 +238,7 @@ li > input[type="password"],
}
.discovery_textarea_input {
background-color: #fbfbfb !important;
background-color: #fbfbfb;
padding-left: 10px;
width: 100%;
height: 100px;

View File

@ -12,9 +12,324 @@ div.criticity {
}
div.mini-criticity {
width: 5px;
height: 4em;
width: 10px;
height: 3em;
padding: 0;
margin: 0;
display: inline-block;
}
div.mini-criticity.h100p {
height: 100%;
}
.flex-row.event {
align-items: center;
}
form.flex-row div.filter_input,
form.flex-row ul {
width: 30%;
min-width: 300px;
display: flex;
flex-direction: row;
align-items: baseline;
flex-wrap: wrap;
align-content: center;
justify-content: space-between;
flex: 1;
margin: 0.5em 3em 0.5em 0;
}
div.filter_input_little {
flex: 1;
display: flex;
flex-direction: row;
align-items: baseline;
flex-wrap: nowrap;
margin: 0.5em 0 0.5em 1em;
}
form.flex-row div.filter_input.large {
flex: 1;
min-width: 470px;
}
div.filter_input > label,
div.filter_input_little > label {
width: 10em;
}
form.flex-row > ul,
form.flex-row > ul > li,
form.flex-row > .box-shadow.white_table_graph {
width: 100%;
}
form.flex-row > .box-shadow.white_table_graph {
margin-top: 2em;
}
form.flex-row > ul input[type="submit"] {
float: right;
}
form.flex-row > div > label {
margin-right: 1em;
}
table.dataTable tbody th,
table.dataTable tbody td {
padding: 8px 10px;
}
.info_table.events tr > th {
padding-left: 1em;
font-size: 8pt;
font-weight: 300;
border-bottom: 1px solid #878787;
cursor: pointer;
}
.info_table.events tr > td {
height: 2.5em;
}
.sorting_desc {
background: url(http://localhost/pandora_console/images/sort_down_green.png)
no-repeat;
background-position-x: left;
background-position-y: center;
}
.sorting_asc {
background: url(http://localhost/pandora_console/images/sort_up_green.png)
no-repeat;
background-position-x: left;
background-position-y: center;
}
.info_table.events > tbody > tr > td {
-moz-border-radius: 0px;
-webkit-border-radius: 0px;
border-radius: 0px;
border: none;
padding-left: 0px;
padding-right: 9px;
padding-top: 7px;
padding-bottom: 7px;
border-bottom: 2px solid #dedede;
}
.info_table.events tr > td:first-child {
padding-left: 5px;
padding-top: 0;
vertical-align: middle;
width: 40%;
padding-bottom: 0;
}
.filter_input {
align-items: center;
}
.filter_input_little > select,
.filter_input_little > input,
.filter_input > select,
.filter_input > input {
flex: 1;
}
fieldset {
margin: 0 auto;
}
.event.flex-row.h100p.nowrap div {
max-width: 98%;
}
.event.flex-row.h100p.nowrap .mini-criticity {
width: 10px;
min-width: 10px;
max-width: 10px;
}
.filter_summary {
margin-bottom: 3em;
height: 3em;
}
.filter_summary div.label {
background: #878787;
color: #fff;
font-weight: bolder;
border-radius: 5px;
padding: 0.5em;
}
.filter_summary div.content {
padding: 0.5em;
}
.filter_summary > div {
border: 1px solid #eee;
border-radius: 5px;
}
.filter_summary div {
float: left;
margin-right: 2em;
text-align: center;
background: #fff;
}
#events_processing {
background: #dedede;
font-size: 3em;
height: auto;
padding: 2em;
color: #777;
border: none;
margin-top: -2em;
}
/* Image open dialog in group events by agents*/
#open_agent_groups {
cursor: pointer;
}
.table_modal_alternate {
border-spacing: 0px;
text-align: left;
}
/* Modal window - Show More */
table.table_modal_alternate tr:nth-child(odd) td {
background-color: #ffffff;
}
table.table_modal_alternate tr:nth-child(even) td {
background-color: #f9f9f9;
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
}
table.table_modal_alternate tr td {
height: 33px;
max-height: 33px;
min-height: 33px;
}
table.table_modal_alternate tr td:first-child {
width: 35%;
font-weight: bold;
padding-left: 20px;
}
ul.events_tabs {
background: #ffffff;
border: 0px;
display: flex;
justify-content: space-between;
padding: 0px;
}
ul.events_tabs:before,
ul.events_tabs:after {
content: none;
}
ul.events_tabs > li {
margin: 0;
width: 100%;
text-align: center;
float: none;
outline-width: 0;
}
ul.events_tabs > li.ui-state-default {
background: #fff;
border: none;
border-bottom: 2px solid #cacaca;
}
ul.events_tabs > li a {
text-align: center;
float: none;
padding: 8px;
display: block;
}
ul.events_tabs > li span {
position: relative;
top: -6px;
left: 5px;
margin-right: 10px;
}
ul.events_tabs > li.ui-tabs-active {
border: none;
}
ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header {
background: none;
margin: 0;
margin-bottom: -1px;
border: none;
}
ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
li {
padding: 0.5em;
}
ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
li
> a {
display: flex;
align-items: center;
flex-direction: row;
}
ul.ui-tabs-nav.ui-corner-all.ui-helper-reset.ui-helper-clearfix.ui-widget-header
li
> a
> img {
margin-right: 0.3em;
}
li.ui-tabs-tab.ui-corner-top.ui-state-default.ui-tab {
border-bottom: 1px solid #ccc;
}
li.ui-tabs-tab.ui-corner-top.ui-state-default.ui-tab.ui-tabs-active.ui-state-active {
border-bottom: 1px solid #fff;
}
div.extended_event_pages.ui-tabs-panel.ui-corner-bottom.ui-widget-content {
border-top: 1px solid #a9a9a9;
}
tr.group {
padding: 5px;
border: none;
}
tr.group * {
text-align: left;
color: #222;
text-indent: 3em;
background: #e2e2e2;
}
div.multi-response-buttons {
margin-top: 2em;
width: 100%;
text-align: right;
}
div.criticity {
width: 150px;
height: 2em;
color: #fff;
text-align: center;
border-radius: 5px;
font-size: 0.8em;
padding: 5px;
margin: 0;
display: table-cell;
vertical-align: middle;
}

View File

@ -64,7 +64,7 @@ div.new_task_cluster > div {
.button_task {
margin-top: 10px;
background-color: #3f3f3f !important;
background-color: #3f3f3f;
padding: 10px 10px 10px 10px;
font-weight: bold;
color: #82b92e;

View File

@ -1,5 +1,5 @@
div.fixed-bottom-box {
background: #e1e1e1;
background: #fff;
border-radius: 10px 10px 0 0;
-moz-border-radius: 10px 10px 0 0;
@ -9,6 +9,20 @@ div.fixed-bottom-box {
-khtml-border-radius: 10px 10px 0 0;
}
/* Overrides */
.left_align {
border: 1px solid #e1e1e1;
}
.white_table_graph_header {
border-top-left-radius: 0px;
border-top-right-radius: 0px;
margin: -1px;
}
.white-box-content {
margin: -1px;
}
/* Overrides end */
div.fixed-bottom-box > div.fixed-bottom-box-head {
height: 30px;
line-height: 30px;

View File

@ -0,0 +1,33 @@
/*
* ---------------------------------------------------------------------
* - FOOTER -
* ---------------------------------------------------------------------
*/
a.footer,
a.footer span {
font-size: 9px;
color: white;
}
div#foot {
padding-top: 10px;
padding-bottom: 10px;
text-align: center;
background: #343434;
clear: both;
width: auto;
height: 38px;
margin-top: auto;
box-sizing: border-box;
}
div#foot a,
div#foot span {
font-family: "Open Sans", sans-serif;
font-size: 8pt;
color: #9ca4a6;
}
div#foot small span {
font-size: 0.8em;
}

View File

@ -20,7 +20,7 @@
background: none;
}
.title .toggle {
background: transparent url(images/toggle.png) no-repeat scroll !important;
background: transparent url(images/toggle.png) no-repeat scroll;
}
.title a {
@ -70,7 +70,7 @@ div#foot {
box-shadow: 0px 0px 15px #000000;
}
div#foot a {
color: #333 !important;
color: #333;
}
div#foot a.white:after {

View File

@ -259,16 +259,16 @@ div.installation_step {
}
.popup-button-green span {
color: #fff !important;
color: #fff;
}
.popup-button-green:hover {
background-color: transparent !important;
background-color: transparent;
border: 1px solid #82b92e;
color: #82b92e !important;
color: #82b92e;
}
.popup-button-green:hover span {
color: #82b92e !important;
color: #82b92e;
}
/* POPUP -END */

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 B

Some files were not shown because too many files have changed in this diff Show More