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 package: pandorafms-agent-unix
Version: 7.0NG.735-190614 Version: 7.0NG.735-190625
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #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_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" 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" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

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

View File

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

View File

@ -1,23 +1,24 @@
<?php <?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() function mainAgentsModules()
{ {
global $config; global $config;
// Load global vars // Load global vars.
include_once 'include/config.php'; include_once 'include/config.php';
include_once 'include/functions_reporting.php'; include_once 'include/functions_reporting.php';
include_once $config['homedir'].'/include/functions_agents.php'; include_once $config['homedir'].'/include/functions_agents.php';
@ -25,7 +26,7 @@ function mainAgentsModules()
include_once $config['homedir'].'/include/functions_users.php'; include_once $config['homedir'].'/include/functions_users.php';
check_login(); check_login();
// ACL Check // ACL Check.
if (! check_acl($config['id_user'], 0, 'AR')) { if (! check_acl($config['id_user'], 0, 'AR')) {
db_pandora_audit( db_pandora_audit(
'ACL Violation', 'ACL Violation',
@ -37,7 +38,7 @@ function mainAgentsModules()
// Update network modules for this group // Update network modules for this group
// Check for Network FLAG change request // 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'])) { if (isset($_GET['update_netgroup'])) {
$group = get_parameter_get('update_netgroup', 0); $group = get_parameter_get('update_netgroup', 0);
if (check_acl($config['id_user'], $group, 'AW')) { if (check_acl($config['id_user'], $group, 'AW')) {
@ -62,7 +63,7 @@ function mainAgentsModules()
$modulegroup = get_parameter('modulegroup', 0); $modulegroup = get_parameter('modulegroup', 0);
$refr = (int) get_parameter('refresh', 0); $refr = (int) get_parameter('refresh', 0);
// By default 30 seconds // By default 30 seconds.
$recursion = get_parameter('recursion', 0); $recursion = get_parameter('recursion', 0);
$group_id = (int) get_parameter('group_id', 0); $group_id = (int) get_parameter('group_id', 0);
$offset = (int) get_parameter('offset', 0); $offset = (int) get_parameter('offset', 0);
@ -79,7 +80,8 @@ function mainAgentsModules()
$full_modules_selected = explode(';', get_parameter('full_modules_selected', 0)); $full_modules_selected = explode(';', get_parameter('full_modules_selected', 0));
$full_agents_id = explode(';', get_parameter('full_agents_id', 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_modules_selected = unserialize_in_temp($config['id_user'].'_agent_module', true, 1);
$unserialize_agents_id = unserialize_in_temp($config['id_user'].'_agents', true, 1); $unserialize_agents_id = unserialize_in_temp($config['id_user'].'_agents', true, 1);
if ($unserialize_modules_selected) { if ($unserialize_modules_selected) {
@ -102,7 +104,6 @@ function mainAgentsModules()
serialize_in_temp($agents_id, $config['id_user'].'_agents', 1); serialize_in_temp($agents_id, $config['id_user'].'_agents', 1);
} }
// if($agents_id != -1) $agents_id = null;
if ($config['pure'] == 0) { if ($config['pure'] == 0) {
if ($modules_selected[0] && $agents_id[0]) { if ($modules_selected[0] && $agents_id[0]) {
$full_modules = urlencode(implode(';', $modules_selected)); $full_modules = urlencode(implode(';', $modules_selected));
@ -124,13 +125,13 @@ function mainAgentsModules()
} }
} }
// groups // Groups.
$filter_groups_label = '<b>'.__('Group').'</b>'; $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_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_label = '<b>'.__('Recursion').'</b>';
$filter_recursion = html_print_checkbox('recursion', 1, 0, true); $filter_recursion = html_print_checkbox('recursion', 1, 0, true);
// groups module // Groups module.
$filter_module_groups_label = '<b>'.__('Module group').'</b>'; $filter_module_groups_label = '<b>'.__('Module group').'</b>';
$filter_module_groups = html_print_select_from_sql( $filter_module_groups = html_print_select_from_sql(
'SELECT * FROM tmodule_group ORDER BY name', 'SELECT * FROM tmodule_group ORDER BY name',
@ -146,7 +147,7 @@ function mainAgentsModules()
'width: auto;' 'width: auto;'
); );
// agent // Agent.
$agents = agents_get_group_agents($group_id); $agents = agents_get_group_agents($group_id);
if ((empty($agents)) || $agents == -1) { if ((empty($agents)) || $agents == -1) {
$agents = []; $agents = [];
@ -155,7 +156,7 @@ function mainAgentsModules()
$filter_agents_label = '<b>'.__('Agents').'</b>'; $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;'); $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 = [ $selection = [
0 => __('Show common modules'), 0 => __('Show common modules'),
1 => __('Show all modules'), 1 => __('Show all modules'),
@ -163,12 +164,12 @@ function mainAgentsModules()
$filter_type_show_label = '<b>'.__('Show common modules').'</b>'; $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;'); $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); $all_modules = select_modules_for_agent_group($group_id, $agents_id, $selection_a_m, false);
$filter_modules_label = '<b>'.__('Module').'</b>'; $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;'); $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); $filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true);
$onheader = [ $onheader = [
@ -178,8 +179,11 @@ function mainAgentsModules()
'combo_groups' => $filter_groups, '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) { if ($config['pure'] == 0) {
// Header. // Header.
ui_print_page_header( ui_print_page_header(
@ -200,38 +204,51 @@ function mainAgentsModules()
$full_modules = urlencode(implode(';', $full_modules_selected)); $full_modules = urlencode(implode(';', $full_modules_selected));
$full_agents = urlencode(implode(';', $full_agents_id)); $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 &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 { } 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="vc-controls" style="z-index: 999">';
echo '<div id="menu_tab">'; echo '<div id="menu_tab">';
echo '<ul class="mn">'; echo '<ul class="mn">';
// Quit fullscreen // Quit fullscreen.
echo '<li class="nomn">'; echo '<li class="nomn">';
echo '<a target="_top" href="'.$url.'">'; echo '<a target="_top" href="'.$url.'">';
echo html_print_image('images/normal_screen.png', true, ['title' => __('Back to normal mode')]); echo html_print_image('images/normal_screen.png', true, ['title' => __('Back to normal mode')]);
echo '</a>'; echo '</a>';
echo '</li>'; echo '</li>';
// Countdown // Countdown.
echo '<li class="nomn">'; echo '<li class="nomn">';
echo '<div class="vc-refr">'; 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 '<div id="vc-refr-form">';
echo __('Refresh').':'; 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 '</div>'; echo '</div>';
echo '</li>'; echo '</li>';
// Console name // Console name.
echo '<li class="nomn">'; echo '<li class="nomn">';
echo '<div class="vc-title">'.__('Agent/module view').'</div>'; echo '<div class="vc-title">'.__('Agent/module view').'</div>';
echo '</li>'; echo '</li>';
@ -240,35 +257,35 @@ function mainAgentsModules()
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
// Floating menu - End // Floating menu - End.
ui_require_jquery_file('countdown'); ui_require_jquery_file('countdown');
} }
if ($config['pure'] != 1) { if ($config['pure'] != 1) {
echo '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'">'; $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;">';
echo '<table class="databox filters" cellpadding="0" cellspacing="0" border="0" style="width:100%;">'; $show_filters .= '<tr>';
echo '<tr>'; $show_filters .= '<td>'.$filter_groups_label.'</td>';
echo '<td>'.$filter_groups_label.'</td>'; $show_filters .= '<td>'.$filter_groups.'&nbsp;&nbsp;&nbsp;'.$filter_recursion_label.$filter_recursion.'</td>';
echo '<td>'.$filter_groups.'&nbsp;&nbsp;&nbsp;'.$filter_recursion_label.$filter_recursion.'</td>'; $show_filters .= '<td></td>';
echo '<td></td>'; $show_filters .= '<td></td>';
echo '<td></td>'; $show_filters .= '<td>'.$filter_module_groups_label.'</td>';
echo '<td>'.$filter_module_groups_label.'</td>'; $show_filters .= '<td>'.$filter_module_groups.'</td>';
echo '<td>'.$filter_module_groups.'</td>'; $show_filters .= '</tr>';
echo '</tr>'; $show_filters .= '<tr>';
echo '<tr>'; $show_filters .= '<td>'.$filter_agents_label.'</td>';
echo '<td>'.$filter_agents_label.'</td>'; $show_filters .= '<td>'.$filter_agents.'</td>';
echo '<td>'.$filter_agents.'</td>'; $show_filters .= '<td>'.$filter_type_show_label.'</td>';
echo '<td>'.$filter_type_show_label.'</td>'; $show_filters .= '<td>'.$filter_type_show.'</td>';
echo '<td>'.$filter_type_show.'</td>'; $show_filters .= '<td>'.$filter_modules_label.'</td>';
echo '<td>'.$filter_modules_label.'</td>'; $show_filters .= '<td>'.$filter_modules.'</td>';
echo '<td>'.$filter_modules.'</td>'; $show_filters .= '</tr>';
echo '</tr>'; $show_filters .= '<tr>';
echo '<tr>'; $show_filters .= "<td colspan=6 ><span style='float: right; padding-right: 20px;'>".$filter_update.'</sapn></td>';
echo "<td colspan=6 ><span style='float: right; padding-right: 20px;'>".$filter_update.'</sapn></td>'; $show_filters .= '</tr>';
echo '</tr>'; $show_filters .= '</table>';
echo '</table>'; $show_filters .= '</form>';
echo '</form>'; ui_toggle($show_filters, __('Filters'));
} }
if ($agents_id[0] != -1) { if ($agents_id[0] != -1) {
@ -291,7 +308,7 @@ function mainAgentsModules()
$count = 0; $count = 0;
foreach ($agents as $agent) { foreach ($agents as $agent) {
// TODO TAGS agents_get_modules // TODO TAGS agents_get_modules.
$module = agents_get_modules( $module = agents_get_modules(
$agent, $agent,
false, false,
@ -339,7 +356,7 @@ function mainAgentsModules()
} }
} }
} else { } else {
// TODO TAGS agents_get_modules // TODO TAGS agents_get_modules.
$all_modules = agents_get_modules( $all_modules = agents_get_modules(
$agents, $agents,
false, false,
@ -414,11 +431,11 @@ function mainAgentsModules()
if ($hor_offset > 0) { if ($hor_offset > 0) {
$new_hor_offset = ($hor_offset - $block); $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( 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.png', 'images/arrow_left_green.png',
true, true,
['title' => __('Previous modules')] ['title' => __('Previous modules')]
).'</a>'.'</th>'; ).'</a></th>';
} }
$nmodules = 0; $nmodules = 0;
@ -440,11 +457,11 @@ function mainAgentsModules()
if (($hor_offset + $block) < $nmodules) { if (($hor_offset + $block) < $nmodules) {
$new_hor_offset = ($hor_offset + $block); $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( 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.png', 'images/arrow_right_green.png',
true, true,
['title' => __('More modules')] ['title' => __('More modules')]
).'</a>'.'</th>'; ).'</a></th>';
} }
echo '</tr>'; echo '</tr>';
@ -457,12 +474,12 @@ function mainAgentsModules()
$filter_agents['id_grupo'] = $group_id; $filter_agents['id_grupo'] = $group_id;
} }
// Prepare pagination // 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; $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); ui_pagination($total_pagination, $url);
foreach ($agents as $agent) { foreach ($agents as $agent) {
// Get stats for this group // Get stats for this group.
$agent_status = agents_get_status($agent['id_agente']); $agent_status = agents_get_status($agent['id_agente']);
$alias = db_get_row('tagente', 'id_agente', $agent['id_agente']); $alias = db_get_row('tagente', 'id_agente', $agent['id_agente']);
if (empty($alias['alias'])) { if (empty($alias['alias'])) {
@ -471,29 +488,29 @@ function mainAgentsModules()
switch ($agent_status) { switch ($agent_status) {
case 4: case 4:
// Alert fired status // Alert fired status.
$rowcolor = 'group_view_alrm'; $rowcolor = 'group_view_alrm';
break; break;
case 1: case 1:
// Critical status // Critical status.
$rowcolor = 'group_view_crit'; $rowcolor = 'group_view_crit';
break; break;
case 2: case 2:
// Warning status // Warning status.
$rowcolor = 'group_view_warn'; $rowcolor = 'group_view_warn';
break; break;
case 0: case 0:
// Normal status // Normal status.
$rowcolor = 'group_view_ok'; $rowcolor = 'group_view_ok';
break; break;
case 3: case 3:
case -1: case -1:
default: default:
// Unknown status // Unknown status.
$rowcolor = 'group_view_unk'; $rowcolor = 'group_view_unk';
break; break;
} }
@ -502,7 +519,7 @@ function mainAgentsModules()
echo "<td class='$rowcolor'> 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>'; <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); $agent_modules = agents_get_modules($agent['id_agente'], false, $filter_module_group, true, true);
$nmodules = 0; $nmodules = 0;
@ -572,18 +589,23 @@ function mainAgentsModules()
echo '</table>'; 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']; $pure_var = $config['pure'];
if ($pure_var) { if ($pure_var) {
$pure_var = 1; $pure_var = 1;
@ -627,16 +649,14 @@ $ignored_params['refresh'] = '';
$.each($('.th_class_module_r'), function (i, elem) { $.each($('.th_class_module_r'), function (i, elem) {
id = $(elem).attr('id').replace('th_module_r_', ''); id = $(elem).attr('id').replace('th_module_r_', '');
$("#th_module_r_" + id).height(($("#div_module_r_" + id).width() + 10) + 'px'); $("#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).css('margin-top', (max_width - 20) + 'px');
$("#div_module_r_" + id).show(); $("#div_module_r_" + id).show();
}); });
var refr =" . $refr . "; var refr = '<?php echo get_parameter('refresh', 0); ?>';
var pure =" . $pure_var . "; var pure = '<?php echo get_parameter('pure', 0); ?>';
var href ='" . ui_get_url_refresh ($ignored_params) . "'; var href =' <?php echo ui_get_url_refresh($ignored_params); ?>';
if (pure) { if (pure) {
var startCountDown = function (duration, cb) { var startCountDown = function (duration, cb) {
$('div.vc-countdown').countdown('destroy'); $('div.vc-countdown').countdown('destroy');
@ -646,7 +666,7 @@ $ignored_params['refresh'] = '';
$('div.vc-countdown').countdown({ $('div.vc-countdown').countdown({
until: t, until: t,
format: 'MS', format: 'MS',
layout: '(%M%nn%M:%S%nn%S Until refresh)', layout: '(%M%nn%M:%S%nn%S <?php echo __('Until next'); ?>) ',
alwaysExpire: true, alwaysExpire: true,
onExpiry: function () { onExpiry: function () {
$('div.vc-countdown').countdown('destroy'); $('div.vc-countdown').countdown('destroy');
@ -655,8 +675,11 @@ $ignored_params['refresh'] = '';
} }
}); });
} }
startCountDown(refr, false); if(refr>0){
startCountDown(refr, false);
}
var controls = document.getElementById('vc-controls'); var controls = document.getElementById('vc-controls');
autoHideElement(controls, 1000); autoHideElement(controls, 1000);

View File

@ -1,17 +1,32 @@
<?php <?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 // Begin.
// ==================================================
// 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
global $config; global $config;
check_login(); check_login();
@ -32,10 +47,12 @@ if (is_ajax()) {
} }
/** /**
* The main function of module groups and the enter point to * The main function of module groups and the enter point to
* execute the code. * execute the code.
*/ *
* @return void
*/
function mainModuleGroups() function mainModuleGroups()
{ {
global $config; global $config;
@ -68,13 +85,20 @@ function mainModuleGroups()
$info = array_filter( $info = array_filter(
$info, $info,
function ($v, $k) use ($agent_group_search) { 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 ARRAY_FILTER_USE_BOTH
); );
if (!empty($info)) { 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( $agents_counters = array_reduce(
$groups_view, $groups_view,
function ($carry, $item) { function ($carry, $item) {
@ -113,7 +137,7 @@ function mainModuleGroups()
$array_module_group = array_filter( $array_module_group = array_filter(
$array_module_group, $array_module_group,
function ($v, $k) use ($module_group_search) { 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 ARRAY_FILTER_USE_BOTH
); );
@ -125,66 +149,75 @@ function mainModuleGroups()
$array_for_defect[$key]['data']['icon'] = $value['icon']; $array_for_defect[$key]['data']['icon'] = $value['icon'];
} }
$sql = "SELECT SUM(IF(tae.alert_fired <> 0, 1, 0)) AS alerts_module_count, $sql = sprintf(
SUM(IF($condition_warning, 1, 0)) AS warning_module_count, "SELECT SUM(IF(tae.alert_fired <> 0, 1, 0)) AS alerts_module_count,
SUM(IF($condition_unknown, 1, 0)) AS unknown_module_count, SUM(IF(%s, 1, 0)) AS warning_module_count,
SUM(IF($condition_not_init, 1, 0)) AS notInit_module_count, SUM(IF(%s, 1, 0)) AS unknown_module_count,
SUM(IF($condition_critical, 1, 0)) AS critical_module_count, SUM(IF(%s, 1, 0)) AS notInit_module_count,
SUM(IF($condition_normal, 1, 0)) AS normal_module_count, SUM(IF(%s, 1, 0)) AS critical_module_count,
COUNT(tae.id_agente_modulo) AS total_count, SUM(IF(%s, 1, 0)) AS normal_module_count,
tmg.id_mg, COUNT(tae.id_agente_modulo) AS total_count,
tmg.name as n, tmg.id_mg,
tg.id_grupo tmg.name as n,
FROM ( tg.id_grupo
SELECT tam.id_agente_modulo, FROM (
tam.id_module_group, SELECT tam.id_agente_modulo,
ta.id_grupo AS g, tam.id_module_group,
tae.estado, ta.id_grupo AS g,
SUM(IF(tatm.last_fired <> 0, 1, 0)) AS alert_fired tae.estado,
FROM tagente_modulo tam SUM(IF(tatm.last_fired <> 0, 1, 0)) AS alert_fired
LEFT JOIN talert_template_modules tatm FROM tagente_modulo tam
ON tatm.id_agent_module = tam.id_agente_modulo LEFT JOIN talert_template_modules tatm
AND tatm.times_fired = 1 ON tatm.id_agent_module = tam.id_agente_modulo
LEFT JOIN tagente_estado tae AND tatm.times_fired = 1
ON tae.id_agente_modulo = tam.id_agente_modulo LEFT JOIN tagente_estado tae
INNER JOIN tagente ta ON tae.id_agente_modulo = tam.id_agente_modulo
ON ta.id_agente = tam.id_agente INNER JOIN tagente ta
WHERE ta.disabled = 0 ON ta.id_agente = tam.id_agente
AND tam.disabled = 0 WHERE ta.disabled = 0
AND tam.delete_pending = 0 AND tam.disabled = 0
AND ta.id_grupo IN ($ids_group) AND tam.delete_pending = 0
GROUP BY tam.id_agente_modulo AND ta.id_grupo IN (%s)
UNION ALL GROUP BY tam.id_agente_modulo
SELECT tam.id_agente_modulo, UNION ALL
tam.id_module_group, SELECT tam.id_agente_modulo,
tasg.id_group AS g, tam.id_module_group,
tae.estado, tasg.id_group AS g,
SUM(IF(tatm.last_fired <> 0, 1, 0)) AS alert_fired tae.estado,
FROM tagente_modulo tam SUM(IF(tatm.last_fired <> 0, 1, 0)) AS alert_fired
LEFT JOIN talert_template_modules tatm FROM tagente_modulo tam
ON tatm.id_agent_module = tam.id_agente_modulo LEFT JOIN talert_template_modules tatm
AND tatm.times_fired = 1 ON tatm.id_agent_module = tam.id_agente_modulo
LEFT JOIN tagente_estado tae AND tatm.times_fired = 1
ON tae.id_agente_modulo = tam.id_agente_modulo LEFT JOIN tagente_estado tae
INNER JOIN tagente ta ON tae.id_agente_modulo = tam.id_agente_modulo
ON ta.id_agente = tam.id_agente INNER JOIN tagente ta
INNER JOIN tagent_secondary_group tasg ON ta.id_agente = tam.id_agente
ON ta.id_agente = tasg.id_agent INNER JOIN tagent_secondary_group tasg
WHERE ta.disabled = 0 ON ta.id_agente = tasg.id_agent
AND tam.disabled = 0 WHERE ta.disabled = 0
AND tam.delete_pending = 0 AND tam.disabled = 0
AND tasg.id_group IN ($ids_group) AND tam.delete_pending = 0
GROUP BY tam.id_agente_modulo, tasg.id_group AND tasg.id_group IN (%s)
) AS tae GROUP BY tam.id_agente_modulo, tasg.id_group
RIGHT JOIN tgrupo tg ) AS tae
ON tg.id_grupo = tae.g RIGHT JOIN tgrupo tg
INNER JOIN ( ON tg.id_grupo = tae.g
SELECT * FROM tmodule_group INNER JOIN (
UNION ALL SELECT * FROM tmodule_group
SELECT 0 AS 'id_mg', 'Nothing' AS 'name' UNION ALL
) AS tmg SELECT 0 AS 'id_mg', 'Nothing' AS 'name'
ON tae.id_module_group = tmg.id_mg ) AS tmg
GROUP BY tae.g, tmg.id_mg"; 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); $array_data_prev = db_get_all_rows_sql($sql);
@ -220,9 +253,21 @@ function mainModuleGroups()
echo '<td>'; echo '<td>';
echo '</tr></table>'; 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) { if (true) {
$table = new StdClass(); $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%'; $table->width = '100%';
$head[0] = __('Groups'); $head[0] = __('Groups');
@ -248,28 +293,28 @@ function mainModuleGroups()
$color = '#FFA631'; $color = '#FFA631';
// Orange when the cell for this model group and agent has at least one alert fired. // 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) { } 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. // 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) { } 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. // 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) { } else if ($array_data[$key][$k]['unknown_module_count'] != 0) {
$color = '#B2B2B2 '; $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. // 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) { } 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. // 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) { } else if ($array_data[$key][$k]['notInit_module_count'] != 0) {
$color = '#5BB6E5'; $color = '#5BB6E5';
// Blue when the cell for this module group and all modules have not init value. // 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] .= "<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] .= $array_data[$key][$k]['total_count'];
$data[$i][$j] .= '</a></div>'; $data[$i][$j] .= '</a></div>';
} else { } 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] .= 0;
$data[$i][$j] .= '</div>'; $data[$i][$j] .= '</div>';
} }
@ -278,7 +323,7 @@ function mainModuleGroups()
} }
} else { } else {
foreach ($value['gm'] as $k => $v) { 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] .= 0;
$data[$i][$j] .= '</div>'; $data[$i][$j] .= '</div>';
$j++; $j++;

View File

@ -11,5 +11,5 @@
#graph_container { #graph_container {
width: 800px; 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(); $time = get_system_time();
} }
ui_require_css_file('footer');
$license_file = 'general/license/pandora_info_'.$config['language'].'.html'; $license_file = 'general/license/pandora_info_'.$config['language'].'.html';
if (! file_exists($config['homedir'].$license_file)) { if (! file_exists($config['homedir'].$license_file)) {
$license_file = 'general/license/pandora_info_en.html'; $license_file = 'general/license/pandora_info_en.html';
@ -41,9 +43,17 @@ if ($current_package == 0) {
$build_package_version = $current_package; $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'])) { if (isset($config['debug'])) {
$cache_info = []; $cache_info = [];

View File

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

View File

@ -103,199 +103,203 @@ if (!empty($all_data)) {
$data['server_sanity'] = format_numeric((100 - $data['module_sanity']), 1); $data['server_sanity'] = format_numeric((100 - $data['module_sanity']), 1);
} }
ui_require_css_file('logon');
?> echo '<div id="welcome_panel">';
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="25%" style="padding-right: 20px;" valign="top">
<?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;
// Indicators. //
$tdata = []; // Overview Table.
$stats = reporting_get_stats_indicators($data, 120, 10, false); //
$status = '<table class="status_tactical">'; $table = new stdClass();
foreach ($stats as $stat) { $table->class = 'no-class';
$status .= '<tr><td><b>'.$stat['title'].'</b></td><td>'.$stat['graph'].'</td></tr>'; $table->cellpadding = 4;
} $table->cellspacing = 4;
$table->head = [];
$table->data = [];
$table->headstyle[0] = 'text-align:center;';
$table->width = '100%';
$table->head_colspan[0] = 4;
$status .= '</table>'; // Indicators.
$table->data[0][0] = $status; $tdata = [];
$table->rowclass[] = ''; $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>';
}
$table->data[] = $tdata; $status .= '</table>';
$table->data[0][0] = $status;
$table->rowclass[] = '';
// Alerts. $table->data[] = $tdata;
$tdata = [];
$tdata[0] = reporting_get_stats_alerts($data);
$table->rowclass[] = '';
$table->data[] = $tdata;
// Modules by status. // Alerts.
$tdata = []; $tdata = [];
$tdata[0] = reporting_get_stats_modules_status($data, 180, 100); $tdata[0] = reporting_get_stats_alerts($data);
$table->rowclass[] = ''; $table->rowclass[] = '';
$table->data[] = $tdata; $table->data[] = $tdata;
// Total agents and modules. // Modules by status.
$tdata = []; $tdata = [];
$tdata[0] = reporting_get_stats_agents_monitors($data); $tdata[0] = reporting_get_stats_modules_status($data, 180, 100);
$table->rowclass[] = ''; $table->rowclass[] = '';
$table->data[] = $tdata; $table->data[] = $tdata;
// Users. // Total agents and modules.
if (users_is_admin()) { $tdata = [];
$tdata = []; $tdata[0] = reporting_get_stats_agents_monitors($data);
$tdata[0] = reporting_get_stats_users($data); $table->rowclass[] = '';
$table->rowclass[] = ''; $table->data[] = $tdata;
$table->data[] = $tdata;
}
html_print_table($table); // Users.
unset($table); if (users_is_admin()) {
?> $tdata = [];
$tdata[0] = reporting_get_stats_users($data);
$table->rowclass[] = '';
</td> $table->data[] = $tdata;
}
<td width="75%" valign="top">
ui_toggle(
html_print_table($table, true),
<?php __('%s Overview', get_product_name()),
$options = []; '',
$options['id_user'] = $config['id_user']; 'overview',
$options['modal'] = false; false
$options['limit'] = 3; );
$news = get_news($options); unset($table);
echo '<div id="right">';
// News.
$options = [];
$options['id_user'] = $config['id_user'];
$options['modal'] = false;
$options['limit'] = 3;
$news = get_news($options);
if (!empty($news)) { if (!empty($news)) {
// NEWS BOARD. ui_require_css_file('news');
echo '<div id="news_board">'; // NEWS BOARD.
if ($config['prominent_time'] == 'timestamp') {
$comparation_suffix = '';
} else {
$comparation_suffix = __('ago');
}
echo '<table cellpadding="0" width=100% cellspacing="0" class="databox filters">'; $output_news = '<div id="news_board" class="new">';
echo '<tr><th style="text-align:center;"><span >'.__('News board').'</span></th></tr>'; foreach ($news as $article) {
if ($config['prominent_time'] == 'timestamp') { $image = false;
$comparation_suffix = ''; 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;') {
} else { $image = true;
$comparation_suffix = __('ago'); }
}
foreach ($news as $article) { $text_bbdd = io_safe_output($article['text']);
$image = false; $text = html_entity_decode($text_bbdd);
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;') { $output_news .= '<span class="green_title">'.$article['subject'].'</span>';
$image = true; $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>';
}
$text_bbdd = io_safe_output($article['text']); $output_news .= nl2br($text);
$text = html_entity_decode($text_bbdd); $output_news .= '</div>';
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); $output_news .= '</div>';
echo '</td></tr>';
}
echo '</table>'; // News board.
echo '</div>'; ui_toggle(
// News board. $output_news,
echo '<br><br>'; __('News board'),
'',
'news',
false
);
// END OF NEWS BOARD.
}
// END OF NEWS BOARD. // LAST ACTIVITY.
} // Show last activity from this user.
$table = new stdClass();
// LAST ACTIVITY. $table->class = 'no-td-padding info_table';
// Show last activity from this user. $table->cellpadding = 0;
echo '<div id="activity">'; $table->cellspacing = 0;
$table->width = '100%';
$table = new stdClass(); // Don't specify px.
$table->class = 'info_table'; $table->data = [];
$table->cellpadding = 0; $table->size = [];
$table->cellspacing = 0; $table->headstyle = [];
$table->width = '100%'; $table->size[0] = '5%';
// Don't specify px. $table->size[1] = '15%';
$table->data = []; $table->headstyle[1] = 'min-width: 12em;';
$table->size = []; $table->size[2] = '5%';
$table->size[0] = '5%'; $table->headstyle[2] = 'min-width: 65px;';
$table->size[1] = '15%'; $table->size[3] = '10%';
$table->size[2] = '15%'; $table->size[4] = '25%';
$table->size[3] = '10%'; $table->head = [];
$table->size[4] = '25%'; $table->head[0] = __('User');
$table->head = []; $table->head[1] = __('Action');
$table->head[0] = __('User'); $table->head[2] = __('Date');
$table->head[1] = __('Action'); $table->head[3] = __('Source IP');
$table->head[2] = __('Date'); $table->head[4] = __('Comments');
$table->head[3] = __('Source IP'); $table->align[4] = 'left';
$table->head[4] = __('Comments'); $sql = sprintf(
$table->title = '<span>'.__('This is your last activity performed on the %s console', get_product_name()).'</span>'; 'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp
$sql = sprintf( FROM tsesion
'SELECT id_usuario,accion, ip_origen,descripcion,utimestamp WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.")
FROM tsesion AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10",
WHERE (`utimestamp` > UNIX_TIMESTAMP(NOW()) - '.SECONDS_1WEEK.") $config['id_user']
AND `id_usuario` = '%s' ORDER BY `utimestamp` DESC LIMIT 10", );
$config['id_user']
);
$sessions = db_get_all_rows_sql($sql); $sessions = db_get_all_rows_sql($sql);
if ($sessions === false) { if ($sessions === false) {
$sessions = []; $sessions = [];
} }
foreach ($sessions as $session) { foreach ($sessions as $session) {
$data = []; $data = [];
$session_id_usuario = $session['id_usuario']; $session_id_usuario = $session['id_usuario'];
$session_ip_origen = $session['ip_origen']; $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>';
}
$data[0] = '<strong>'.$session_id_usuario.'</strong>'; array_push($table->data, $data);
$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); $activity .= html_print_table($table, true);
} unset($table);
echo "<div style='width:100%; overflow-x:auto;'>"; ui_toggle(
html_print_table($table); $activity,
unset($table); __('Latest activity'),
echo '</div>'; '',
echo '</div>'; 'activity',
// END OF LAST ACTIVIYY. false,
?> false,
'',
'white-box-content padded'
</td> );
// END OF LAST ACTIVIYY.
</tr> // Close right panel.
</table> echo '</div>';
// 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> </script>
<?php <?php
$autohidden_menu = 0; $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 = '<form name="query_sel" method="post" action="index.php?sec=glog&sec2=godmode/admin_access_logs">';
$form .= html_print_table($table, true); $form .= html_print_table($table, true);
$form .= '</form>'; $form .= '</form>';
ui_toggle($form, __('Filter'), '', false); ui_toggle($form, __('Filter'), '', '', false);
$filter = '1=1'; $filter = '1=1';

View File

@ -176,7 +176,7 @@ if ($disk_conf_delete) {
@unlink($filename['conf']); @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.
$custom_id_div = '<div class="label_select">'; $custom_id_div = '<div class="label_select">';
@ -245,7 +245,7 @@ if (!$new_agent && $alias != '') {
$table_agent_name .= '</div></div></div>'; $table_agent_name .= '</div></div></div>';
// QR code 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 .= '<p class="input_label">'.__('QR Code Agent view').': </p>';
$table_qr_code .= '<div id="qr_container_image"></div>'; $table_qr_code .= '<div id="qr_container_image"></div>';
if ($id_agente) { if ($id_agente) {
@ -401,7 +401,7 @@ $table_description .= html_print_textarea(
// QR code. // QR code.
echo '<div class="first_row"> 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_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 class="agent_options_column_right">'.$table_interval.$table_os.$table_server.$table_description.'</div>
</div>'; </div>';
@ -413,8 +413,8 @@ echo '</div>';
if (enterprise_installed()) { if (enterprise_installed()) {
$secondary_groups_selected = enterprise_hook('agents_get_secondary_groups', [$id_agente]); $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>'; $adv_secondary_groups_label = '<div class="label_select"><p class="input_label">'.__('Secondary groups').': </p></div>';
$table_adv_secondary_groups_left = html_print_select_groups( $adv_secondary_groups_left = html_print_select_groups(
false, false,
// Use the current user to select the groups. // Use the current user to select the groups.
'AR', 'AR',
@ -441,7 +441,7 @@ if (enterprise_installed()) {
// CSS classnames (default). // CSS classnames (default).
false, false,
// Not disabled (default). // Not disabled (default).
'width:50%; min-width:170px;', 'min-width:170px;',
// Inline styles (default). // Inline styles (default).
false, false,
// Option style select (default). // Option style select (default).
@ -455,7 +455,7 @@ if (enterprise_installed()) {
// Do not show the primary group in this selection. // 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', 'add_secondary',
'images/darrowright_green.png', 'images/darrowright_green.png',
1, 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'], $secondary_groups_selected['for_select'],
// Values. // Values.
'secondary_groups_selected', 'secondary_groups_selected',
@ -502,7 +502,7 @@ if (enterprise_installed()) {
// Class. // Class.
false, false,
// Disabled. // Disabled.
'width:50%; min-width:170px;' 'min-width:170px;'
// Style. // 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 = [];
$params['return'] = true; $params['return'] = true;
$params['show_helptip'] = true; $params['show_helptip'] = true;
@ -648,13 +648,15 @@ $table_adv_module_mode .= html_print_radio_button_extended(
$table_adv_module_mode .= '</div></div>'; $table_adv_module_mode .= '</div></div>';
// Status (Disabled / Enabled). // 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( $table_adv_status .= html_print_checkbox_switch(
'disabled', 'disabled',
1, 1,
$disabled, $disabled,
true 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. // Url address.
if (enterprise_installed()) { if (enterprise_installed()) {
@ -665,7 +667,14 @@ if (enterprise_installed()) {
'', '',
45, 45,
255, 255,
true true,
false,
false,
'',
'',
'',
// Autocomplete.
'new-password'
).'</div>'; ).'</div>';
} else { } else {
$table_adv_url = '<div class="label_select"><p class="input_label">'.__('Url address').': </p></div>'; $table_adv_url = '<div class="label_select"><p class="input_label">'.__('Url address').': </p></div>';
@ -679,9 +688,11 @@ if (enterprise_installed()) {
).'</div>'; ).'</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 .= 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(); $listIcons = gis_get_array_list_icons();
@ -753,31 +764,46 @@ if ($config['activate_gis']) {
// General display distribution. // General display distribution.
$table_adv_options = $table_adv_secondary_groups.'<div class="secondary_groups_select" style="margin-bottom:30px;"> $table_adv_options = '
<div class="secondary_groups_list_left"> <div class="secondary_groups_list">
'.$table_adv_secondary_groups_left.' '.$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>
<div class="secondary_groups_select_arrows"> <div class="adv_right" >
'.$table_adv_secondary_groups_arrows.' '.$table_adv_parent.$table_adv_module_mode.$table_adv_cascade;
</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;
if ($new_agent) { if ($new_agent) {
// If agent is new, show custom id as old style format. // If agent is new, show custom id as old style format.
$table_adv_options .= $custom_id_div; $table_adv_options .= $custom_id_div;
} }
$table_adv_options .= $table_adv_gis.'</div> $table_adv_options .= '</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 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">'; 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>'; echo '</div>';
@ -831,7 +857,7 @@ foreach ($fields as $field) {
$custom_value = ''; $custom_value = '';
} }
$table->rowstyle[$i] = 'cursor: pointer;'; $table->rowstyle[$i] = 'cursor: pointer;user-select: none;';
if (!empty($custom_value)) { if (!empty($custom_value)) {
$table->rowstyle[($i + 1)] = 'display: table-row;'; $table->rowstyle[($i + 1)] = 'display: table-row;';
} else { } else {
@ -895,14 +921,16 @@ foreach ($fields as $field) {
if (!empty($fields)) { if (!empty($fields)) {
echo '<div class="ui_toggle">'; echo '<div class="ui_toggle">';
ui_toggle( ui_toggle(
html_print_table($table, true), html_print_table($table, true),
__('Custom fields'), __('Custom fields'),
'', '',
true, '',
false, true,
'white_box white_box_opened' false,
); 'white_box white_box_opened',
'no-border'
);
echo '</div>'; echo '</div>';
} }

View File

@ -322,7 +322,7 @@ if ($create_modules) {
} else if (preg_match('/ifAdminStatus/', $name_array[1])) { } else if (preg_match('/ifAdminStatus/', $name_array[1])) {
$module_type = 2; $module_type = 2;
} else if (preg_match('/ifOperStatus/', $name_array[1])) { } else if (preg_match('/ifOperStatus/', $name_array[1])) {
$module_type = 18; $module_type = 2;
} else { } else {
$module_type = 4; $module_type = 4;
} }
@ -608,11 +608,11 @@ ui_require_jquery_file('bgiframe');
$(document).ready (function () { $(document).ready (function () {
var inputActive = true; var inputActive = true;
$(document).data('text_for_module', $("#none_text").html()); $(document).data('text_for_module', $("#none_text").html());
$("#id_snmp").change(snmp_changed_by_multiple_snmp); $("#id_snmp").change(snmp_changed_by_multiple_snmp);
$("#snmp_version").change(function () { $("#snmp_version").change(function () {
if (this.value == "3") { if (this.value == "3") {
$("#snmp3_options").css("display", ""); $("#snmp3_options").css("display", "");
@ -621,7 +621,7 @@ $(document).ready (function () {
$("#snmp3_options").css("display", "none"); $("#snmp3_options").css("display", "none");
} }
}); });
$("#walk_form").submit(function() { $("#walk_form").submit(function() {
$("#submit-snmp_walk").disable (); $("#submit-snmp_walk").disable ();
$("#oid_loading").show (); $("#oid_loading").show ();
@ -632,15 +632,15 @@ $(document).ready (function () {
function snmp_changed_by_multiple_snmp (event, id_snmp, selected) { function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
var idSNMP = Array(); var idSNMP = Array();
jQuery.each ($("#id_snmp option:selected"), function (i, val) { jQuery.each ($("#id_snmp option:selected"), function (i, val) {
idSNMP.push($(val).val()); idSNMP.push($(val).val());
}); });
$('#module').attr ('disabled', 1); $('#module').attr ('disabled', 1);
$('#module').empty (); $('#module').empty ();
$('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0)); $('#module').append ($('<option></option>').html ("Loading...").attr ("value", 0));
jQuery.post ('ajax.php', jQuery.post ('ajax.php',
{"page" : "godmode/agentes/agent_manager", {"page" : "godmode/agentes/agent_manager",
"get_modules_json_for_multiple_snmp": 1, "get_modules_json_for_multiple_snmp": 1,
"id_snmp[]": idSNMP, "id_snmp[]": idSNMP,
@ -655,7 +655,7 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
$('#module').fadeIn ('normal'); $('#module').fadeIn ('normal');
c++; c++;
}); });
if (c == 0) { if (c == 0) {
if (typeof($(document).data('text_for_module')) != 'undefined') { if (typeof($(document).data('text_for_module')) != 'undefined') {
$('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).prop('selected', true)); $('#module').append ($('<option></option>').html ($(document).data('text_for_module')).attr("value", 0).prop('selected', true));
@ -666,11 +666,11 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
} }
else { else {
var anyText = $("#any_text").html(); //Trick for catch the translate text. var anyText = $("#any_text").html(); //Trick for catch the translate text.
if (anyText == null) { if (anyText == null) {
anyText = 'Any'; anyText = 'Any';
} }
$('#module').append ($('<option></option>').html (anyText).attr ("value", 0).prop('selected', true)); $('#module').append ($('<option></option>').html (anyText).attr ("value", 0).prop('selected', true));
} }
} }
@ -684,4 +684,3 @@ function snmp_changed_by_multiple_snmp (event, id_snmp, selected) {
/* ]]> */ /* ]]> */
</script> </script>

View File

@ -583,7 +583,13 @@ echo '<h3 id="message" class="error invisible"></h3>';
// TODO: Change to the ui_print_error system // TODO: Change to the ui_print_error system
echo '<form method="post" id="module_form">'; 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( ui_toggle(
html_print_table($table_advanced, true), 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 = new stdClass();
$table_simple->id = 'simple'; $table_simple->id = 'simple';
$table_simple->width = '100%'; $table_simple->width = '100%';
$table_simple->class = 'databox'; $table_simple->class = 'no-class';
$table_simple->data = []; $table_simple->data = [];
$table_simple->style = []; $table_simple->style = [];
$table_simple->style[0] = 'font-weight: bold; width: 25%;'; $table_simple->style[0] = 'font-weight: bold; width: 25%;';
@ -637,7 +637,7 @@ if ($disabledBecauseInPolicy) {
$table_advanced = new stdClass(); $table_advanced = new stdClass();
$table_advanced->id = 'advanced'; $table_advanced->id = 'advanced';
$table_advanced->width = '100%'; $table_advanced->width = '100%';
$table_advanced->class = 'databox filters'; $table_advanced->class = 'no-class';
$table_advanced->data = []; $table_advanced->data = [];
$table_advanced->style = []; $table_advanced->style = [];
$table_advanced->style[0] = $table_advanced->style[3] = $table_advanced->style[5] = 'font-weight: bold;'; $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 = new stdClass();
$table_macros->id = 'module_macros'; $table_macros->id = 'module_macros';
$table_macros->width = '100%'; $table_macros->width = '100%';
$table_macros->class = 'databox filters'; $table_macros->class = 'no-class';
$table_macros->data = []; $table_macros->data = [];
$table_macros->style = []; $table_macros->style = [];
$table_macros->style[0] = 'font-weight: bold;'; $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 = new stdClass();
$table_new_relations->id = 'module_new_relations'; $table_new_relations->id = 'module_new_relations';
$table_new_relations->width = '100%'; $table_new_relations->width = '100%';
$table_new_relations->class = 'databox filters'; $table_new_relations->class = 'no-class';
$table_new_relations->data = []; $table_new_relations->data = [];
$table_new_relations->style = []; $table_new_relations->style = [];
$table_new_relations->style[0] = 'width: 10%; font-weight: bold;'; $table_new_relations->style[0] = 'width: 10%; font-weight: bold;';

View File

@ -37,14 +37,10 @@ $table->head = [];
$table->data = []; $table->data = [];
$table->size = []; $table->size = [];
$table->size = []; $table->size = [];
$table->size[0] = '5%'; $table->style[0] = 'font-weight: bold;';
$table->size[1] = '25%'; $table->style[1] = 'font-weight: bold;display: flex;align-items: baseline;';
$table->size[2] = '5%'; $table->style[2] = 'font-weight: bold;';
$table->size[3] = '20%'; $table->style[3] = 'font-weight: bold;';
$table->style[0] = 'font-weight: bold; ';
$table->style[1] = 'font-weight: bold; ';
$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 // This is because if this view is reused after list alert view then
// styles in the previous view can affect this table. // styles in the previous view can affect this table.
@ -89,7 +85,7 @@ $table->data[0][1] = html_print_select(
true, true,
'', '',
($id_agente == 0), ($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="latest_value" class="invisible">'.__('Latest value').': ';
$table->data[0][1] .= '<span id="value">&nbsp;</span></span>'; $table->data[0][1] .= '<span id="value">&nbsp;</span></span>';
@ -117,7 +113,7 @@ $table->data[1][1] = html_print_select(
true, true,
'', '',
false, false,
'width: 250px;' 'min-width: 250px;'
); );
$table->data[1][1] .= '<span id="advanced_action" class="advanced_actions invisible"><br>'; $table->data[1][1] .= '<span id="advanced_action" class="advanced_actions invisible"><br>';
$table->data[1][1] .= __('Number of alerts match from').' '; $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>'; $table->data[1][1] .= '</span>';
if (check_acl($config['id_user'], 0, 'LM')) { 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] .= 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>'; $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')) { 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] .= '<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] .= 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[2][1] .= '</a>';
} }
$table->data[3][0] = __('Threshold'); $table->data[3][0] = __('Threshold');
$table->data[3][1] = html_print_input_text('module_action_threshold', '0', '', 5, 7, true); $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)) { if (!isset($step)) {
echo '<form class="add_alert_form" method="post">'; echo '<form class="add_alert_form" method="post">';

View File

@ -438,11 +438,11 @@ if (! $id_agente) {
$table->style = []; $table->style = [];
$table->style[0] = 'font-weight: bold;'; $table->style[0] = 'font-weight: bold;';
$table->head[0] = __('Agent').ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectAgentUp, $selectAgentDown); $table->head[0] = __('Agent').ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectAgentUp, $selectAgentDown);
$table->size[0] = '4%'; $table->headstyle[0] = 'width: 100%; min-width: 12em;';
$table->size[1] = '8%'; $table->headstyle[1] = 'min-width: 15em;';
$table->size[2] = '8%'; $table->headstyle[2] = 'min-width: 20em;';
$table->size[3] = '4%'; $table->headstyle[3] = 'min-width: 1em;';
$table->size[4] = '4%'; $table->headstyle[4] = 'min-width: 15em;';
/* /*
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
@ -450,16 +450,11 @@ if (! $id_agente) {
}*/ }*/
} else { } else {
$table->head[0] = __('Module').ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown); $table->head[0] = __('Module').ui_get_sorting_arrows($url_up_module, $url_down_module, $selectModuleUp, $selectModuleDown);
// Different sizes or the layout screws up $table->headstyle[0] = 'width: 100%; min-width: 15em;';
$table->size[0] = '0%'; $table->headstyle[1] = 'min-width: 15em;';
$table->size[1] = '10%'; $table->headstyle[2] = 'min-width: 20em;';
$table->size[2] = '30%'; $table->headstyle[3] = 'min-width: 1em;';
/* $table->headstyle[4] = 'min-width: 15em;';
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) {
$table->size[4] = '25%';
} */
$table->size[3] = '1%';
$table->size[4] = '1%';
} }
$table->head[1] = __('Template').ui_get_sorting_arrows($url_up_template, $url_down_template, $selectTemplateUp, $selectTemplateDown); $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 = []; $result_selected = [];
// show list of fields selected. // Show list of fields selected.
if ($fields_selected[0] != '') { if ($fields_selected[0] != '') {
foreach ($fields_selected as $field_selected) { foreach ($fields_selected as $field_selected) {
switch ($field_selected) { $result_selected[$field_selected] = events_get_column_name(
case 'id_evento': $field_selected
$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;
} }
} }
@ -177,7 +93,8 @@ $fields_available = [];
$fields_available['id_evento'] = __('Event Id'); $fields_available['id_evento'] = __('Event Id');
$fields_available['evento'] = __('Event Name'); $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_usuario'] = __('User');
$fields_available['id_grupo'] = __('Group'); $fields_available['id_grupo'] = __('Group');
$fields_available['estado'] = __('Status'); $fields_available['estado'] = __('Status');
@ -197,12 +114,10 @@ $fields_available['server_name'] = __('Server Name');
$fields_available['data'] = __('Data'); $fields_available['data'] = __('Data');
$fields_available['module_status'] = __('Module Status'); $fields_available['module_status'] = __('Module Status');
// remove fields already selected // Remove fields already selected.
foreach ($fields_available as $key => $available) { foreach ($fields_available as $key => $available) {
foreach ($result_selected as $selected) { if (isset($result_selected[$key])) {
if ($selected == $available) { unset($fields_available[$key]);
unset($fields_available[$key]);
}
} }
} }

View File

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

View File

@ -418,9 +418,11 @@ if (is_array($config['extensions'])) {
$sub['godmode/extensions']['type'] = 'direct'; $sub['godmode/extensions']['type'] = 'direct';
$sub['godmode/extensions']['subtype'] = 'nolink'; $sub['godmode/extensions']['subtype'] = 'nolink';
$submenu = array_merge($menu_godmode['gextensions']['sub'], $sub); if (is_array($menu_godmode['gextensions']['sub'])) {
if ($menu_godmode['gextensions']['sub'] != null) { $submenu = array_merge($menu_godmode['gextensions']['sub'], $sub);
$menu_godmode['gextensions']['sub'] = $submenu; 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')) { if (defined('METACONSOLE')) {
components_meta_print_header(); components_meta_print_header();
$sec = 'advanced'; $sec = 'advanced';
$id_modulo = (int) get_parameter('id_component_type');
$new_component = (bool) get_parameter('new_component');
} else { } else {
/* /*
Hello there! :) Hello there! :)

View File

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

View File

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

View File

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

View File

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

View File

@ -25,6 +25,8 @@ if (empty($visualConsole)) {
exit; exit;
} }
ui_require_css_file('visual_maps');
// ACL for the existing visual console // ACL for the existing visual console
// if (!isset($vconsole_read)) // if (!isset($vconsole_read))
// $vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR"); // $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 // CSS
ui_require_css_file('color-picker', 'include/styles/js/'); ui_require_css_file('color-picker', 'include/styles/js/');
ui_require_css_file('jquery-ui.min', 'include/styles/js/'); ui_require_css_file('jquery-ui.min', 'include/styles/js/');
ui_require_jquery_file('jquery-ui_custom');
// Javascript // Javascript
ui_require_jquery_file('colorpicker'); ui_require_jquery_file('colorpicker');

View File

@ -51,11 +51,11 @@ $table->style[0] = 'font-weight: bold';
$table->align = []; $table->align = [];
$table->align[1] = 'center'; $table->align[1] = 'center';
$table->align[3] = 'center'; $table->align[3] = 'center';
$table->align[8] = 'center'; $table->align[8] = 'right';
$table->headstyle[1] = 'text-align:center'; $table->headstyle[1] = 'text-align:center';
$table->headstyle[3] = '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->title = __('Tactical server information');
$table->titleclass = 'tabletitle'; $table->titleclass = 'tabletitle';
@ -234,7 +234,8 @@ if ($tiny) {
ui_toggle( ui_toggle(
html_print_table($table, true), html_print_table($table, true),
__('Tactical server information'), __('Tactical server information'),
false, '',
'',
$hidden_toggle $hidden_toggle
); );
} else { } 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); $table->data[9][1] = html_print_input_text('licensed_to', $license['licensed_to'], '', 64, 255, true, true);
html_print_table($table); 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.'">'; echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_input_hidden('update_settings', 1); html_print_input_hidden('update_settings', 1);
html_print_submit_button(__('Validate'), 'update_button', false, 'class="sub upd"'); 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->align[7] = 'left';
$table->head[8] = __('Action'); $table->head[8] = __('Action');
$table->size[8] = '90px'; $table->size[8] = '120px';
$table->align[8] = 'left'; $table->align[8] = 'left';
$table->head[9] = html_print_checkbox('all_delete_box', '1', false, true); $table->head[9] = html_print_checkbox('all_delete_box', '1', false, true);

View File

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

View File

@ -297,7 +297,14 @@ if (defined('METACONSOLE')) {
$form_filter = "<form method='post'>"; $form_filter = "<form method='post'>";
$form_filter .= html_print_table($table, true); $form_filter .= html_print_table($table, true);
$form_filter .= '</form>'; $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. // Urls to sort the table.

View File

@ -651,20 +651,24 @@ class DiscoveryTaskList extends Wizard
array_push($table->data, $data); array_push($table->data, $data);
} }
echo '<h2>'.__('Server tasks').'</h2>';
if (empty($table->data)) { if (empty($table->data)) {
echo '<div class="nf">'.__('Server').' '.$server_name.' '.__('has no discovery tasks assigned').'</div>'; $content = '<div class="nf">'.__('Server').' '.$server_name.' '.__('has no discovery tasks assigned').'</div>';
return false; $return = false;
} else { } 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. // Div neccesary for modal map task.
echo '<div id="map_task" style="display:none"></div>'; echo '<div id="map_task" style="display:none"></div>';
unset($table); unset($table);
ui_require_javascript_file('pandora_taskList'); ui_require_javascript_file('pandora_taskList');
return $return;
} }
return true; 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_events.php';
require_once 'include/functions_agents.php'; require_once 'include/functions_agents.php';
require_once 'include/functions_ui.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('meta/include/functions_events_meta.php');
enterprise_include_once('include/functions_metaconsole.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_events_details = (bool) get_parameter('get_events_details');
$get_list_events_agents = (bool) get_parameter('get_list_events_agents'); $get_list_events_agents = (bool) get_parameter('get_list_events_agents');
$get_extended_event = (bool) get_parameter('get_extended_event'); $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'); $total_event_graph = (bool) get_parameter('total_event_graph');
$graphic_event_group = (bool) get_parameter('graphic_event_group'); $graphic_event_group = (bool) get_parameter('graphic_event_group');
$get_table_response_command = (bool) get_parameter('get_table_response_command'); $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) { if ($get_event_name) {
$event_id = get_parameter('event_id'); $event_id = get_parameter('event_id');
@ -342,26 +1034,26 @@ if ($change_owner) {
return; return;
} }
// Generate a modal window with extended information of given event.
if ($get_extended_event) { if ($get_extended_event) {
global $config; global $config;
$event_id = get_parameter('event_id', false); $event = get_parameter('event', false);
$childrens_ids = get_parameter('childrens_ids');
$childrens_ids = json_decode($childrens_ids);
if ($meta) { if ($event === false) {
$event = events_meta_get_event($event_id, false, $history, 'ER'); return;
} else {
$event = events_get_event($event_id);
} }
$event_id = $event['id_evento'];
$readonly = false; $readonly = false;
if (!$meta if (!$meta
&& isset($config['event_replication']) && isset($config['event_replication'])
&& $config['event_replication'] == 1 && $config['event_replication'] == 1
&& $config['show_events_in_local'] == 1 && $config['show_events_in_local'] == 1
) { ) {
$readonly = true; $readonly = true;
} }
// Clean url from events and store in array. // Clean url from events and store in array.
@ -374,17 +1066,17 @@ if ($get_extended_event) {
} }
$dialog_page = get_parameter('dialog_page', 'general'); $dialog_page = get_parameter('dialog_page', 'general');
$similar_ids = get_parameter('similar_ids', $event_id); $filter = get_parameter('filter', []);
$group_rep = get_parameter('group_rep', false); $group_rep = $filter['group_rep'];
$event_rep = get_parameter('event_rep', 1); $event_rep = $event['event_rep'];
$timestamp_first = get_parameter('timestamp_first', $event['utimestamp']); $timestamp_first = $event['min_timestamp'];
$timestamp_last = get_parameter('timestamp_last', $event['utimestamp']); $timestamp_last = $event['max_timestamp'];
$server_id = get_parameter('server_id', 0); $server_id = $event['server_id'];
$comments = $event['comments'];
$event['similar_ids'] = $similar_ids; if (!isset($comments)) {
$event['timestamp_first'] = $timestamp_first; $comments = $event['user_comment'];
$event['timestamp_last'] = $timestamp_last; }
$event['event_rep'] = $event_rep;
// Check ACLs. // Check ACLs.
if (is_user_admin($config['id_user'])) { if (is_user_admin($config['id_user'])) {
@ -418,7 +1110,7 @@ if ($get_extended_event) {
} }
// Tabs. // 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>'; $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) { 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>'; $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 $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'] != '') { 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>'; $tabs .= '</ul>';
@ -498,7 +1190,7 @@ if ($get_extended_event) {
$childrens_ids $childrens_ids
))) )))
) { ) {
$responses = events_page_responses($event, $childrens_ids); $responses = events_page_responses($event);
} else { } else {
$responses = ''; $responses = '';
} }
@ -535,7 +1227,7 @@ if ($get_extended_event) {
$general = events_page_general($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_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>'; $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' 'AND'
); );
echo '<div style="display: flex;" id="div_all_events_24h">'; 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( echo html_print_switch(
[ [
'name' => 'all_events_24h', 'name' => 'all_events_24h',

View File

@ -392,11 +392,16 @@ if (check_login()) {
switch ($row['module_type']) { switch ($row['module_type']) {
case 15: case 15:
$value = db_get_value('snmp_oid', 'tagente_modulo', 'id_agente_modulo', $module_id); $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 ($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_macro = modules_get_unit_macro($row[$attr[0]], $unit);
$data[] = human_milliseconds_to_string(($row['data'] / $post_process)); if ($data_macro) {
$data[] = $data_macro;
} else { } else {
$data[] = human_milliseconds_to_string($row['data']); $data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision']));
} }
} else { } else {
$data[] = remove_right_zeros(number_format($row[$attr[0]], $config['graph_precision'])); $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[7] = __('Data');
$table->head[8] = __('Graph'); $table->head[8] = __('Graph');
$table->head[9] = __('Last contact').ui_get_sorting_arrows($url_up_last, $url_down_last, $selectLastContactUp, $selectLastContactDown); $table->head[9] = __('Last contact').ui_get_sorting_arrows($url_up_last, $url_down_last, $selectLastContactUp, $selectLastContactDown);
$table->align = [ $table->align = [];
'left', $table->align[0] = 'center';
'left', $table->align[1] = 'left';
'left', $table->align[2] = 'left';
'left', $table->align[3] = 'left';
'left', $table->align[4] = 'left';
'left', $table->align[5] = 'left';
'left', $table->align[6] = 'center';
'left', $table->align[7] = 'left';
'left', $table->align[8] = 'center';
]; $table->align[9] = 'right';
$table->headstyle[2] = 'min-width: 60px'; $table->headstyle[2] = 'min-width: 85px';
$table->headstyle[3] = 'min-width: 100px'; $table->headstyle[3] = 'min-width: 130px';
$table->headstyle[5] = 'min-width: 60px'; $table->size[3] = '30%';
$table->headstyle[8] = 'min-width: 85px'; $table->style[3] = 'max-width: 28em;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;';
$table->headstyle[9] = 'min-width: 100px'; $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; $last_modulegroup = 0;
$rowIndex = 0; $rowIndex = 0;
@ -879,14 +889,14 @@ if (check_login()) {
$last_modulegroup = $module['id_module_group']; $last_modulegroup = $module['id_module_group'];
} }
// End of title of group // End of title of group.
} }
$data = []; $data = [];
if (($module['id_modulo'] != 1) && ($module['id_tipo_modulo'] != 100)) { if (($module['id_modulo'] != 1) && ($module['id_tipo_modulo'] != 100)) {
if ($agent_w) { if ($agent_w) {
if ($module['flag'] == 0) { 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 { } 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>'; $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) { if ($data_macro) {
$salida = $data_macro; $salida = $data_macro;
} else { } else {
$salida .= '&nbsp;'.'<i>'.io_safe_output($module['unit']).'</i>'; $salida .= '&nbsp;<i>'.io_safe_output($module['unit']).'</i>';
} }
} }
} else { } else {
@ -1120,17 +1130,17 @@ if (check_login()) {
$draw_events = 0; $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( urlencode(
base64_encode($module['nombre']) 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'])) { 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;'; $data[8] .= '<a href="javascript:'.$link.'">'.html_print_image('images/chart_curve.png', true, ['border' => '0', 'alt' => '']).'</a> &nbsp;&nbsp;';
} }
$server_name = ''; $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) { 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.') ]); ui_print_info_message([ 'no_close' => true, 'message' => __('This agent doesn\'t have any active monitors.') ]);
} }
} else { } 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) { if ($paginate_module) {
ui_pagination( ui_pagination(

View File

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

View File

@ -1206,6 +1206,8 @@ switch ($action) {
switch ($type) { switch ($type) {
case 'auto_sla_graph': case 'auto_sla_graph':
$elementFields['event_max_time_row'] = $elementFields['period']; $elementFields['event_max_time_row'] = $elementFields['period'];
break;
case 'percentile_item': case 'percentile_item':
case 'percentile_bar': case 'percentile_bar':
$elementFields['width_percentile'] = $elementFields['width']; $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.css" type="text/css" />
<link rel="stylesheet" href="styles/pandora_minimal.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.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/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-3.3.1.min.js'></script>
<script language="javascript" type='text/javascript' src='javascript/jquery.pandora.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_io.php';
require_once $config['homedir'].'/include/functions_notifications.php'; require_once $config['homedir'].'/include/functions_notifications.php';
require_once $config['homedir'].'/include/functions_servers.php'; require_once $config['homedir'].'/include/functions_servers.php';
require_once $config['homedir'].'/include/functions_update_manager.php';
// Enterprise includes. // Enterprise includes.
enterprise_include_once('include/functions_metaconsole.php'); enterprise_include_once('include/functions_metaconsole.php');
@ -1940,6 +1941,7 @@ class ConsoleSupervisor
public function checkUpdateManagerRegistration() public function checkUpdateManagerRegistration()
{ {
global $config; global $config;
include_once $config['homedir'].'/include/functions_update_manager.php';
$login = get_parameter('login', false); $login = get_parameter('login', false);
if (update_manager_verify_registration() === false) { if (update_manager_verify_registration() === false) {
@ -2244,6 +2246,7 @@ class ConsoleSupervisor
public function getUMMessages() public function getUMMessages()
{ {
global $config; global $config;
include_once $config['homedir'].'/include/functions_update_manager.php';
if (update_manager_verify_registration() === false) { if (update_manager_verify_registration() === false) {
// Console not subscribed. // Console not subscribed.
@ -2261,8 +2264,6 @@ class ConsoleSupervisor
$future = (time() + 2 * SECONDS_1HOUR); $future = (time() + 2 * SECONDS_1HOUR);
config_update_value('last_um_check', $future); config_update_value('last_um_check', $future);
include_once $config['homedir'].'/include/functions_update_manager.php';
$params = [ $params = [
'pandora_uid' => $config['pandora_uid'], 'pandora_uid' => $config['pandora_uid'],
'timezone' => $config['timezone'], 'timezone' => $config['timezone'],

View File

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

View File

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

View File

@ -20,7 +20,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC190614'; $build_version = 'PC190625';
$pandora_version = 'v7.0NG.735'; $pandora_version = 'v7.0NG.735';
// Do not overwrite default timezone set if defined. // 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'); define('TIME_FORMAT_JS', 'HH:mm:ss');
// Events state constants. // Events state constants.
define('EVENT_ALL', -1);
define('EVENT_NEW', 0); define('EVENT_NEW', 0);
define('EVENT_VALIDATE', 1); define('EVENT_VALIDATE', 1);
define('EVENT_PROCESS', 2); define('EVENT_PROCESS', 2);
define('EVENT_NO_VALIDATED', 3);
// Agents disabled status. // Agents disabled status.
@ -65,7 +66,7 @@ define('ERR_NODATA', -70000);
define('ERR_CONNECTION', -80000); define('ERR_CONNECTION', -80000);
define('ERR_DISABLED', -90000); define('ERR_DISABLED', -90000);
define('ERR_WRONG', -100000); define('ERR_WRONG', -100000);
define('ERR_WRONG_NAME', -100001); define('ERR_WRONG_MR', -100001);
define('ERR_WRONG_PARAMETERS', -100002); define('ERR_WRONG_PARAMETERS', -100002);
define('ERR_ACL', -110000); define('ERR_ACL', -110000);
define('ERR_AUTH', -120000); define('ERR_AUTH', -120000);
@ -137,19 +138,19 @@ switch ($config['dbtype']) {
// Color constants. // Color constants.
define('COL_CRITICAL', '#FC4444'); define('COL_CRITICAL', '#e63c52');
define('COL_WARNING', '#FAD403'); define('COL_WARNING', '#f3b200');
define('COL_WARNING_DARK', '#FFB900'); define('COL_WARNING_DARK', '#FFB900');
define('COL_NORMAL', '#80BA27'); define('COL_NORMAL', '#82b92e');
define('COL_NOTINIT', '#3BA0FF'); define('COL_NOTINIT', '#4a83f3');
define('COL_UNKNOWN', '#B2B2B2'); define('COL_UNKNOWN', '#B2B2B2');
define('COL_DOWNTIME', '#976DB1'); define('COL_DOWNTIME', '#976DB1');
define('COL_IGNORED', '#DDD'); define('COL_IGNORED', '#DDD');
define('COL_ALERTFIRED', '#FFA631'); define('COL_ALERTFIRED', '#FFA631');
define('COL_MINOR', '#F099A2'); define('COL_MINOR', '#B2B2B2');
define('COL_MAJOR', '#C97A4A'); define('COL_MAJOR', '#C97A4A');
define('COL_INFORMATIONAL', '#E4E4E4'); define('COL_INFORMATIONAL', '#E4E4E4');
define('COL_MAINTENANCE', '#3BA0FF'); define('COL_MAINTENANCE', '#4a83f3');
define('COL_GRAPH1', '#C397F2'); define('COL_GRAPH1', '#C397F2');
define('COL_GRAPH2', '#FFE66C'); 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. * Get a parameter from a request.
* *
@ -1392,6 +1433,11 @@ function enterprise_installed()
{ {
$return = false; $return = false;
// Load enterprise extensions.
if (defined('DESTDIR')) {
return $return;
}
if (defined('PANDORA_ENTERPRISE')) { if (defined('PANDORA_ENTERPRISE')) {
if (PANDORA_ENTERPRISE) { if (PANDORA_ENTERPRISE) {
$return = true; $return = true;
@ -1444,7 +1490,7 @@ function enterprise_include($filename)
{ {
global $config; global $config;
// Load enterprise extensions // Load enterprise extensions.
if (defined('DESTDIR')) { if (defined('DESTDIR')) {
$destdir = DESTDIR; $destdir = DESTDIR;
} else { } 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) function enterprise_include_once($filename)
{ {
global $config; global $config;
// Load enterprise extensions // Load enterprise extensions.
if (defined('DESTDIR')) {
$destdir = DESTDIR;
} else {
$destdir = '';
}
$filepath = realpath($config['homedir'].'/'.ENTERPRISE_DIR.'/'.$filename); $filepath = realpath($config['homedir'].'/'.ENTERPRISE_DIR.'/'.$filename);
if ($filepath === false) { 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() function is_metaconsole()
{ {
global $config; 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 * @brief Check if there is management operations are allowed in current context
* (node // meta) * (node // meta)

View File

@ -1614,9 +1614,9 @@ function agents_get_interval($id_agent)
* *
* @param Agent object. * @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 = ''; $return = '';
$last_time = time_w_fixed_tz($agent['ultimo_contacto']); $last_time = time_w_fixed_tz($agent['ultimo_contacto']);
@ -1624,9 +1624,18 @@ function agents_get_interval_status($agent)
$diferencia = ($now - $last_time); $diferencia = ($now - $last_time);
$time = ui_print_timestamp($last_time, true, ['style' => 'font-size:6.5pt']); $time = ui_print_timestamp($last_time, true, ['style' => 'font-size:6.5pt']);
$min_interval = modules_get_agentmodule_mininterval_no_async($agent['id_agente']); $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) { 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; return $return;
@ -3367,3 +3376,35 @@ function agents_get_image_status($status)
return $image_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] ['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) { if ($result > 0) {
// Update fired alert count on the agent // Update fired alert count on the agent
db_process_sql(sprintf('UPDATE tagente SET update_alert_count=1 WHERE id_agente = %d', $agent_id)); db_process_sql(sprintf('UPDATE tagente SET update_alert_count=1 WHERE id_agente = %d', $agent_id));
events_create_event( 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, $group_id,
$agent_id, $agent_id,
1, 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_modulo = talert_template_modules.id_agent_module';
$filter[] = 'tagente_modulo.id_agente = tagente.id_agente'; $filter[] = 'tagente_modulo.id_agente = tagente.id_agente';
$filter['id_alert_template'] = $id_alert_template; $filter['id_alert_template'] = $id_alert_template;
$filter['tagente_modulo.disabled'] = '<> 1';
$filter['delete_pending'] = '<> 1'; $filter['delete_pending'] = '<> 1';
if (empty($id_agents)) { if (empty($id_agents)) {

View File

@ -11518,7 +11518,7 @@ function api_set_create_event($id, $trash1, $other, $returnType)
if ($other['data'][18] != '') { if ($other['data'][18] != '') {
$values['id_extra'] = $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); $validation = db_get_all_rows_sql($sql_validation);
if ($validation) { if ($validation) {
foreach ($validation as $val) { foreach ($validation as $val) {

View File

@ -180,7 +180,7 @@ function config_update_config()
$error_update[] = __('Automatic check for updates'); $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'); $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_pop[$key_reverse] = array_pop(
$data_array_reverse[$key_reverse] $data_array_reverse[$key_reverse]
); );
$count_data_array_reverse--;
} }
} }
@ -2343,14 +2344,21 @@ function graphic_agentaccess(
$date = get_system_time(); $date = get_system_time();
$datelimit = ($date - $period); $datelimit = ($date - $period);
$data_array = []; $data_array = [];
$interval = agents_get_interval($id_agent);
$data = db_get_all_rows_sql( $data = db_get_all_rows_sql(
"SELECT count(*) as data, min(utimestamp) as utimestamp sprintf(
FROM tagent_access 'SELECT utimestamp, count(*) as data
WHERE id_agent = $id_agent FROM tagent_access
AND utimestamp > $datelimit WHERE id_agent = %d
AND utimestamp < $date AND utimestamp > %d
GROUP by ROUND(utimestamp / 1800)" AND utimestamp < %d
GROUP BY ROUND(utimestamp/%d)',
$id_agent,
$datelimit,
$date,
$interval
)
); );
if (isset($data) && is_array($data)) { 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 = array(COL_CRITICAL, COL_WARNING, COL_NORMAL, COL_UNKNOWN);
$colors[__('Critical')] = COL_CRITICAL; $colors['Critical'] = COL_CRITICAL;
$colors[__('Warning')] = COL_WARNING; $colors['Warning'] = COL_WARNING;
$colors[__('Normal')] = COL_NORMAL; $colors['Normal'] = COL_NORMAL;
$colors[__('Unknown')] = COL_UNKNOWN; $colors['Unknown'] = COL_UNKNOWN;
if ($show_not_init) { if ($show_not_init) {
$colors[__('Not init')] = COL_NOTINIT; $colors['Not init'] = COL_NOTINIT;
} }
if (array_sum($data) == 0) { 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; $maxlength = 255;
} }
if ($size == 0) { if ($size === false) {
$size = '';
} else if ($size == 0) {
$size = 10; $size = 10;
} }
@ -1442,7 +1444,9 @@ function html_print_input_password(
$maxlength = 255; $maxlength = 255;
} }
if ($size == 0) { if ($size === false) {
$size = false;
} else if ($size == 0) {
$size = 10; $size = 10;
} }
@ -1480,7 +1484,9 @@ function html_print_input_text($name, $value, $alt='', $size=50, $maxlength=255,
$maxlength = 255; $maxlength = 255;
} }
if ($size == 0) { if ($size === false) {
$size = false;
} else if ($size == 0) {
$size = 10; $size = 10;
} }
@ -2731,20 +2737,22 @@ function html_html2rgb($htmlcolor)
/** /**
* Print a magic-ajax control to select the module. * Print a magic-ajax control to select the module.
* *
* @param string $name The name of ajax control, by default is "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 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 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 boolean $ACL Filter the agents by the ACL list of user.
* @param string $scriptResult The source code of script to call, by default is * @param string $scriptResult The source code of script to call, by default is
* empty. And the example is: * empty. And the example is:
* function (e, data, formatted) { * 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 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 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. * @return mixed If the $return is true, return the output as string.
*/ */
@ -2756,7 +2764,8 @@ function html_print_autocomplete_modules(
$scriptResult='', $scriptResult='',
$filter=[], $filter=[],
$return=false, $return=false,
$id_agent_module=0 $id_agent_module=0,
$size='30'
) { ) {
global $config; global $config;
@ -2797,7 +2806,7 @@ function html_print_autocomplete_modules(
$default, $default,
'text-'.$name, 'text-'.$name,
'', '',
30, $size,
100, 100,
false, 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;'); $url_down = 'index.php?'.http_build_query($params, '', '&amp;');
// Build the links // 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>';
} }
@ -3053,4 +3065,4 @@ function html_print_link_with_params($text, $params=[], $type='text', $style='')
$html .= '</form>'; $html .= '</form>';
return $html; return $html;
} }

View File

@ -87,7 +87,7 @@ function menu_print_menu(&$menu)
// ~ if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $mainsec)) == false) // ~ if (enterprise_hook ('enterprise_acl', array ($config['id_user'], $mainsec)) == false)
// ~ continue; // ~ continue;
if (! isset($main['id'])) { if (! isset($main['id'])) {
$id = 'menu_'.++$idcounter; $id = 'menu_'.(++$idcounter);
} else { } else {
$id = $main['id']; $id = $main['id'];
} }
@ -405,9 +405,9 @@ function menu_print_menu(&$menu)
$padding_top = ( $length >= 18) ? 6 : 12; $padding_top = ( $length >= 18) ? 6 : 12;
if ($config['menu_type'] == 'classic') { 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 { } 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 // Add the notification ball if defined

View File

@ -2230,6 +2230,7 @@ function modules_get_agentmodule_data(
'module_name' => $values[$key]['module_name'], 'module_name' => $values[$key]['module_name'],
'agent_id' => $values[$key]['agent_id'], 'agent_id' => $values[$key]['agent_id'],
'agent_name' => $values[$key]['agent_name'], '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 (($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)) { 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)) { } 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( $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) { } else if ($relation['child_type'] == NODE_MODULE) {
if ($item['status_start'] == AGENT_MODULE_STATUS_CRITICAL_BAD) { 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) { } 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( $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) { } else if ($relation['parent_type'] == NODE_MODULE) {
if ($item['status_end'] == AGENT_MODULE_STATUS_CRITICAL_BAD) { 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) { } 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( $agent = agents_get_agent_id_by_module_id(

View File

@ -151,11 +151,13 @@ function reporting_make_reporting_data(
$contents = $report['contents']; $contents = $report['contents'];
} else { } else {
$report = io_safe_output(db_get_row('treport', 'id_report', $id_report)); $report = io_safe_output(db_get_row('treport', 'id_report', $id_report));
$contents = db_get_all_rows_field_filter( $contents = io_safe_output(
'treport_content', db_get_all_rows_field_filter(
'id_report', 'treport_content',
$id_report, 'id_report',
db_escape_key_identifier('order') $id_report,
db_escape_key_identifier('order')
)
); );
} }
@ -326,26 +328,32 @@ function reporting_make_reporting_data(
break; break;
case 'general': case 'general':
$report['contents'][] = reporting_general( $report['contents'][] = io_safe_output(
$report, reporting_general(
$content $report,
$content
)
); );
break; break;
case 'availability': case 'availability':
$report['contents'][] = reporting_availability( $report['contents'][] = io_safe_output(
$report, reporting_availability(
$content, $report,
$date, $content,
$time $date,
$time
)
); );
break; break;
case 'availability_graph': case 'availability_graph':
$report['contents'][] = reporting_availability_graph( $report['contents'][] = io_safe_output(
$report, reporting_availability_graph(
$content, $report,
$pdf $content,
$pdf
)
); );
break; break;
@ -475,9 +483,11 @@ function reporting_make_reporting_data(
break; break;
case 'agent_configuration': case 'agent_configuration':
$report['contents'][] = reporting_agent_configuration( $report['contents'][] = io_safe_output(
$report, reporting_agent_configuration(
$content $report,
$content
)
); );
break; break;
@ -673,12 +683,14 @@ function reporting_make_reporting_data(
case 'agent_detailed_event': case 'agent_detailed_event':
case 'event_report_agent': case 'event_report_agent':
$report_control = reporting_event_report_agent( $report_control = io_safe_output(
$report, reporting_event_report_agent(
$content, $report,
$type, $content,
$force_width_chart, $type,
$force_height_chart $force_width_chart,
$force_height_chart
)
); );
if ($report_control['total_events'] == 0 && $content['hide_no_data'] == 1) { if ($report_control['total_events'] == 0 && $content['hide_no_data'] == 1) {
continue; continue;
@ -1383,7 +1395,7 @@ function reporting_event_top_n(
foreach ($tops as $key => $row) { foreach ($tops as $key => $row) {
// Metaconsole connection. // Metaconsole connection.
$server_name = $row['server_name']; $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); $connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) { if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name); // ui_print_error_message ("Error connecting to ".$server_name);
@ -1426,7 +1438,7 @@ function reporting_event_top_n(
} }
// Restore dbconnection. // Restore dbconnection.
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) { if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db(); metaconsole_restore_db();
} }
} }
@ -2176,7 +2188,7 @@ function reporting_agent_module($report, $content)
foreach ($agents as $agent) { foreach ($agents as $agent) {
$row = []; $row = [];
$row['agent_status'][$agent] = agents_get_status($agent); $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); $agent_modules = agents_get_modules($agent);
$row['modules'] = []; $row['modules'] = [];
@ -2330,7 +2342,7 @@ function reporting_exception(
do { do {
// Metaconsole connection. // Metaconsole connection.
$server_name = $exceptions[$i]['server_name']; $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); $connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) { if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name); // ui_print_error_message ("Error connecting to ".$server_name);
@ -2372,7 +2384,7 @@ function reporting_exception(
$i++; $i++;
// Restore dbconnection. // Restore dbconnection.
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) { if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db(); metaconsole_restore_db();
} }
} while ($min === false && $i < count($exceptions)); } while ($min === false && $i < count($exceptions));
@ -2385,7 +2397,7 @@ function reporting_exception(
foreach ($exceptions as $exc) { foreach ($exceptions as $exc) {
// Metaconsole connection. // Metaconsole connection.
$server_name = $exc['server_name']; $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); $connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) { if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name); // ui_print_error_message ("Error connecting to ".$server_name);
@ -2499,7 +2511,7 @@ function reporting_exception(
} }
// Restore dbconnection // Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) { if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db(); metaconsole_restore_db();
} }
} }
@ -2693,7 +2705,7 @@ function reporting_group_report($report, $content)
{ {
global $config; global $config;
$metaconsole_on = ($config['metaconsole'] == 1) && defined('METACONSOLE'); $metaconsole_on = ($config['metaconsole'] == 1) && is_metaconsole();
$return['type'] = 'group_report'; $return['type'] = 'group_report';
@ -2777,7 +2789,7 @@ function reporting_event_report_agent(
} }
$return['title'] = $content['name']; $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['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content); $return['date'] = reporting_get_date_text($report, $content);
@ -6073,7 +6085,7 @@ function reporting_advanced_sla(
// SLA. // SLA.
$return['SLA'] = reporting_sla_get_compliance_from_array($return); $return['SLA'] = reporting_sla_get_compliance_from_array($return);
$return['SLA_fixed'] = sla_truncate( $return['sla_fixed'] = sla_truncate(
$return['SLA'], $return['SLA'],
$config['graph_precision'] $config['graph_precision']
); );
@ -6173,7 +6185,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
foreach ($items as $item) { foreach ($items as $item) {
// aaMetaconsole connection // aaMetaconsole connection
$server_name = $item['server_name']; $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); $connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) { if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name); // 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']) || modules_is_not_init($item['id_agent_module'])
) { ) {
// Restore dbconnection // Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) { if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db(); metaconsole_restore_db();
} }
@ -6242,7 +6254,7 @@ function reporting_availability($report, $content, $date=false, $time=false)
$text = $row['data']['agent'].' ('.$text.')'; $text = $row['data']['agent'].' ('.$text.')';
// Restore dbconnection // Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) { if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db(); metaconsole_restore_db();
} }
@ -6396,10 +6408,12 @@ function reporting_availability_graph($report, $content, $pdf=false)
$edge_interval = 10; $edge_interval = 10;
if (empty($content['subitems'])) { if (empty($content['subitems'])) {
$slas = db_get_all_rows_field_filter( $slas = io_safe_output(
'treport_content_sla_combined', db_get_all_rows_field_filter(
'id_report_content', 'treport_content_sla_combined',
$content['id_rc'] 'id_report_content',
$content['id_rc']
)
); );
} else { } else {
$slas = $content['subitems']; $slas = $content['subitems'];
@ -6807,7 +6821,7 @@ function reporting_increment($report, $content)
$return['data'] = []; $return['data'] = [];
if (defined('METACONSOLE')) { if (is_metaconsole()) {
$sql1 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.' $sql1 = 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = '.$id_agent_module.'
AND utimestamp <= '.(time() - $period).' ORDER BY utimestamp DESC'; 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'; $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'); $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) { if ($old_data === false || $last_data === false) {
@ -6934,7 +6948,7 @@ function reporting_general($report, $content)
foreach ($generals as $row) { foreach ($generals as $row) {
// Metaconsole connection // Metaconsole connection
$server_name = $row['server_name']; $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); $connection = metaconsole_get_connection($server_name);
if (metaconsole_load_external_db($connection) != NOERR) { if (metaconsole_load_external_db($connection) != NOERR) {
// ui_print_error_message ("Error connecting to ".$server_name); // ui_print_error_message ("Error connecting to ".$server_name);
@ -7085,7 +7099,7 @@ function reporting_general($report, $content)
$i++; $i++;
// Restore dbconnection // Restore dbconnection
if (($config['metaconsole'] == 1) && $server_name != '' && defined('METACONSOLE')) { if (($config['metaconsole'] == 1) && $server_name != '' && is_metaconsole()) {
metaconsole_restore_db(); metaconsole_restore_db();
} }
} }
@ -10980,10 +10994,10 @@ function reporting_get_stats_servers()
$tdata = []; $tdata = [];
'<span class="big_data">'.format_numeric($server_performance['total_local_modules']).'</span>'; '<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[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[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->rowclass[] = '';
$table_srv->data[] = $tdata; $table_srv->data[] = $tdata;
@ -10995,22 +11009,22 @@ function reporting_get_stats_servers()
$table_srv->data[] = $tdata; $table_srv->data[] = $tdata;
$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[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[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->rowclass[] = '';
$table_srv->data[] = $tdata; $table_srv->data[] = $tdata;
if (isset($server_performance['total_network_modules'])) { if (isset($server_performance['total_network_modules'])) {
$tdata = []; $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[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[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()) { 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>"; $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'])) { if (isset($server_performance['total_plugin_modules'])) {
$tdata = []; $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[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[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->rowclass[] = '';
$table_srv->data[] = $tdata; $table_srv->data[] = $tdata;
@ -11036,11 +11050,11 @@ function reporting_get_stats_servers()
if (isset($server_performance['total_prediction_modules'])) { if (isset($server_performance['total_prediction_modules'])) {
$tdata = []; $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[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[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->rowclass[] = '';
$table_srv->data[] = $tdata; $table_srv->data[] = $tdata;
@ -11048,11 +11062,11 @@ function reporting_get_stats_servers()
if (isset($server_performance['total_wmi_modules'])) { if (isset($server_performance['total_wmi_modules'])) {
$tdata = []; $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[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[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->rowclass[] = '';
$table_srv->data[] = $tdata; $table_srv->data[] = $tdata;
@ -11060,11 +11074,11 @@ function reporting_get_stats_servers()
if (isset($server_performance['total_web_modules'])) { if (isset($server_performance['total_web_modules'])) {
$tdata = []; $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[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[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->rowclass[] = '';
$table_srv->data[] = $tdata; $table_srv->data[] = $tdata;
@ -11082,7 +11096,6 @@ function reporting_get_stats_servers()
true, true,
[ [
'title' => __('Total events'), 'title' => __('Total events'),
'width' => '25px',
] ]
); );
$tdata[1] = '<span class="big_data" id="total_events">'.html_print_image('images/spinner.gif', true).'</span>'; $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 = [];
$agent_data[0] = html_print_image('images/agent_critical.png', true, ['title' => __('Agents critical')]); $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[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; $table_agent->data[] = $agent_data;
$agent_data = []; $agent_data = [];
$agent_data[0] = html_print_image('images/agent_ok.png', true, ['title' => __('Agents ok')]); $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[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>'; $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')) { 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] = 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->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] = 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->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] = 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->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'; $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>'; $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 { } else {
$table_events->data[0][0] = html_print_image('images/module_critical.png', true, ['title' => __('Critical events')]); $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] = 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] = 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] = 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>'; $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 .= '<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>';
$output .= '<div style="width: 100%; padding-top: 10px;">'; $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>'; $output .= '</div>';
// SNMP tree container // SNMP tree container

View File

@ -744,7 +744,8 @@ function tags_get_acl_tags(
$query_table='', $query_table='',
$meta=false, $meta=false,
$childrens_ids=[], $childrens_ids=[],
$force_group_and_tag=false $force_group_and_tag=false,
$id_grupo_table_pretag=''
) { ) {
global $config; global $config;
@ -814,7 +815,13 @@ function tags_get_acl_tags(
case 'event_condition': case 'event_condition':
// Return the condition of the tags for tevento table. // 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)) { if (!empty($condition)) {
return " $query_prefix ".'('.$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; global $config;
$condition = []; $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 (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 = 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 (The module has at least one of the restricted tags).
$tags_condition = ''; $tags_condition = '';
@ -959,7 +971,7 @@ function tags_get_acl_tags_event_condition($acltags, $meta=false, $force_group_a
} }
$in_group = implode(',', $without_tags); $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)" : ''; $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)) { if (empty($user_tags_id)) {
$user_tags_id = $t; $user_tags_id = $t;
} else { } else {
if (empty($t)) {
// Empty is 'all of them'.
// TODO: Review this...
$t = [];
}
$user_tags_id = array_unique(array_merge($t, $user_tags_id)); $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')) { if ($user_access_node && check_acl($config['id_user'], $id_group, 'AW')) {
// Actions table // 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.'">'; 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"'); html_print_submit_button(__('Go to module edition'), 'upd_button', false, 'class="sub config"');
echo '</a>'; echo '</a>';
@ -637,7 +637,13 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
$row = []; $row = [];
$row['title'] = __('Next agent contact'); $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; $table->data['next_contact'] = $row;
// End of table // End of table
@ -664,7 +670,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
$agent_table .= '<br>'; $agent_table .= '<br>';
// print agent data toggle // print agent data toggle
ui_toggle($agent_table, __('Agent data'), '', false); ui_toggle($agent_table, __('Agent data'), '', '', false);
// Advanced data // Advanced data
$table = new StdClass(); $table = new StdClass();

View File

@ -1441,11 +1441,16 @@ function ui_require_css_file($name, $path='include/styles/')
if (! file_exists($filename) if (! file_exists($filename)
&& ! file_exists($config['homedir'].'/'.$filename) && ! file_exists($config['homedir'].'/'.$filename)
&& ! file_exists($config['homedir'].'/'.ENTERPRISE_DIR.'/'.$filename)
) { ) {
return false; return false;
} }
$config['css'][$name] = $filename; if (is_metaconsole()) {
$config['css'][$name] = '/../../'.$filename;
} else {
$config['css'][$name] = $filename;
}
return true; return true;
} }
@ -1738,6 +1743,7 @@ function ui_process_page_head($string, $bitfield)
// Add the jquery UI styles CSS. // Add the jquery UI styles CSS.
$config['css']['jquery-UI'] = 'include/styles/js/jquery-ui.min.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. // Add the dialog styles CSS.
$config['css']['dialog'] = 'include/styles/dialog.css'; $config['css']['dialog'] = 'include/styles/dialog.css';
// Add the dialog styles CSS. // Add the dialog styles CSS.
@ -1756,6 +1762,7 @@ function ui_process_page_head($string, $bitfield)
[ [
'common' => 'include/styles/common.css', 'common' => 'include/styles/common.css',
'menu' => 'include/styles/menu.css', 'menu' => 'include/styles/menu.css',
'tables' => 'include/styles/tables.css',
$config['style'] => 'include/styles/'.$config['style'].'.css', $config['style'] => 'include/styles/'.$config['style'].'.css',
], ],
$config['css'] $config['css']
@ -1783,47 +1790,6 @@ function ui_process_page_head($string, $bitfield)
* End load CSS * 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 * Load jQuery
*/ */
@ -1881,6 +1847,47 @@ function ui_process_page_head($string, $bitfield)
* End load JQuery * 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'; include_once __DIR__.'/graphs/functions_flot.php';
$output .= include_javascript_dependencies_flot_graph(true); $output .= include_javascript_dependencies_flot_graph(true);
@ -2717,6 +2724,15 @@ function ui_print_module_status(
* @param string $color Color. * @param string $color Color.
* @param boolean $return Return or paint (if false). * @param boolean $return Return or paint (if false).
* @param boolean $text Text to be displayed,by default progress %. * @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. * @return string HTML code.
*/ */
@ -2724,9 +2740,10 @@ function ui_progress(
$progress, $progress,
$width='100%', $width='100%',
$height='2.5', $height='2.5',
$color='#80ba27', $color='#82b92e',
$return=true, $return=true,
$text='' $text='',
$ajax=false
) { ) {
if (!$progress) { if (!$progress) {
$progress = 0; $progress = 0;
@ -2745,10 +2762,56 @@ function ui_progress(
} }
ui_require_css_file('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_main" data-label="'.$text;
$output .= '<span class="progress_text" style="font-size:'.($height - 0.5).'em;">'.$text.'</span>'; $output .= '" style="width: '.$width.'; height: '.$height.'em; border: 1px solid '.$color.'">';
$output .= '<div class="progress" style="width: '.$progress.'%; background: '.$color.'"></div>'; $output .= '<span class="progress" style="width: '.$progress.'%; background: '.$color.'"></span>';
$output .= '</div>'; $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) { if (!$return) {
echo $output; 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. * 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. * Print a code into a DIV and enable a toggle to show and hide it.
* *
* @param string $code Html code. * @param string $code Html code.
* @param string $name Name of the link. * @param string $name Name of the link.
* @param string $title Title 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 string $id Block id.
* @param boolean $return Whether to return an output string or echo now (default: true). * @param boolean $hidden_default If the div will be hidden by default (default: true).
* @param string $toggle_class Toggle class. * @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. * @return string HTML.
*/ */
@ -2932,10 +3454,12 @@ function ui_toggle(
$code, $code,
$name, $name,
$title='', $title='',
$id='',
$hidden_default=true, $hidden_default=true,
$return=false, $return=false,
$toggle_class='', $toggle_class='',
$container_class='white-box-content' $container_class='white-box-content',
$main_class='box-shadow white_table_graph'
) { ) {
// Generate unique Id. // Generate unique Id.
$uniqid = uniqid(''); $uniqid = uniqid('');
@ -2952,7 +3476,7 @@ function ui_toggle(
} }
// Link to 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( $output .= '<div class="white_table_graph_header" style="cursor: pointer;" id="tgl_ctrl_'.$uniqid.'">'.html_print_image(
$original, $original,
true, true,
@ -3295,11 +3819,11 @@ function ui_print_page_header(
if ($godmode == true) { if ($godmode == true) {
$type = 'view'; $type = 'view';
$type2 = (empty($breadcrumbs)) ? 'menu_tab_frame_view' : 'menu_tab_frame_view_bc'; $type2 = 'menu_tab_frame_view';
$separator_class = 'separator'; $separator_class = 'separator';
} else { } else {
$type = 'view'; $type = 'view';
$type2 = (empty($breadcrumbs)) ? 'menu_tab_frame_view' : 'menu_tab_frame_view_bc'; $type2 = 'menu_tab_frame_view';
$separator_class = 'separator_view'; $separator_class = 'separator_view';
} }

View File

@ -468,7 +468,7 @@ function registration_wiz_modal(
__('Cancel'), __('Cancel'),
'cancel_registration', 'cancel_registration',
false, 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 true
); );
$output .= '</div>'; $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. * Get all the groups a user has reading privileges.
* *
* @param string User id * @param string $id_user User id
* @param string The privilege to evaluate, and it is false then no check ACL. * @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 $returnAllGroup Flag the return group, by default true.
* @param boolean $returnAllColumns Flag to return all columns of groups. * @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 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 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 boolean $cache Set it to false to not use cache
* *
* @return array A list of the groups the user has certain privileges. * @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>';
echo "<tr style='background-color:whitesmoke;height:90%;'>"; echo "<tr style='background-color:whitesmoke;height:90%;'>";
echo '<td>'; 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='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='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>"; 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); colors = colors.split(separator);
} }
var colors_data = [ var colors_data = [
"#FC4444", "#e63c52",
"#FFA631", "#FFA631",
"#FAD403", "#f3b200",
"#5BB6E5", "#5BB6E5",
"#F2919D", "#F2919D",
"#80BA27" "#82b92e"
]; ];
var color = null; var color = null;
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
@ -380,12 +380,12 @@ function pandoraFlotHBars(
max max
) { ) {
var colors_data = [ var colors_data = [
"#FC4444", "#e63c52",
"#FFA631", "#FFA631",
"#FAD403", "#f3b200",
"#5BB6E5", "#5BB6E5",
"#F2919D", "#F2919D",
"#80BA27" "#82b92e"
]; ];
values = values.split(separator2); values = values.split(separator2);
font = font font = font
@ -639,7 +639,7 @@ function pandoraFlotVBars(
var colors_data = var colors_data =
colors.length > 0 colors.length > 0
? colors ? colors
: ["#FFA631", "#FC4444", "#FAD403", "#5BB6E5", "#F2919D", "#80BA27"]; : ["#FFA631", "#e63c52", "#f3b200", "#5BB6E5", "#F2919D", "#82b92e"];
var datas = new Array(); var datas = new Array();
for (i = 0; i < values.length; i++) { for (i = 0; i < values.length; i++) {
@ -2681,13 +2681,13 @@ function pandoraFlotArea(
if (events_data.event_type.search("alert") >= 0) { if (events_data.event_type.search("alert") >= 0) {
extra_color = "#FFA631"; extra_color = "#FFA631";
} else if (events_data.event_type.search("critical") >= 0) { } else if (events_data.event_type.search("critical") >= 0) {
extra_color = "#FC4444"; extra_color = "#e63c52";
} else if (events_data.event_type.search("warning") >= 0) { } else if (events_data.event_type.search("warning") >= 0) {
extra_color = "#FAD403"; extra_color = "#f3b200";
} else if (events_data.event_type.search("unknown") >= 0) { } else if (events_data.event_type.search("unknown") >= 0) {
extra_color = "#3BA0FF"; extra_color = "#4a83f3";
} else if (events_data.event_type.search("normal") >= 0) { } else if (events_data.event_type.search("normal") >= 0) {
extra_color = "#80BA27"; extra_color = "#82b92e";
} else { } else {
extra_color = "#ffffff"; extra_color = "#ffffff";
} }

View File

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

View File

@ -1614,9 +1614,9 @@ function print_phases_donut(recipient, phases) {
.insert("path") .insert("path")
.style("fill", function(d) { .style("fill", function(d) {
if (d.data.value == 0) { if (d.data.value == 0) {
return "#80BA27"; return "#82b92e";
} else { } else {
return "#FC4444"; return "#e63c52";
} }
}) })
.attr("class", "slice"); .attr("class", "slice");
@ -2849,7 +2849,6 @@ function donutNarrowGraph(colores, width, height, total) {
}) })
.attr("d", arc) .attr("d", arc)
.attr("stroke", "white") .attr("stroke", "white")
.style("stroke-width", 2)
.style("fill", function(d) { .style("fill", function(d) {
return color(d.data.key); return color(d.data.key);
}); });
@ -2873,8 +2872,6 @@ function donutNarrowGraph(colores, width, height, total) {
.attr("y", 0 + radius / 10) .attr("y", 0 + radius / 10)
.attr("class", "text-tooltip") .attr("class", "text-tooltip")
.style("text-anchor", "middle") .style("text-anchor", "middle")
.attr("font-weight", "bold")
.style("font-family", "Arial, Verdana")
//.attr("fill", "#82b92e") //.attr("fill", "#82b92e")
.style("font-size", function(d) { .style("font-size", function(d) {
if (normal_status) { 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["arrow_start"] = "module";
temp_link["id_module_start"] = interface_source; temp_link["id_module_start"] = interface_source;
temp_link["status_start"] = data["status"]; 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 { } else {
temp_link["arrow_start"] = ""; temp_link["arrow_start"] = "";
temp_link["id_agent_start"] = interface_source; 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["arrow_end"] = "module";
temp_link["id_module_end"] = interface_target; temp_link["id_module_end"] = interface_target;
temp_link["status_end"] = data["status"]; 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 { } else {
temp_link["arrow_end"] = ""; temp_link["arrow_end"] = "";
temp_link["id_agent_end"] = interface_target; 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["id_module_start"] = source_value;
temp_link["status_start"] = data["status_start"]; temp_link["status_start"] = data["status_start"];
temp_link["link_color"] = temp_link["link_color"] =
data["status_start"] == "1" ? "#FC4444" : "#999"; data["status_start"] == "1" ? "#e63c52" : "#999";
} else { } else {
temp_link["arrow_start"] = ""; temp_link["arrow_start"] = "";
temp_link["id_agent_start"] = source_value; 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["id_module_end"] = target_value;
temp_link["status_end"] = data["status_end"]; temp_link["status_end"] = data["status_end"];
temp_link["link_color"] = temp_link["link_color"] =
data["status_end"] == "1" ? "#FC4444" : "#999"; data["status_end"] == "1" ? "#e63c52" : "#999";
} else { } else {
temp_link["arrow_end"] = ""; temp_link["arrow_end"] = "";
temp_link["id_agent_end"] = target_value; temp_link["id_agent_end"] = target_value;

View File

@ -1599,7 +1599,7 @@ function paint_graph_status(
.attr("y", height_x - 30) .attr("y", height_x - 30)
.attr("width", 10) .attr("width", 10)
.attr("height", 10) .attr("height", 10)
.style("fill", "#fc4444"); .style("fill", "#e63c52");
//styles for number and axes //styles for number and axes
svg svg
@ -1683,7 +1683,7 @@ function paint_graph_status(
) )
.attr("width", 300) .attr("width", 300)
.attr("height", (max_c - min_c) * position) .attr("height", (max_c - min_c) * position)
.style("fill", "#fc4444"); .style("fill", "#e63c52");
} else { } else {
svg svg
.append("g") .append("g")
@ -1695,7 +1695,7 @@ function paint_graph_status(
.attr("y", height_x + 200 - (min_c - range_min) * position) .attr("y", height_x + 200 - (min_c - range_min) * position)
.attr("width", 300) .attr("width", 300)
.attr("height", (min_c - range_min) * position) .attr("height", (min_c - range_min) * position)
.style("fill", "#fc4444"); .style("fill", "#e63c52");
svg svg
.append("g") .append("g")
.append("rect") .append("rect")
@ -1709,7 +1709,7 @@ function paint_graph_status(
"height", "height",
(range_max - min_c) * position - (max_c - min_c) * position (range_max - min_c) * position - (max_c - min_c) * position
) )
.style("fill", "#fc4444"); .style("fill", "#e63c52");
} }
} else { } else {
d3.select("#svg_dinamic rect").remove(); 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 // 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(); var ajax_file = $("#hidden-ajax_file").val();
if (dialog_page == undefined) { if (dialog_page == undefined) {
dialog_page = "general"; dialog_page = "general";
} }
var similar_ids = $("#hidden-similar_ids_" + event_id).val(); current_event = event;
var timestamp_first = $("#hidden-timestamp_first_" + event_id).val();
var timestamp_last = $("#hidden-timestamp_last_" + event_id).val(); try {
var user_comment = $("#hidden-user_comment_" + event_id).val(); event = JSON.parse(atob(event));
var event_rep = $("#hidden-event_rep_" + event_id).val(); } catch (e) {
var server_id = $("#hidden-server_id_" + event_id).val(); console.error(e);
var childrens_ids = $("#hidden-childrens_ids").val(); return;
}
var inputs = $("#events_form :input");
var values = {};
inputs.each(function() {
values[this.name] = $(this).val();
});
// Metaconsole mode flag // Metaconsole mode flag
var meta = $("#hidden-meta").val(); var meta = $("#hidden-meta").val();
@ -25,26 +35,19 @@ function show_event_dialog(event_id, group_rep, dialog_page, result) {
{ {
page: "include/ajax/events", page: "include/ajax/events",
get_extended_event: 1, get_extended_event: 1,
group_rep: group_rep,
event_rep: event_rep,
dialog_page: dialog_page, dialog_page: dialog_page,
similar_ids: similar_ids, event: event,
timestamp_first: timestamp_first,
timestamp_last: timestamp_last,
user_comment: user_comment,
event_id: event_id,
server_id: server_id,
meta: meta, meta: meta,
childrens_ids: childrens_ids, history: history,
history: history filter: values
}, },
function(data, status) { function(data) {
$("#event_details_window") $("#event_details_window")
.hide() .hide()
.empty() .empty()
.append(data) .append(data)
.dialog({ .dialog({
title: get_event_name(event_id, meta, history), title: event.evento,
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: true, modal: true,
@ -56,8 +59,8 @@ function show_event_dialog(event_id, group_rep, dialog_page, result) {
opacity: 0.5, opacity: 0.5,
background: "black" background: "black"
}, },
width: 725, width: 710,
height: 530 height: 600
}) })
.show(); .show();
@ -92,45 +95,6 @@ function show_event_dialog(event_id, group_rep, dialog_page, result) {
return false; 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 // Check the response type and open it in a modal dialog or new window
function execute_response(event_id, server_id) { function execute_response(event_id, server_id) {
var response_id = $("#select_custom_response option:selected").val(); 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 //Show the modal window of an event response
function show_response_dialog(event_id, response_id, response) { function show_response_dialog(event_id, response_id, response) {
var ajax_file = $("#hidden-ajax_file").val();
var params = []; var params = [];
params.push("page=include/ajax/events"); params.push("page=include/ajax/events");
params.push("dialogue_event_response=1"); params.push("dialogue_event_response=1");
@ -173,7 +135,7 @@ function show_response_dialog(event_id, response_id, response) {
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
dataType: "html", dataType: "html",
success: function(data) { success: function(data) {
$("#event_response_window") $("#event_response_window")
@ -185,7 +147,7 @@ function show_response_dialog(event_id, response_id, response) {
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: false, modal: false,
open: function(event, ui) { open: function() {
perform_response(response["target"], response_id); perform_response(response["target"], response_id);
}, },
width: response["modal_width"], width: response["modal_width"],
@ -204,8 +166,6 @@ function show_massive_response_dialog(
out_iterator, out_iterator,
end end
) { ) {
var ajax_file = $("#hidden-ajax_file").val();
var params = []; var params = [];
params.push("page=include/ajax/events"); params.push("page=include/ajax/events");
params.push("dialogue_event_response=1"); params.push("dialogue_event_response=1");
@ -222,7 +182,7 @@ function show_massive_response_dialog(
response_id: response_id, response_id: response_id,
out_iterator: out_iterator, out_iterator: out_iterator,
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
dataType: "html", dataType: "html",
success: function(data) { success: function(data) {
if (out_iterator === 0) $("#event_response_window").empty(); if (out_iterator === 0) $("#event_response_window").empty();
@ -235,11 +195,11 @@ function show_massive_response_dialog(
resizable: true, resizable: true,
draggable: true, draggable: true,
modal: false, modal: false,
open: function(event, ui) { open: function() {
$("#response_loading_dialog").hide(); $("#response_loading_dialog").hide();
$("#button-submit_event_response").show(); $("#button-submit_event_response").show();
}, },
close: function(event, ui) { close: function() {
$(".chk_val").prop("checked", false); $(".chk_val").prop("checked", false);
$("#event_response_command_window").dialog("close"); $("#event_response_command_window").dialog("close");
}, },
@ -259,8 +219,6 @@ function show_massive_response_dialog(
// Get an event response from db // Get an event response from db
function get_response(response_id) { function get_response(response_id) {
var ajax_file = $("#hidden-ajax_file").val();
var response = ""; var response = "";
var params = []; var params = [];
@ -271,7 +229,7 @@ function get_response(response_id) {
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
async: false, async: false,
timeout: 10000, timeout: 10000,
dataType: "json", dataType: "json",
@ -285,8 +243,6 @@ function get_response(response_id) {
// Get an event response params from db // Get an event response params from db
function get_response_params(response_id) { function get_response_params(response_id) {
var ajax_file = $("#hidden-ajax_file").val();
var response_params; var response_params;
var params = []; var params = [];
@ -297,7 +253,7 @@ function get_response_params(response_id) {
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
async: false, async: false,
timeout: 10000, timeout: 10000,
dataType: "json", dataType: "json",
@ -311,8 +267,6 @@ function get_response_params(response_id) {
// Get an event response description from db // Get an event response description from db
function get_response_description(response_id) { function get_response_description(response_id) {
var ajax_file = $("#hidden-ajax_file").val();
var response_description = ""; var response_description = "";
var params = []; var params = [];
@ -323,7 +277,7 @@ function get_response_description(response_id) {
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
async: false, async: false,
timeout: 10000, timeout: 10000,
dataType: "html", dataType: "html",
@ -337,8 +291,6 @@ function get_response_description(response_id) {
// Get an event response description from db // Get an event response description from db
function get_event_name(event_id, meta, history) { function get_event_name(event_id, meta, history) {
var ajax_file = $("#hidden-ajax_file").val();
var name = ""; var name = "";
var params = []; var params = [];
@ -351,7 +303,7 @@ function get_event_name(event_id, meta, history) {
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
async: false, async: false,
timeout: 10000, timeout: 10000,
dataType: "html", dataType: "html",
@ -382,8 +334,6 @@ function get_response_target(
server_id, server_id,
response_command response_command
) { ) {
var ajax_file = $("#hidden-ajax_file").val();
var target = ""; var target = "";
// Replace the main macros // Replace the main macros
@ -397,7 +347,7 @@ function get_response_target(
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
async: false, async: false,
timeout: 10000, timeout: 10000,
dataType: "html", dataType: "html",
@ -409,7 +359,7 @@ function get_response_target(
// Replace the custom params macros. // Replace the custom params macros.
var response_params = get_response_params(response_id); var response_params = get_response_params(response_id);
if (response_params.length > 1 || response_params[0] != "") { 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) { if (!response_command) {
target = target.replace( target = target.replace(
"_" + response_params[i] + "_", "_" + response_params[i] + "_",
@ -429,16 +379,10 @@ function get_response_target(
// Perform a response and put the output into a div // Perform a response and put the output into a div
function perform_response(target, response_id) { function perform_response(target, response_id) {
var ajax_file = $("#hidden-ajax_file").val();
$("#re_exec_command").hide(); $("#re_exec_command").hide();
$("#response_loading_command").show(); $("#response_loading_command").show();
$("#response_out").html(""); $("#response_out").html("");
var finished = 0;
var time = Math.round(+new Date() / 1000);
var timeout = time + 10;
var params = []; var params = [];
params.push("page=include/ajax/events"); params.push("page=include/ajax/events");
params.push("perform_event_response=1"); params.push("perform_event_response=1");
@ -448,7 +392,7 @@ function perform_response(target, response_id) {
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
async: true, async: true,
timeout: 10000, timeout: 10000,
dataType: "html", dataType: "html",
@ -465,8 +409,6 @@ function perform_response(target, response_id) {
// Perform a response and put the output into a div // Perform a response and put the output into a div
function perform_response_massive(target, response_id, out_iterator) { function perform_response_massive(target, response_id, out_iterator) {
var ajax_file = $("#hidden-ajax_file").val();
$("#re_exec_command").hide(); $("#re_exec_command").hide();
$("#response_loading_command_" + out_iterator).show(); $("#response_loading_command_" + out_iterator).show();
$("#response_out_" + out_iterator).html(""); $("#response_out_" + out_iterator).html("");
@ -480,7 +422,7 @@ function perform_response_massive(target, response_id, out_iterator) {
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
async: true, async: true,
timeout: 10000, timeout: 10000,
dataType: "html", 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. // Change the status of an event to new, in process or validated.
function event_change_status(event_ids) { function event_change_status(event_ids) {
var ajax_file = $("#hidden-ajax_file").val();
var new_status = $("#estado").val(); var new_status = $("#estado").val();
var event_id = $("#hidden-id_event").val(); var event_id = $("#hidden-id_event").val();
var meta = $("#hidden-meta").val(); var meta = $("#hidden-meta").val();
@ -518,7 +458,7 @@ function event_change_status(event_ids) {
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
async: true, async: true,
timeout: 10000, timeout: 10000,
dataType: "html", dataType: "html",
@ -531,9 +471,6 @@ function event_change_status(event_ids) {
"responses", "responses",
data data
); );
if (data == "status_ok") {
} else {
}
} }
}); });
return false; return false;
@ -541,8 +478,6 @@ function event_change_status(event_ids) {
// Change te owner of an event to one user of empty // Change te owner of an event to one user of empty
function event_change_owner() { function event_change_owner() {
var ajax_file = $("#hidden-ajax_file").val();
var event_id = $("#hidden-id_event").val(); var event_id = $("#hidden-id_event").val();
var new_owner = $("#id_owner").val(); var new_owner = $("#id_owner").val();
var meta = $("#hidden-meta").val(); var meta = $("#hidden-meta").val();
@ -562,7 +497,7 @@ function event_change_owner() {
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
async: true, async: true,
timeout: 10000, timeout: 10000,
dataType: "html", dataType: "html",
@ -584,20 +519,21 @@ function event_change_owner() {
// Save a comment into an event // Save a comment into an event
function event_comment() { 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 comment = $("#textarea_comment").val();
var meta = $("#hidden-meta").val(); var meta = $("#hidden-meta").val();
var history = $("#hidden-history").val(); var history = $("#hidden-history").val();
if (comment == "") { if (comment == "") {
show_event_dialog( show_event_dialog(current_event, "comments", "comment_error");
event_id,
$("#hidden-group_rep").val(),
"comments",
"comment_error"
);
return false; return false;
} }
@ -615,20 +551,15 @@ function event_comment() {
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
async: true, async: true,
timeout: 10000, timeout: 10000,
dataType: "html", dataType: "html",
success: function(data) { success: function(data) {
$("#button-comment_button").removeAttr("disabled"); $("#button-comment_button").removeAttr("disabled");
$("#response_loading").show(); $("#response_loading").show();
dt_events.draw(false);
show_event_dialog( show_event_dialog(current_event, "comments", data);
event_id,
$("#hidden-group_rep").val(),
"comments",
data
);
} }
}); });
@ -637,8 +568,7 @@ function event_comment() {
//Show event list when fielter repetead is Group agents //Show event list when fielter repetead is Group agents
function show_events_group_agent(id_insert, id_agent, server_id) { function show_events_group_agent(id_insert, id_agent, server_id) {
var ajax_file = $("#hidden-ajax_file").val(); var parameter = [];
parameter = [];
parameter.push({ name: "id_agent", value: id_agent }); parameter.push({ name: "id_agent", value: id_agent });
parameter.push({ name: "server_id", value: server_id }); parameter.push({ name: "server_id", value: server_id });
parameter.push({ name: "event_type", value: $("#event_type").val() }); 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({ jQuery.ajax({
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
data: parameter, data: parameter,
dataType: "html", dataType: "html",
success: function(data) { 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) { function show_event_response_command_dialog(id, response, total_checked) {
var ajax_file = $("#hidden-ajax_file").val();
var params = []; var params = [];
params.push("page=include/ajax/events"); params.push("page=include/ajax/events");
params.push("get_table_response_command=1"); params.push("get_table_response_command=1");
@ -701,7 +629,7 @@ function show_event_response_command_dialog(id, response, total_checked) {
jQuery.ajax({ jQuery.ajax({
data: params.join("&"), data: params.join("&"),
type: "POST", type: "POST",
url: (action = ajax_file), url: $("#hidden-ajax_file").val(),
dataType: "html", dataType: "html",
success: function(data) { success: function(data) {
$("#event_response_command_window") $("#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) ? JSON.parse(data.items)
: 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; var prevProps = visualConsole.props;
// Update the data structure. // Update the data structure.
visualConsole.props = props; visualConsole.props = props;

View File

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

View File

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

View File

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

View File

@ -1,13 +1,14 @@
text.text-tooltip { 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 { 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 { table#agent_interface_info .noresizevc.graph {
width: 500px !important; width: 500px;
} }
div.agent_details_agent_alias { div.agent_details_agent_alias {
@ -15,5 +16,66 @@ div.agent_details_agent_alias {
} }
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 */ /* Debug styles */
pre.debug, pre.debug,
div.backtrace { div.backtrace {
font-family: monospace !important; font-family: monospace;
text-align: left; text-align: left;
padding: 10px; padding: 10px;
margin: 5px; margin: 5px;
@ -66,9 +66,9 @@ img.right {
text-align: right; text-align: right;
} }
.noshadow { .noshadow {
-moz-box-shadow: 0px !important; -moz-box-shadow: 0px;
-webkit-box-shadow: 0px !important; -webkit-box-shadow: 0px;
box-shadow: 0px !important; box-shadow: 0px;
} }
.center_align { .center_align {
text-align: center; text-align: center;

View File

@ -1,38 +1,38 @@
/* This file skins dialog */ /* This file skins dialog */
.ui-dialog { .ui-dialog {
background: none repeat scroll 0 0 #3f3f3f !important; background: none repeat scroll 0 0 #3f3f3f;
border: 1px solid #3f3f3f !important; border: 1px solid #3f3f3f;
color: #333333 !important; color: #333333;
padding: 0.2em !important; padding: 0.2em;
overflow: hidden !important; overflow: hidden;
-moz-border-radius: 6px !important; -moz-border-radius: 6px;
-webkit-border-radius: 6px !important; -webkit-border-radius: 6px;
border-radius: 6px !important; border-radius: 6px;
-moz-box-shadow: 0px 5px 5px #010e1b !important; -moz-box-shadow: 0px 5px 5px #010e1b;
-webkit-box-shadow: 0px 5px 5px #010e1b !important; -webkit-box-shadow: 0px 5px 5px #010e1b;
box-shadow: 0px 5px 5px #010e1b !important; box-shadow: 0px 5px 5px #010e1b;
} }
.ui-widget-header { .ui-widget-header {
background: #3f3f3f !important; background: #3f3f3f;
} }
.ui-dialog .ui-dialog-titlebar { .ui-dialog .ui-dialog-titlebar {
background-color: #ececec; background-color: #ececec;
height: 24px !important; height: 24px;
padding: 0.3em 1em !important; padding: 0.3em 1em;
position: relative; position: relative;
margin: 0px auto 0 auto !important; margin: 0px auto 0 auto;
font-weight: bold !important; font-weight: bold;
border-bottom: none !important; border-bottom: none;
border-top: none !important; border-top: none;
border-left: none !important; border-left: none;
border-right: none !important; border-right: none;
color: #ffffff !important; color: #ffffff;
#padding: 0.1em 1em !important; #padding: 0.1em 1em;
-moz-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0;
-webkit-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0;
@ -40,114 +40,114 @@
} }
.ui-dialog .ui-dialog-title { .ui-dialog .ui-dialog-title {
margin-left: 5px !important; margin-left: 5px;
color: white !important; color: white;
font-weight: bold !important; font-weight: bold;
position: relative !important; position: relative;
top: 3px; top: 3px;
font-size: 10pt; font-size: 10pt;
left: 4px !important; left: 4px;
float: none !important; float: none;
} }
.ui-dialog.ui-draggable .ui-dialog-titlebar { .ui-dialog.ui-draggable .ui-dialog-titlebar {
cursor: move !important; cursor: move;
} }
.ui-dialog .ui-dialog-titlebar-close { .ui-dialog .ui-dialog-titlebar-close {
width: 23px !important; width: 23px;
height: 23px !important; height: 23px;
background: url(images/dialog-titlebar-close.png) no-repeat !important; background: url(images/dialog-titlebar-close.png) no-repeat;
position: absolute !important; position: absolute;
top: 6px; top: 6px;
right: 3px !important; right: 3px;
cursor: pointer !important; cursor: pointer;
} }
.ui-dialog .ui-dialog-titlebar-close span { .ui-dialog .ui-dialog-titlebar-close span {
display: none !important; display: none;
} }
.ui-dialog .ui-dialog-titlebar-close-hover { .ui-dialog .ui-dialog-titlebar-close-hover {
color: #000000 !important; color: #000000;
} }
.ui-dialog .ui-dialog-titlebar-close:hover span { .ui-dialog .ui-dialog-titlebar-close:hover span {
display: none !important; display: none;
} }
.ui-dialog .ui-dialog-titlebar-close:hover { .ui-dialog .ui-dialog-titlebar-close:hover {
color: #000000 !important; color: #000000;
} }
.ui-dialog .ui-dialog-content { .ui-dialog .ui-dialog-content {
margin: 12px !important; margin: 12px;
#padding: 0.5em 1em !important; #padding: 0.5em 1em;
overflow: auto !important; overflow: auto;
-moz-border-left: 1px solid #a9a9a9 !important; -moz-border-left: 1px solid #a9a9a9;
-moz-border-right: 1px solid #a9a9a9 !important; -moz-border-right: 1px solid #a9a9a9;
-moz-border-bottom: 1px solid #a9a9a9 !important; -moz-border-bottom: 1px solid #a9a9a9;
-moz-border-radius: 8px 8px 8px 8px !important; -moz-border-radius: 8px 8px 8px 8px;
-webkit-border-left: 1px solid #a9a9a9 !important; -webkit-border-left: 1px solid #a9a9a9;
-webkit-border-right: 1px solid #a9a9a9 !important; -webkit-border-right: 1px solid #a9a9a9;
-webkit-border-bottom: 1px solid #a9a9a9 !important; -webkit-border-bottom: 1px solid #a9a9a9;
-webkit-border-radius: 8px 8px 8px 8px !important; -webkit-border-radius: 8px 8px 8px 8px;
border-left: 1px solid #a9a9a9 !important; border-left: 1px solid #a9a9a9;
border-right: 1px solid #a9a9a9 !important; border-right: 1px solid #a9a9a9;
border-bottom: 1px solid #a9a9a9 !important; border-bottom: 1px solid #a9a9a9;
border-radius: 8px 8px 8px 8px !important; border-radius: 8px 8px 8px 8px;
background: #ffffff !important; background: #ffffff;
position: relative !important; position: relative;
} }
.ui-tabs .ui-tabs-nav { .ui-tabs .ui-tabs-nav {
background-color: white !important; background-color: white;
} }
.ui-tabs-panel { .ui-tabs-panel {
background: #ececec !important; background: #ececec;
-moz-border-radius: 8px !important; -moz-border-radius: 8px;
-webkit-border-radius: 8px !important; -webkit-border-radius: 8px;
border-radius: 8px !important; border-radius: 8px;
-moz-border-top-left-radius: 0px !important; -moz-border-top-left-radius: 0px;
-webkit-border-top-left-radius: 0px !important; -webkit-border-top-left-radius: 0px;
border-top-left-radius: 0px !important; border-top-left-radius: 0px;
-moz-box-shadow: -1px 1px 6px #aaa; -moz-box-shadow: -1px 1px 6px #aaa;
-webkit-box-shadow: -1px 1px 6px #aaa; -webkit-box-shadow: -1px 1px 6px #aaa;
box-shadow: 1px 1px 6px #aaa; box-shadow: 1px 1px 6px #aaa;
} }
.ui-widget .ui-widget { .ui-widget .ui-widget {
border: 0px !important; border: 0px;
} }
.ui-state-default:first-child { .ui-state-default:first-child {
margin-left: -3px !important; margin-left: -3px;
} }
.ui-state-default { .ui-state-default {
background: #fff !important; background: #fff;
border: 2px solid #ececec !important; border: 2px solid #ececec;
-moz-border-top-left-radius: 10px !important; -moz-border-top-left-radius: 10px;
-webkit-top-left-border-radius: 10px !important; -webkit-top-left-border-radius: 10px;
border-top-left-radius: 10px !important; border-top-left-radius: 10px;
-moz-border-top-right-radius: 10px !important; -moz-border-top-right-radius: 10px;
-webkit-top-right-border-radius: 10px !important; -webkit-top-right-border-radius: 10px;
border-top-right-radius: 10px !important; border-top-right-radius: 10px;
margin-left: 2px !important; margin-left: 2px;
} }
.ui-state-active { .ui-state-active {
background: #ececec !important; background: #ececec;
} }
.ui-dialog-content { .ui-dialog-content {
overflow: auto !important; overflow: auto;
width: auto !important; width: auto;
#height: auto !important; #height: auto;
} }
.ui-dialog .ui-dialog-buttonpane { .ui-dialog .ui-dialog-buttonpane {
@ -185,8 +185,8 @@
font-weight: bold; font-weight: bold;
outline: medium none; outline: medium none;
cursor: pointer; cursor: pointer;
margin: 0.5em 0.4em 0.5em 0 !important; margin: 0.5em 0.4em 0.5em 0;
border-radius: 4px 4px 4px 4px !important; border-radius: 4px 4px 4px 4px;
} }
.ui-dialog .ui-button-dialog:hover { .ui-dialog .ui-button-dialog:hover {
@ -199,5 +199,5 @@
.ui-dialog-overlay { .ui-dialog-overlay {
background: url("images/ui-bg_diagonals-thick_20_666666_40x40.png") repeat 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; display: inline-block;
float: left; float: left;
width: 250px; width: 250px;
height: 120px;
margin: 15px; margin: 15px;
padding-bottom: 50px; padding-bottom: 50px;
} }
@ -28,7 +27,7 @@ li.discovery > a label {
} }
div.data_container > 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; font-weight: lighter;
} }
@ -117,7 +116,7 @@ div.arrow_box:before {
min-height: 55px; min-height: 55px;
width: 100%; width: 100%;
padding-right: 0px; padding-right: 0px;
margin-left: 0px !important; margin-left: 0px;
margin-bottom: 20px; margin-bottom: 20px;
height: 55px; height: 55px;
box-sizing: border-box; box-sizing: border-box;
@ -132,21 +131,21 @@ div.arrow_box:before {
} }
.breadcrumbs_container { .breadcrumbs_container {
padding-left: 10px;
padding-top: 4px; padding-top: 4px;
text-indent: 0.25em; text-indent: 0.25em;
padding-left: 2.5em;
} }
.breadcrumb_link { .breadcrumb_link {
color: #848484; color: #848484;
font-size: 10pt !important; font-size: 10pt;
font-family: "lato-bolder", "Open Sans", sans-serif !important; font-family: "lato-bolder", "Open Sans", sans-serif;
text-decoration: none !important; text-decoration: none;
} }
span.breadcrumb_link { span.breadcrumb_link {
color: #d0d0d0; color: #d0d0d0;
font-size: 12pt !important; font-size: 12pt;
} }
.breadcrumb_link.selected { .breadcrumb_link.selected {
@ -168,6 +167,11 @@ form.discovery * {
font-size: 10pt; font-size: 10pt;
} }
form.discovery .label_select b {
font-family: "lato", "Open Sans", sans-serif;
font-weight: bolder;
}
.edit_discovery_info { .edit_discovery_info {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
@ -188,7 +192,7 @@ form.discovery * {
} }
label { label {
color: #343434 !important; color: #343434;
font-weight: bold; font-weight: bold;
} }
@ -201,11 +205,11 @@ li > input[type="password"],
.discovery_text_input > input[type="password"], .discovery_text_input > input[type="password"],
.discovery_text_input > input[type="text"], .discovery_text_input > input[type="text"],
#interval_manual > input[type="text"] { #interval_manual > input[type="text"] {
background-color: transparent !important; background-color: transparent;
border: none; border: none;
border-radius: 0 !important; border-radius: 0;
border-bottom: 1px solid #ccc; 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; font-weight: lighter;
padding: 0px 0px 2px 0px; padding: 0px 0px 2px 0px;
box-sizing: border-box; box-sizing: border-box;
@ -234,7 +238,7 @@ li > input[type="password"],
} }
.discovery_textarea_input { .discovery_textarea_input {
background-color: #fbfbfb !important; background-color: #fbfbfb;
padding-left: 10px; padding-left: 10px;
width: 100%; width: 100%;
height: 100px; height: 100px;

View File

@ -12,9 +12,324 @@ div.criticity {
} }
div.mini-criticity { div.mini-criticity {
width: 5px; width: 10px;
height: 4em; height: 3em;
padding: 0; padding: 0;
margin: 0; margin: 0;
display: inline-block; 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 { .button_task {
margin-top: 10px; margin-top: 10px;
background-color: #3f3f3f !important; background-color: #3f3f3f;
padding: 10px 10px 10px 10px; padding: 10px 10px 10px 10px;
font-weight: bold; font-weight: bold;
color: #82b92e; color: #82b92e;

View File

@ -1,5 +1,5 @@
div.fixed-bottom-box { div.fixed-bottom-box {
background: #e1e1e1; background: #fff;
border-radius: 10px 10px 0 0; border-radius: 10px 10px 0 0;
-moz-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; -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 { div.fixed-bottom-box > div.fixed-bottom-box-head {
height: 30px; height: 30px;
line-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; background: none;
} }
.title .toggle { .title .toggle {
background: transparent url(images/toggle.png) no-repeat scroll !important; background: transparent url(images/toggle.png) no-repeat scroll;
} }
.title a { .title a {
@ -70,7 +70,7 @@ div#foot {
box-shadow: 0px 0px 15px #000000; box-shadow: 0px 0px 15px #000000;
} }
div#foot a { div#foot a {
color: #333 !important; color: #333;
} }
div#foot a.white:after { div#foot a.white:after {

View File

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