Merge remote-tracking branch 'origin/develop' into ent-4755-base-de-datos-historico-revision
This commit is contained in:
commit
0179e89740
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.752-210322
|
||||
Version: 7.0NG.752-210324
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.752-210322"
|
||||
pandora_version="7.0NG.752-210324"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1016,7 +1016,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.752';
|
||||
use constant AGENT_BUILD => '210322';
|
||||
use constant AGENT_BUILD => '210324';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.752
|
||||
%define release 210322
|
||||
%define release 210324
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.752
|
||||
%define release 210322
|
||||
%define release 210324
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.752"
|
||||
PI_BUILD="210322"
|
||||
PI_BUILD="210324"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{210322}
|
||||
{210324}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.752(Build 210322)")
|
||||
#define PANDORA_VERSION ("7.0NG.752(Build 210324)")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.752(Build 210322))"
|
||||
VALUE "ProductVersion", "(7.0NG.752(Build 210324))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.752-210322
|
||||
Version: 7.0NG.752-210324
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.752-210322"
|
||||
pandora_version="7.0NG.752-210324"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -902,7 +902,9 @@ if ($config['menu_type'] == 'classic') {
|
|||
blinkpubli();
|
||||
|
||||
<?php
|
||||
if ($_GET['refr'] || $do_refresh === true) {
|
||||
if ($_GET['refr']
|
||||
|| (isset($do_refresh) === true && $do_refresh === true)
|
||||
) {
|
||||
if ($_GET['sec2'] == 'operation/events/events') {
|
||||
$autorefresh_draw = true;
|
||||
}
|
||||
|
@ -966,7 +968,7 @@ if ($config['menu_type'] == 'classic') {
|
|||
var newValue = btoa(JSON.stringify(values));
|
||||
<?php
|
||||
// Check if the url has the parameter fb64.
|
||||
if ($_GET['fb64']) {
|
||||
if (isset($_GET['fb64']) === true) {
|
||||
$fb64 = $_GET['fb64'];
|
||||
?>
|
||||
var fb64 = '<?php echo $fb64; ?>';
|
||||
|
|
|
@ -188,7 +188,12 @@ try {
|
|||
|
||||
$double_auth_enabled = (bool) db_get_value('id', 'tuser_double_auth', 'id_user', $config['id_user']);
|
||||
|
||||
if (!$double_auth_enabled && $config['2FA_all_users'] != ''
|
||||
if (isset($config['2FA_all_users']) === false) {
|
||||
$config['2FA_all_users'] = null;
|
||||
}
|
||||
|
||||
if (!$double_auth_enabled
|
||||
&& $config['2FA_all_users'] != ''
|
||||
&& $config['2Fa_auth'] != '1'
|
||||
&& $config['double_auth_enabled']
|
||||
) {
|
||||
|
|
|
@ -548,10 +548,7 @@ class AgentsAlerts extends HTML
|
|||
if (empty($templates_raw)) {
|
||||
$templates_raw = [];
|
||||
}
|
||||
}
|
||||
|
||||
// Is needed sort templates for show in the row.
|
||||
sort($templates);
|
||||
};
|
||||
|
||||
$alerts = [];
|
||||
$ntemplates = 0;
|
||||
|
@ -600,20 +597,22 @@ class AgentsAlerts extends HTML
|
|||
}
|
||||
|
||||
$templates[$temp['id']] = $temp['name'];
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($temp['name']) === false) {
|
||||
$outputLine = html_print_div(
|
||||
[
|
||||
'id' => 'line_header_'.$temp['id'],
|
||||
'class' => 'rotate_text_module position_text_module',
|
||||
'style' => '',
|
||||
'content' => '<div title="'.io_safe_output($temp['name']).'">'.ui_print_truncate_text(io_safe_output($temp['name']), 20).'</div>',
|
||||
],
|
||||
true
|
||||
);
|
||||
foreach ($templates as $id => $name) {
|
||||
if (empty($name) === false) {
|
||||
$outputLine = html_print_div(
|
||||
[
|
||||
'id' => 'line_header_'.$id,
|
||||
'class' => 'rotate_text_module position_text_module',
|
||||
'style' => '',
|
||||
'content' => '<div title="'.io_safe_output($name).'">'.ui_print_truncate_text(io_safe_output($name), 20).'</div>',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
echo sprintf('<th class="th_class_module_r header_table_caption_cell" style="width:%s">%s</th>', $thSize, $outputLine);
|
||||
}
|
||||
echo sprintf('<th class="th_class_module_r header_table_caption_cell" style="width:%s">%s</th>', $thSize, $outputLine);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -651,7 +650,7 @@ class AgentsAlerts extends HTML
|
|||
$alias = db_get_row('tagente', 'id_agente', $agent['id_agente']);
|
||||
echo '<tr>';
|
||||
// Name of the agent.
|
||||
echo '<td class="bolder right">'.$alias['alias'].'</td>';
|
||||
echo '<td class="bolder" style="text-align: right" >'.$alias['alias'].'</td>';
|
||||
// Alerts of the agent.
|
||||
foreach ($templates as $tid => $tname) {
|
||||
$anyfired = 0;
|
||||
|
|
|
@ -666,7 +666,6 @@ class ConsoleSupervisor
|
|||
case 'NOTIF.PANDORADB.HISTORICAL':
|
||||
case 'NOTIF.HISTORYDB.MR':
|
||||
case 'NOTIF.EXT.ELASTICSEARCH':
|
||||
case 'NOTIF.EXT.LOGSTASH':
|
||||
case 'NOTIF.METACONSOLE.DB_CONNECTION':
|
||||
case 'NOTIF.DOWNTIME':
|
||||
case 'NOTIF.UPDATEMANAGER.REGISTRATION':
|
||||
|
@ -1804,7 +1803,6 @@ class ConsoleSupervisor
|
|||
{
|
||||
global $config;
|
||||
|
||||
// Cannot check logstash, configuration is only available from server.
|
||||
// Cannot check selenium, configuration is only available from server.
|
||||
if (isset($config['log_collector'])
|
||||
&& $config['log_collector'] == 1
|
||||
|
|
|
@ -782,8 +782,40 @@ class HTML
|
|||
}
|
||||
|
||||
if (isset($data['form']) === true) {
|
||||
$output_head .= '<form name="'.$form['name'].'" id="'.$form['id'].'" class="discovery '.$form['class'].'" onsubmit="'.$form['onsubmit'].'" enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
|
||||
$output_head .= '" '.$form['extra'].'>';
|
||||
$output_head .= '<form ';
|
||||
if (isset($form['name']) === true) {
|
||||
$output_head .= 'name="'.$form['name'].'" ';
|
||||
}
|
||||
|
||||
if (isset($form['id']) === true) {
|
||||
$output_head .= 'id="'.$form['id'].'" ';
|
||||
}
|
||||
|
||||
if (isset($form['class']) === true) {
|
||||
$output_head .= 'class="discovery '.$form['class'].'" ';
|
||||
}
|
||||
|
||||
if (isset($form['onsubmit']) === true) {
|
||||
$output_head .= 'onsubmit="'.$form['onsubmit'].'" ';
|
||||
}
|
||||
|
||||
if (isset($form['enctype']) === true) {
|
||||
$output_head .= 'enctype="'.$form['enctype'].'" ';
|
||||
}
|
||||
|
||||
if (isset($form['action']) === true) {
|
||||
$output_head .= 'action="'.$form['action'].'" ';
|
||||
}
|
||||
|
||||
if (isset($form['method']) === true) {
|
||||
$output_head .= 'method="'.$form['method'].'" ';
|
||||
}
|
||||
|
||||
if (isset($form['extra']) === true) {
|
||||
$output_head .= $form['extra'];
|
||||
}
|
||||
|
||||
$output_head .= '>';
|
||||
}
|
||||
|
||||
if ($return === false) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC210322';
|
||||
$build_version = 'PC210324';
|
||||
$pandora_version = 'v7.0NG.752';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
@ -52,6 +52,10 @@ if ((int) $develop_bypass === 1) {
|
|||
}
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
} else {
|
||||
// Leave user decide error_level, but limit errors to be displayed only in
|
||||
// logs.
|
||||
ini_set('display_errors', 0);
|
||||
}
|
||||
|
||||
// Check if mysqli is available
|
||||
|
|
|
@ -3319,7 +3319,7 @@ function get_um_url()
|
|||
*/
|
||||
function config_return_in_bytes($val)
|
||||
{
|
||||
$val = trim($val);
|
||||
$val = (int) trim($val);
|
||||
$last = strtolower($val[(strlen($val) - 1)]);
|
||||
switch ($last) {
|
||||
// The 'G' modifier is available since PHP 5.1.0.
|
||||
|
|
|
@ -675,6 +675,33 @@ function events_update_status($id_evento, $status, $filter=null, $history=false)
|
|||
*
|
||||
* @param array $fields Fields to retrieve.
|
||||
* @param array $filter Filters to be applied.
|
||||
* Available filters:
|
||||
* [
|
||||
* 'date_from'
|
||||
* 'time_from'
|
||||
* 'date_to'
|
||||
* 'time_to'
|
||||
* 'event_view_hr'
|
||||
* 'id_agent'
|
||||
* 'event_type'
|
||||
* 'severity'
|
||||
* 'id_group_filter'
|
||||
* 'status'
|
||||
* 'agent_alias'
|
||||
* 'search'
|
||||
* 'id_extra'
|
||||
* 'id_source_event'
|
||||
* 'user_comment'
|
||||
* 'source'
|
||||
* 'id_user_ack'
|
||||
* 'tag_with'
|
||||
* 'tag_without'
|
||||
* 'filter_only_alert'
|
||||
* 'module_search'
|
||||
* 'group_rep'
|
||||
* 'server_id'
|
||||
* ].
|
||||
*
|
||||
* @param integer $offset Offset (pagination).
|
||||
* @param integer $limit Limit (pagination).
|
||||
* @param string $order Sort order.
|
||||
|
@ -683,6 +710,8 @@ function events_update_status($id_evento, $status, $filter=null, $history=false)
|
|||
* @param boolean $return_sql Return SQL (true) or execute it (false).
|
||||
* @param string $having Having filter.
|
||||
* @param boolean $validatedEvents If true, evaluate validated events.
|
||||
* @param boolean $recursiveGroups If true, filtered groups and their children
|
||||
* will be search.
|
||||
*
|
||||
* @return array Events.
|
||||
* @throws Exception On error.
|
||||
|
@ -697,7 +726,8 @@ function events_get_all(
|
|||
$history=false,
|
||||
$return_sql=false,
|
||||
$having='',
|
||||
$validatedEvents=false
|
||||
$validatedEvents=false,
|
||||
$recursiveGroups=true
|
||||
) {
|
||||
global $config;
|
||||
|
||||
|
@ -873,17 +903,56 @@ function events_get_all(
|
|||
}
|
||||
|
||||
$groups = $filter['id_group_filter'];
|
||||
if (isset($groups) === true && $groups > 0) {
|
||||
$children = groups_get_children($groups);
|
||||
if ((bool) $user_is_admin === false
|
||||
&& isset($groups) === false
|
||||
) {
|
||||
// Not being filtered by group but not an admin, limit results.
|
||||
$groups = array_keys(users_get_groups(false, 'AR'));
|
||||
}
|
||||
|
||||
$_groups = [ $groups ];
|
||||
if (empty($children) === false) {
|
||||
foreach ($children as $child) {
|
||||
$_groups[] = (int) $child['id_grupo'];
|
||||
if (isset($groups) === true
|
||||
&& (is_array($groups) === true || ($groups > 0))
|
||||
) {
|
||||
if ($recursiveGroups === true) {
|
||||
// Add children groups.
|
||||
$children = [];
|
||||
if (is_array($groups) === true) {
|
||||
foreach ($groups as $g) {
|
||||
$children = array_merge(
|
||||
groups_get_children($g),
|
||||
$children
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$children = groups_get_children($groups);
|
||||
}
|
||||
|
||||
if (is_array($groups) === true) {
|
||||
$_groups = $groups;
|
||||
} else {
|
||||
$_groups = [ $groups ];
|
||||
}
|
||||
|
||||
if (empty($children) === false) {
|
||||
foreach ($children as $child) {
|
||||
$_groups[] = (int) $child['id_grupo'];
|
||||
}
|
||||
}
|
||||
|
||||
if ((bool) $user_is_admin === false) {
|
||||
$user_groups = users_get_groups(false, 'AR');
|
||||
$_groups = array_intersect(
|
||||
$_groups,
|
||||
array_keys($user_groups)
|
||||
);
|
||||
}
|
||||
|
||||
$groups = $_groups;
|
||||
}
|
||||
|
||||
$groups = $_groups;
|
||||
if (is_array($groups) === false) {
|
||||
$groups = [ $groups ];
|
||||
}
|
||||
|
||||
$sql_filters[] = sprintf(
|
||||
' AND (te.id_grupo IN (%s) OR tasg.id_group IN (%s))',
|
||||
|
@ -1466,6 +1535,8 @@ function events_get_all(
|
|||
|
||||
|
||||
/**
|
||||
* @deprecated Use events_get_all instead.
|
||||
*
|
||||
* Get all rows of events from the database, that
|
||||
* pass the filter, and can get only some fields.
|
||||
*
|
||||
|
@ -1502,7 +1573,9 @@ function events_get_all(
|
|||
*/
|
||||
function events_get_events($filter=false, $fields=false)
|
||||
{
|
||||
if ($filter['criticity'] == EVENT_CRIT_WARNING_OR_CRITICAL) {
|
||||
if (isset($filter['criticity']) === true
|
||||
&& (int) $filter['criticity'] === EVENT_CRIT_WARNING_OR_CRITICAL
|
||||
) {
|
||||
$filter['criticity'] = [
|
||||
EVENT_CRIT_WARNING,
|
||||
EVENT_CRIT_CRITICAL,
|
||||
|
@ -7409,3 +7482,40 @@ function events_get_instructions($event)
|
|||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return class name matching criticity received.
|
||||
*
|
||||
* @param integer $criticity Event's criticity.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
function events_get_criticity_class($criticity)
|
||||
{
|
||||
switch ($criticity) {
|
||||
case EVENT_CRIT_CRITICAL:
|
||||
return 'datos_red';
|
||||
|
||||
case EVENT_CRIT_MAINTENANCE:
|
||||
return 'datos_grey';
|
||||
|
||||
case EVENT_CRIT_INFORMATIONAL:
|
||||
return 'datos_blue';
|
||||
|
||||
case EVENT_CRIT_MAJOR:
|
||||
return 'datos_pink';
|
||||
|
||||
case EVENT_CRIT_MINOR:
|
||||
return 'datos_pink';
|
||||
|
||||
case EVENT_CRIT_NORMAL:
|
||||
return 'datos_green';
|
||||
|
||||
case EVENT_CRIT_WARNING:
|
||||
return 'datos_yellow';
|
||||
|
||||
default:
|
||||
return 'datos_blue';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -467,10 +467,9 @@ function html_print_select_groups(
|
|||
$output = '';
|
||||
|
||||
global $config;
|
||||
$select2_css = 'select2.min';
|
||||
|
||||
if ($config['style'] === 'pandora') {
|
||||
$select2_css = 'select2.min';
|
||||
} else {
|
||||
if ($config['style'] === 'pandora_black') {
|
||||
$select2_css = 'select2_dark.min';
|
||||
}
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ function io_safe_output_array(&$item, $key=false, $utf8=true)
|
|||
* @param string|array $value String or array of strings to be cleaned.
|
||||
* @param boolean $utf8 Flag, set the output encoding in utf8, by default true.
|
||||
*
|
||||
* @return string
|
||||
* @return mixed
|
||||
*/
|
||||
function io_safe_output($value, $utf8=true)
|
||||
{
|
||||
|
|
|
@ -5018,25 +5018,25 @@ function reporting_get_agents_by_status($data, $graph_width=250, $graph_height=1
|
|||
|
||||
$agent_data = [];
|
||||
$agent_data[0] = html_print_image('images/agent_critical.png', true, ['title' => __('Agents critical')]);
|
||||
$agent_data[1] = "<a style='color: ".COL_CRITICAL.";' href='".$links['agents_critical']."'><b><span class='red_color font_12pt bolder'>".format_numeric($data['agent_critical']).'</span></b></a>';
|
||||
$agent_data[1] = "<a style='color: ".COL_CRITICAL.";' href='".$links['agents_critical']."'><b><span class='red_color font_12pt bolder big_data'>".format_numeric($data['agent_critical']).'</span></b></a>';
|
||||
|
||||
$agent_data[2] = html_print_image('images/agent_warning.png', true, ['title' => __('Agents warning')]);
|
||||
$agent_data[3] = "<a style='color: ".COL_WARNING.";' href='".$links['agents_warning']."'><b><span class='yellow_color font_12pt bolder'>".format_numeric($data['agent_warning']).'</span></b></a>';
|
||||
$agent_data[3] = "<a style='color: ".COL_WARNING.";' href='".$links['agents_warning']."'><b><span class='yellow_color font_12pt bolder big_data'>".format_numeric($data['agent_warning']).'</span></b></a>';
|
||||
|
||||
$table_agent->data[] = $agent_data;
|
||||
|
||||
$agent_data = [];
|
||||
$agent_data[0] = html_print_image('images/agent_ok.png', true, ['title' => __('Agents ok')]);
|
||||
$agent_data[1] = "<a style='color: ".COL_NORMAL.";' href='".$links['agents_ok']."'><b><span class='green_color font_12pt bolder'>".format_numeric($data['agent_ok']).'</span></b></a>';
|
||||
$agent_data[1] = "<a style='color: ".COL_NORMAL.";' href='".$links['agents_ok']."'><b><span class='green_color font_12pt bolder big_data'>".format_numeric($data['agent_ok']).'</span></b></a>';
|
||||
|
||||
$agent_data[2] = html_print_image('images/agent_unknown.png', true, ['title' => __('Agents unknown')]);
|
||||
$agent_data[3] = "<a style='color: ".COL_UNKNOWN.";' href='".$links['agents_unknown']."'><b><span class='grey_color font_12pt bolder'>".format_numeric($data['agent_unknown']).'</span></b></a>';
|
||||
$agent_data[3] = "<a style='color: ".COL_UNKNOWN.";' href='".$links['agents_unknown']."'><b><span class='grey_color font_12pt bolder big_data'>".format_numeric($data['agent_unknown']).'</span></b></a>';
|
||||
|
||||
$table_agent->data[] = $agent_data;
|
||||
|
||||
$agent_data = [];
|
||||
$agent_data[0] = html_print_image('images/agent_notinit.png', true, ['title' => __('Agents not init')]);
|
||||
$agent_data[1] = "<a style='color: ".COL_NOTINIT.";' href='".$links['agents_not_init']."'><b><span class='blue_color_ligther font_12pt bolder'>".format_numeric($data['agent_not_init']).'</span></b></a>';
|
||||
$agent_data[1] = "<a style='color: ".COL_NOTINIT.";' href='".$links['agents_not_init']."'><b><span class='blue_color_ligther font_12pt bolder big_data'>".format_numeric($data['agent_not_init']).'</span></b></a>';
|
||||
|
||||
$agent_data[2] = '';
|
||||
$agent_data[3] = '';
|
||||
|
|
|
@ -1202,7 +1202,7 @@ function servers_show_type($id)
|
|||
|
||||
case 8:
|
||||
$return = html_print_image(
|
||||
'images/module_wux.png',
|
||||
'images/module-wux.png',
|
||||
true,
|
||||
[
|
||||
'title' => get_product_name().' WUX server',
|
||||
|
|
|
@ -604,9 +604,11 @@ function snmp_browser_print_oid(
|
|||
if ($custom_action != '') {
|
||||
$table->head[0] = '<span id="snmp_custom_action">'.$closer.$custom_action.'</span>';
|
||||
} else {
|
||||
$table->headstyle[0] = 'text-align: left';
|
||||
$table->head[0] = $closer;
|
||||
}
|
||||
|
||||
$table->headstyle[1] = 'text-align: left';
|
||||
$table->head[1] = __('OID Information');
|
||||
$output .= html_print_table($table, true);
|
||||
|
||||
|
@ -636,7 +638,7 @@ function snmp_browser_print_oid(
|
|||
__('Create network component'),
|
||||
'create_network_component',
|
||||
false,
|
||||
'class="sub add float-left"',
|
||||
'class="sub add float-left mrgn_right_20px"',
|
||||
true
|
||||
);
|
||||
|
||||
|
@ -1065,16 +1067,16 @@ function snmp_browser_print_container(
|
|||
);
|
||||
|
||||
$output .= '<div id="search_results" class="search_results"></div>';
|
||||
$output .= '<div id="spinner" class="spinner_none_padding">'.html_print_image('images/spinner.gif', true).'</div>';
|
||||
$output .= '<div id="spinner" class="spinner_none_padding" style="display:none">'.html_print_image('images/spinner.gif', true).'</div>';
|
||||
$output .= '<div id="snmp_browser">';
|
||||
$output .= '</div>';
|
||||
$output .= '<div class="databox mrgn_5px" id="snmp_data"></div>';
|
||||
$output .= '<div class="databox" id="snmp_data"></div>';
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
$output .= '</div>';
|
||||
|
||||
if ($show_massive_buttons) {
|
||||
$output .= '<div id="snmp_create_buttons" class="invisible">';
|
||||
$output .= '<div id="snmp_create_buttons" style="display:none">';
|
||||
$output .= html_print_submit_button(
|
||||
__('Create agent modules'),
|
||||
'create_modules_agent',
|
||||
|
|
|
@ -3272,12 +3272,6 @@ function visual_map_get_status_element($layoutData)
|
|||
}
|
||||
}
|
||||
|
||||
$module_value = db_get_sql(
|
||||
'SELECT datos
|
||||
FROM tagente_estado
|
||||
WHERE id_agente_modulo = '.$layoutData['id_agente_modulo']
|
||||
);
|
||||
|
||||
// Linked to other layout ?? - Only if not module defined
|
||||
if (!empty($layoutData['id_layout_linked'])) {
|
||||
if (!empty($layoutData['linked_layout_node_id'])) {
|
||||
|
@ -3379,6 +3373,11 @@ function visual_map_get_status_element($layoutData)
|
|||
case PERCENTILE_BUBBLE:
|
||||
case CIRCULAR_PROGRESS_BAR:
|
||||
case CIRCULAR_INTERIOR_PROGRESS_BAR:
|
||||
$module_value = db_get_sql(
|
||||
'SELECT datos
|
||||
FROM tagente_estado
|
||||
WHERE id_agente_modulo = '.$layoutData['id_agente_modulo']
|
||||
);
|
||||
|
||||
if (empty($module_value) || $module_value == '') {
|
||||
return VISUAL_MAP_STATUS_UNKNOWN;
|
||||
|
@ -3907,9 +3906,19 @@ function visual_map_get_layout_status($layout_id, $status_data=[], $depth=0)
|
|||
return VISUAL_MAP_STATUS_UNKNOWN;
|
||||
}
|
||||
|
||||
$layout_items = db_get_all_rows_filter(
|
||||
'tlayout_data',
|
||||
['id_layout' => $layout_id]
|
||||
$layout_items = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT tld.*
|
||||
FROM tlayout_data tld
|
||||
LEFT JOIN tagente ta
|
||||
ON ta.id_agente=tld.id_agent
|
||||
LEFT JOIN tagente_modulo tam
|
||||
ON tam.id_agente_modulo = tld.id_agente_modulo
|
||||
WHERE tld.id_layout = %d
|
||||
AND (ta.disabled = 0 OR ta.disabled is null)
|
||||
AND (tam.disabled = 0 OR tam.disabled is null)',
|
||||
$layout_id
|
||||
)
|
||||
);
|
||||
|
||||
if ($layout_items === false) {
|
||||
|
|
|
@ -1000,3 +1000,11 @@ function check_massive_response_event(
|
|||
counter++;
|
||||
});
|
||||
}
|
||||
|
||||
function event_widget_options() {
|
||||
if ($("#customFilter").val() != "-1") {
|
||||
$(".event-widget-input").disable();
|
||||
} else {
|
||||
$(".event-widget-input").enable();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -202,33 +202,70 @@ function load_modal(settings) {
|
|||
if (Array.isArray(settings.form) === false) {
|
||||
$("#" + settings.form + " :input").each(function() {
|
||||
if (this.checkValidity() === false) {
|
||||
$(this).attr("title", this.validationMessage);
|
||||
$(this).tooltip({
|
||||
tooltipClass: "uitooltip",
|
||||
position: {
|
||||
my: "right bottom",
|
||||
at: "right top",
|
||||
using: function(position, feedback) {
|
||||
$(this).css(position);
|
||||
$("<div>")
|
||||
.addClass("arrow")
|
||||
.addClass(feedback.vertical)
|
||||
.addClass(feedback.horizontal)
|
||||
.appendTo(this);
|
||||
}
|
||||
}
|
||||
});
|
||||
$(this).tooltip("open");
|
||||
var select2 = $(this).attr("data-select2-id");
|
||||
if (typeof select2 !== typeof undefined && select2 !== false) {
|
||||
$(this)
|
||||
.next()
|
||||
.attr("title", this.validationMessage);
|
||||
$(this)
|
||||
.next()
|
||||
.tooltip({
|
||||
tooltipClass: "uitooltip",
|
||||
position: {
|
||||
my: "right bottom",
|
||||
at: "right top",
|
||||
using: function(position, feedback) {
|
||||
$(this).css(position);
|
||||
$("<div>")
|
||||
.addClass("arrow")
|
||||
.addClass(feedback.vertical)
|
||||
.addClass(feedback.horizontal)
|
||||
.appendTo(this);
|
||||
}
|
||||
}
|
||||
});
|
||||
$(this)
|
||||
.next()
|
||||
.tooltip("open");
|
||||
|
||||
var element = $(this);
|
||||
setTimeout(
|
||||
function(element) {
|
||||
element.tooltip("destroy");
|
||||
element.removeAttr("title");
|
||||
},
|
||||
3000,
|
||||
element
|
||||
);
|
||||
var element = $(this).next();
|
||||
setTimeout(
|
||||
function(element) {
|
||||
element.tooltip("destroy");
|
||||
element.removeAttr("title");
|
||||
},
|
||||
3000,
|
||||
element
|
||||
);
|
||||
} else {
|
||||
$(this).attr("title", this.validationMessage);
|
||||
$(this).tooltip({
|
||||
tooltipClass: "uitooltip",
|
||||
position: {
|
||||
my: "right bottom",
|
||||
at: "right top",
|
||||
using: function(position, feedback) {
|
||||
$(this).css(position);
|
||||
$("<div>")
|
||||
.addClass("arrow")
|
||||
.addClass(feedback.vertical)
|
||||
.addClass(feedback.horizontal)
|
||||
.appendTo(this);
|
||||
}
|
||||
}
|
||||
});
|
||||
$(this).tooltip("open");
|
||||
|
||||
var element = $(this);
|
||||
setTimeout(
|
||||
function(element) {
|
||||
element.tooltip("destroy");
|
||||
element.removeAttr("title");
|
||||
},
|
||||
3000,
|
||||
element
|
||||
);
|
||||
}
|
||||
|
||||
flagError = true;
|
||||
}
|
||||
|
|
|
@ -455,7 +455,6 @@ function createVisualConsole(
|
|||
},
|
||||
createItem: function(typeString) {
|
||||
var type;
|
||||
console.log(typeString);
|
||||
switch (typeString) {
|
||||
case "STATIC_GRAPH":
|
||||
type = 0;
|
||||
|
|
|
@ -641,6 +641,14 @@ var TreeController = {
|
|||
|
||||
$content.append($statusImage);
|
||||
}
|
||||
var image_tooltip =
|
||||
'<span><img src="' +
|
||||
(controller.baseURL.length > 0 ? controller.baseURL : "") +
|
||||
'images/help.png" class="img_help" title="' +
|
||||
element.name +
|
||||
'" alt="' +
|
||||
element.name +
|
||||
'"/></span> ';
|
||||
|
||||
var $serviceDetailImage = $(
|
||||
'<img src="' +
|
||||
|
@ -661,6 +669,8 @@ var TreeController = {
|
|||
.css("cursor", "pointer");
|
||||
|
||||
$content.append($serviceDetailImage);
|
||||
$content.append(" " + image_tooltip);
|
||||
|
||||
if (
|
||||
typeof element.elementDescription !== "undefined" &&
|
||||
element.elementDescription != ""
|
||||
|
@ -674,7 +684,6 @@ var TreeController = {
|
|||
} else {
|
||||
$content.append(" " + element.name);
|
||||
}
|
||||
// $content.append(" " + element.name);
|
||||
} else {
|
||||
$content.remove($node);
|
||||
}
|
||||
|
|
|
@ -257,6 +257,23 @@ class Manager
|
|||
$extradata = \get_parameter('extradata', '');
|
||||
if (empty($extradata) === false) {
|
||||
$extradata = json_decode(\io_safe_output($extradata), true);
|
||||
|
||||
if (isset($extradata['dashboardId']) === false) {
|
||||
$extradata['dashboardId'] = null;
|
||||
}
|
||||
|
||||
if (isset($extradata['cellId']) === false) {
|
||||
$extradata['cellId'] = null;
|
||||
}
|
||||
|
||||
if (isset($extradata['offset']) === false) {
|
||||
$extradata['offset'] = null;
|
||||
}
|
||||
|
||||
if (isset($extradata['widgetId']) === false) {
|
||||
$extradata['widgetId'] = null;
|
||||
}
|
||||
|
||||
$this->dashboardId = (int) $extradata['dashboardId'];
|
||||
$this->cellId = (int) $extradata['cellId'];
|
||||
$this->offset = (int) $extradata['offset'];
|
||||
|
@ -1031,6 +1048,10 @@ class Manager
|
|||
);
|
||||
}
|
||||
|
||||
if (isset($config['public_dashboard']) === false) {
|
||||
$config['public_dashboard'] = false;
|
||||
}
|
||||
|
||||
// View.
|
||||
if ($this->slides === 0 || $this->cellModeSlides === 0) {
|
||||
View::render(
|
||||
|
@ -1341,6 +1362,7 @@ class Manager
|
|||
|
||||
$instance = $this->instanceWidget();
|
||||
$htmlInputs = $instance->getFormInputs([]);
|
||||
$js = $instance->getFormJS();
|
||||
|
||||
View::render(
|
||||
'dashboard/configurationWidgets',
|
||||
|
@ -1348,6 +1370,7 @@ class Manager
|
|||
'dashboardId' => $this->dashboardId,
|
||||
'cellId' => $this->cellId,
|
||||
'htmlInputs' => $htmlInputs,
|
||||
'js' => $js,
|
||||
]
|
||||
);
|
||||
|
||||
|
@ -1450,4 +1473,21 @@ class Manager
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prints error.
|
||||
*
|
||||
* @param string $msg Message.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function error(string $msg)
|
||||
{
|
||||
if ((bool) \is_ajax() === true) {
|
||||
echo json_encode(['error' => $msg]);
|
||||
} else {
|
||||
\ui_print_error_message($msg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ class Widget
|
|||
*
|
||||
* @var integer
|
||||
*/
|
||||
private $cellId;
|
||||
protected $cellId;
|
||||
|
||||
/**
|
||||
* Widget Id.
|
||||
|
@ -99,8 +99,6 @@ class Widget
|
|||
*/
|
||||
public function getOptionsWidget():array
|
||||
{
|
||||
global $config;
|
||||
|
||||
$result = [];
|
||||
if (empty($this->dataCell['options']) === false) {
|
||||
$result = \json_decode($this->dataCell['options'], true);
|
||||
|
@ -591,4 +589,48 @@ class Widget
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get description should be implemented for each child.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getDescription()
|
||||
{
|
||||
return '**NOT DEFINED**';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load should be implemented for each child.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function load()
|
||||
{
|
||||
return '**NOT DEFINED**';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get name should be implemented for each child.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getName()
|
||||
{
|
||||
return '**NOT DEFINED**';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return aux javascript code for forms.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFormJS()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ class EventsListWidget extends Widget
|
|||
$this->className = $class->getShortName();
|
||||
|
||||
// Title.
|
||||
$this->title = __('List of latest events');
|
||||
$this->title = \__('List of latest events');
|
||||
|
||||
// Name.
|
||||
if (empty($this->name) === true) {
|
||||
|
@ -242,6 +242,14 @@ class EventsListWidget extends Widget
|
|||
$values['groupId'] = $decoder['id_groups'];
|
||||
}
|
||||
|
||||
if (isset($decoder['groupRecursion']) === true) {
|
||||
$values['groupRecursion'] = $decoder['groupRecursion'];
|
||||
}
|
||||
|
||||
if (isset($decoder['customFilter']) === true) {
|
||||
$values['customFilter'] = $decoder['customFilter'];
|
||||
}
|
||||
|
||||
if (isset($decoder['groupId']) === true) {
|
||||
$values['groupId'] = $decoder['groupId'];
|
||||
}
|
||||
|
@ -254,6 +262,17 @@ class EventsListWidget extends Widget
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Aux javascript to be run after form load.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFormJS(): string
|
||||
{
|
||||
return '$( document ).ready(function() {event_widget_options();});';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates inputs for form (specific).
|
||||
*
|
||||
|
@ -270,8 +289,23 @@ class EventsListWidget extends Widget
|
|||
// Retrieve global - common inputs.
|
||||
$inputs = parent::getFormInputs();
|
||||
|
||||
// Select pre built filter.
|
||||
$inputs[] = [
|
||||
'label' => \__('Custom filters'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'id' => 'select-custom-filter',
|
||||
'fields' => \events_get_event_filter_select(false),
|
||||
'name' => 'customFilter',
|
||||
'script' => 'event_widget_options();',
|
||||
'nothing' => \__('None'),
|
||||
'nothing_value' => -1,
|
||||
'selected' => $this->values['customFilter'],
|
||||
],
|
||||
];
|
||||
|
||||
$fields = \get_event_types();
|
||||
$fields['not_normal'] = __('Not normal');
|
||||
$fields['not_normal'] = \__('Not normal');
|
||||
|
||||
// Default values.
|
||||
if (isset($values['maxHours']) === false) {
|
||||
|
@ -284,24 +318,26 @@ class EventsListWidget extends Widget
|
|||
|
||||
// Event Type.
|
||||
$inputs[] = [
|
||||
'label' => __('Event type'),
|
||||
'label' => \__('Event type'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $fields,
|
||||
'class' => 'event-widget-input',
|
||||
'name' => 'eventType',
|
||||
'selected' => $values['eventType'],
|
||||
'return' => true,
|
||||
'nothing' => __('Any'),
|
||||
'nothing' => \__('Any'),
|
||||
'nothing_value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
// Max. hours old. Default 8.
|
||||
$inputs[] = [
|
||||
'label' => __('Max. hours old'),
|
||||
'label' => \__('Max. hours old'),
|
||||
'arguments' => [
|
||||
'name' => 'maxHours',
|
||||
'type' => 'number',
|
||||
'class' => 'event-widget-input',
|
||||
'value' => $values['maxHours'],
|
||||
'return' => true,
|
||||
'min' => 0,
|
||||
|
@ -320,10 +356,11 @@ class EventsListWidget extends Widget
|
|||
];
|
||||
|
||||
$inputs[] = [
|
||||
'label' => __('Limit'),
|
||||
'label' => \__('Limit'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $fields,
|
||||
'class' => 'event-widget-input',
|
||||
'name' => 'limit',
|
||||
'selected' => $values['limit'],
|
||||
'return' => true,
|
||||
|
@ -332,16 +369,17 @@ class EventsListWidget extends Widget
|
|||
|
||||
// Event status.
|
||||
$fields = [
|
||||
-1 => __('All event'),
|
||||
1 => __('Only validated'),
|
||||
0 => __('Only pending'),
|
||||
-1 => \__('All event'),
|
||||
1 => \__('Only validated'),
|
||||
0 => \__('Only pending'),
|
||||
];
|
||||
|
||||
$inputs[] = [
|
||||
'label' => __('Event status'),
|
||||
'label' => \__('Event status'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $fields,
|
||||
'class' => 'event-widget-input',
|
||||
'name' => 'eventStatus',
|
||||
'selected' => $values['eventStatus'],
|
||||
'return' => true,
|
||||
|
@ -352,14 +390,15 @@ class EventsListWidget extends Widget
|
|||
$fields = \get_priorities();
|
||||
|
||||
$inputs[] = [
|
||||
'label' => __('Severity'),
|
||||
'label' => \__('Severity'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $fields,
|
||||
'class' => 'event-widget-input',
|
||||
'name' => 'severity',
|
||||
'selected' => $values['severity'],
|
||||
'return' => true,
|
||||
'nothing' => __('All'),
|
||||
'nothing' => \__('All'),
|
||||
'nothing_value' => -1,
|
||||
],
|
||||
];
|
||||
|
@ -367,17 +406,22 @@ class EventsListWidget extends Widget
|
|||
$return_all_group = false;
|
||||
$selected_groups_array = explode(',', $values['groupId'][0]);
|
||||
|
||||
if (users_can_manage_group_all('RM') || ($selected_groups_array[0] !== '' && in_array(0, $selected_groups_array) === true)) {
|
||||
// Return all group if user has permissions or it is a currently selected group.
|
||||
if ((bool) \users_can_manage_group_all('RM') === true
|
||||
|| ($selected_groups_array[0] !== ''
|
||||
&& in_array(0, $selected_groups_array) === true)
|
||||
) {
|
||||
// Return all group if user has permissions or it is a currently
|
||||
// selected group.
|
||||
$return_all_group = true;
|
||||
}
|
||||
|
||||
// Groups.
|
||||
$inputs[] = [
|
||||
'label' => __('Groups'),
|
||||
'label' => \__('Groups'),
|
||||
'arguments' => [
|
||||
'type' => 'select_groups',
|
||||
'name' => 'groupId[]',
|
||||
'class' => 'event-widget-input',
|
||||
'returnAllGroup' => true,
|
||||
'privilege' => 'AR',
|
||||
'selected' => $selected_groups_array,
|
||||
|
@ -387,18 +431,33 @@ class EventsListWidget extends Widget
|
|||
],
|
||||
];
|
||||
|
||||
// Group recursion.
|
||||
$inputs[] = [
|
||||
'label' => \__('Group recursion'),
|
||||
'arguments' => [
|
||||
'type' => 'switch',
|
||||
'name' => 'groupRecursion',
|
||||
'class' => 'event-widget-input',
|
||||
'value' => $values['groupRecursion'],
|
||||
'return' => true,
|
||||
],
|
||||
];
|
||||
|
||||
// Tags.
|
||||
$fields = tags_get_user_tags($config['id_user'], 'AR');
|
||||
$fields = \tags_get_user_tags($config['id_user'], 'AR');
|
||||
|
||||
$inputs[] = [
|
||||
'label' => __('Tags'),
|
||||
'label' => \__('Tags'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $fields,
|
||||
'name' => 'tagsId[]',
|
||||
'selected' => explode(',', $values['tagsId'][0]),
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
'type' => 'select',
|
||||
'fields' => $fields,
|
||||
'class' => 'event-widget-input',
|
||||
'name' => 'tagsId[]',
|
||||
'selected' => explode(',', $values['tagsId'][0]),
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
'nothing' => __('None'),
|
||||
'nothing_value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -423,6 +482,8 @@ class EventsListWidget extends Widget
|
|||
$values['severity'] = \get_parameter_switch('severity', -1);
|
||||
$values['groupId'] = \get_parameter_switch('groupId', []);
|
||||
$values['tagsId'] = \get_parameter_switch('tagsId', []);
|
||||
$values['groupRecursion'] = \get_parameter_switch('groupRecursion', 0);
|
||||
$values['customFilter'] = \get_parameter('customFilter', -1);
|
||||
|
||||
return $values;
|
||||
}
|
||||
|
@ -439,99 +500,144 @@ class EventsListWidget extends Widget
|
|||
|
||||
$output = '';
|
||||
|
||||
$return_all_group = false;
|
||||
|
||||
if (users_can_manage_group_all('RM')) {
|
||||
$return_all_group = true;
|
||||
}
|
||||
|
||||
$user_groups = \users_get_groups(false, 'AR', $return_all_group);
|
||||
|
||||
ui_require_css_file('events', 'include/styles/', true);
|
||||
ui_require_css_file('tables', 'include/styles/', true);
|
||||
\ui_require_css_file('events', 'include/styles/', true);
|
||||
\ui_require_css_file('tables', 'include/styles/', true);
|
||||
|
||||
$this->values['groupId'] = explode(',', $this->values['groupId'][0]);
|
||||
$this->values['tagsId'] = explode(',', $this->values['tagsId'][0]);
|
||||
|
||||
if (empty($this->values['groupId']) === true) {
|
||||
$output .= __('You must select some group');
|
||||
$output .= \__('You must select some group');
|
||||
return $output;
|
||||
}
|
||||
|
||||
$useTags = \tags_has_user_acl_tags($config['id_user']);
|
||||
if ($useTags) {
|
||||
$useTags = (bool) \tags_has_user_acl_tags($config['id_user']);
|
||||
if ($useTags === true) {
|
||||
if (empty($this->values['tagsId']) === true) {
|
||||
$output .= __('You don\'t have access');
|
||||
$output .= \__('You don\'t have access');
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$hours = ($this->values['maxHours'] * SECONDS_1HOUR);
|
||||
$unixtime = (get_system_time() - $hours);
|
||||
|
||||
// Put hours in seconds.
|
||||
$filter = [];
|
||||
// Group all.
|
||||
if (in_array(0, $this->values['groupId'])) {
|
||||
$filter['id_grupo'] = array_keys($user_groups);
|
||||
} else {
|
||||
$filter['id_grupo'] = array_intersect($this->values['groupId'], array_keys($user_groups));
|
||||
}
|
||||
$order = [];
|
||||
|
||||
if (empty($filter['id_grupo'])) {
|
||||
$output .= '<div class="container-center">';
|
||||
$output .= \ui_print_error_message(
|
||||
__('You have no access'),
|
||||
'',
|
||||
true
|
||||
$customFilter = \events_get_event_filter($this->values['customFilter']);
|
||||
if ($customFilter !== false) {
|
||||
$filter = $customFilter;
|
||||
$filter['tag_with'] = base64_encode(
|
||||
json_encode($filter['tag_with'])
|
||||
);
|
||||
$output .= '</div>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
$filter['utimestamp'] = '>'.$unixtime;
|
||||
$filter['tag_without'] = base64_encode(
|
||||
json_encode($filter['tag_without'])
|
||||
);
|
||||
} else {
|
||||
// Filtering.
|
||||
$filter['event_view_hr'] = $hours;
|
||||
|
||||
if (empty($this->values['eventType']) === false) {
|
||||
$filter['event_type'] = $this->values['eventType'];
|
||||
|
||||
if ($filter['event_type'] === 'warning'
|
||||
|| $filter['event_type'] === 'critical'
|
||||
|| $filter['event_type'] === 'normal'
|
||||
// Group.
|
||||
$filter['id_group_filter'] = $this->values['groupId'];
|
||||
if (empty($filter['id_group_filter']) === true
|
||||
|| $filter['id_group_filter'][0] === ''
|
||||
|| $filter['id_group_filter'][0] === '0'
|
||||
) {
|
||||
$filter['event_type'] = '%'.$filter['event_type'].'%';
|
||||
} else if ($filter['event_type'] === 'not_normal') {
|
||||
unset($filter['event_type']);
|
||||
$filter[] = '(event_type REGEXP "warning|critical|unknown")';
|
||||
// No filter specified. Don't filter at all...
|
||||
$filter['id_group_filter'] = null;
|
||||
}
|
||||
|
||||
// Tags.
|
||||
if (empty($this->values['tagsId']) === false) {
|
||||
$filter['tag_with'] = base64_encode(
|
||||
json_encode($this->values['tagsId'])
|
||||
);
|
||||
}
|
||||
|
||||
// Severity.
|
||||
if (isset($this->values['severity']) === true) {
|
||||
$filter['severity'] = $this->values['severity'];
|
||||
}
|
||||
|
||||
// Event types.
|
||||
if (empty($this->values['eventType']) === false) {
|
||||
$filter['event_type'] = $this->values['eventType'];
|
||||
}
|
||||
|
||||
// Event status.
|
||||
if ((int) $this->values['eventStatus'] !== -1) {
|
||||
$filter['status'] = $this->values['eventStatus'];
|
||||
}
|
||||
}
|
||||
|
||||
if ((int) $this->values['eventStatus'] !== -1) {
|
||||
$filter['estado'] = $this->values['eventStatus'];
|
||||
// Order.
|
||||
$order['field'] = 'timestamp';
|
||||
$order['direction'] = 'DESC';
|
||||
|
||||
$fields = [
|
||||
'te.id_evento',
|
||||
'te.id_agente',
|
||||
'te.id_usuario',
|
||||
'te.id_grupo',
|
||||
'te.estado',
|
||||
'te.timestamp',
|
||||
'te.evento',
|
||||
'te.utimestamp',
|
||||
'te.event_type',
|
||||
'te.id_alert_am',
|
||||
'te.criticity',
|
||||
'te.user_comment',
|
||||
'te.tags',
|
||||
'te.source',
|
||||
'te.id_extra',
|
||||
'te.critical_instructions',
|
||||
'te.warning_instructions',
|
||||
'te.unknown_instructions',
|
||||
'te.owner_user',
|
||||
'if(te.ack_utimestamp > 0, from_unixtime(te.ack_utimestamp),"") as ack_utimestamp',
|
||||
'te.custom_data',
|
||||
'te.data',
|
||||
'te.module_status',
|
||||
'ta.alias as agent_name',
|
||||
'tg.nombre as group_name',
|
||||
];
|
||||
if ((bool) \is_metaconsole() === false) {
|
||||
$fields[] = 'am.nombre as module_name';
|
||||
$fields[] = 'am.id_agente_modulo as id_agentmodule';
|
||||
$fields[] = 'am.custom_id as module_custom_id';
|
||||
$fields[] = 'ta.server_name as server_name';
|
||||
} else {
|
||||
$fields[] = 'ts.server_name as server_name';
|
||||
$fields[] = 'te.id_agentmodule';
|
||||
$fields[] = 'te.server_id';
|
||||
}
|
||||
|
||||
$filter['limit'] = $this->values['limit'];
|
||||
$filter['order'] = '`utimestamp` DESC';
|
||||
|
||||
if (isset($this->values['severity']) === true) {
|
||||
if ((int) $this->values['severity'] === 20) {
|
||||
$filter['criticity'] = [
|
||||
EVENT_CRIT_WARNING,
|
||||
EVENT_CRIT_CRITICAL,
|
||||
];
|
||||
} else if ((int) $this->values['severity'] !== -1) {
|
||||
$filter['criticity'] = $this->values['severity'];
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($this->values['tagsId']) === false) {
|
||||
foreach ($this->values['tagsId'] as $tag) {
|
||||
$tag_name[$tag] = \tags_get_name($tag);
|
||||
}
|
||||
|
||||
$filter['tags'] = $tag_name;
|
||||
}
|
||||
|
||||
$events = \events_get_events($filter);
|
||||
$events = \events_get_all(
|
||||
// Fields.
|
||||
$fields,
|
||||
// Filter.
|
||||
$filter,
|
||||
// Offset.
|
||||
null,
|
||||
// Limit.
|
||||
$this->values['limit'],
|
||||
// Order.
|
||||
$order['direction'],
|
||||
// Sort field.
|
||||
$order['field'],
|
||||
// History.
|
||||
false,
|
||||
// SQL.
|
||||
false,
|
||||
// Having.
|
||||
'',
|
||||
// ValidatedEvents.
|
||||
false,
|
||||
// Recursive Groups.
|
||||
(bool) $this->values['groupRecursion']
|
||||
);
|
||||
|
||||
if ($events === false) {
|
||||
$events = [];
|
||||
|
@ -542,9 +648,9 @@ class EventsListWidget extends Widget
|
|||
&& is_array($events) === true
|
||||
&& empty($events) === false
|
||||
) {
|
||||
$output .= html_print_input_hidden(
|
||||
$output .= \html_print_input_hidden(
|
||||
'ajax_file',
|
||||
ui_get_full_url('ajax.php', false, false, false),
|
||||
\ui_get_full_url('ajax.php', false, false, false),
|
||||
true
|
||||
);
|
||||
|
||||
|
@ -558,15 +664,10 @@ class EventsListWidget extends Widget
|
|||
|
||||
foreach ($events as $event) {
|
||||
$data = [];
|
||||
$event['evento'] = io_safe_output($event['evento']);
|
||||
if ($event['estado'] === 0) {
|
||||
$img = 'images/pixel_red.png';
|
||||
} else {
|
||||
$img = 'images/pixel_green.png';
|
||||
}
|
||||
$event['evento'] = \io_safe_output($event['evento']);
|
||||
|
||||
$data[0] = events_print_type_img($event['event_type'], true);
|
||||
$agent_alias = agents_get_alias($event['id_agente']);
|
||||
$data[0] = \events_print_type_img($event['event_type'], true);
|
||||
$agent_alias = \agents_get_alias($event['id_agente']);
|
||||
|
||||
if ($agent_alias !== '') {
|
||||
$data[1] = '<a href="'.$config['homeurl'];
|
||||
|
@ -577,15 +678,27 @@ class EventsListWidget extends Widget
|
|||
$data[1] .= $agent_alias;
|
||||
$data[1] .= '</a>';
|
||||
} else {
|
||||
$data[1] = '<em>'.__('Unknown').'</em>';
|
||||
$data[1] = ' ';
|
||||
}
|
||||
|
||||
if (isset($event['event_rep']) === true
|
||||
&& $event['event_rep'] > 1
|
||||
) {
|
||||
$data[1] .= ' ('.$event['event_rep'].')';
|
||||
}
|
||||
|
||||
// Group.
|
||||
$data[2] = $event['group_name'];
|
||||
|
||||
// Tags.
|
||||
$data[3] = $event['tags'];
|
||||
|
||||
$settings = json_encode(
|
||||
[
|
||||
'event' => $event,
|
||||
'page' => 'include/ajax/events',
|
||||
'cellId' => $id_cell,
|
||||
'ajaxUrl' => ui_get_full_url(
|
||||
'cellId' => $this->cellId,
|
||||
'ajaxUrl' => \ui_get_full_url(
|
||||
'ajax.php',
|
||||
false,
|
||||
false,
|
||||
|
@ -596,35 +709,40 @@ class EventsListWidget extends Widget
|
|||
);
|
||||
|
||||
if ($this->publicLink === false) {
|
||||
$data[2] = '<a href="javascript:"onclick="dashboardShowEventDialog(\''.base64_encode($settings).'\');">';
|
||||
$data[4] = '<a href="javascript:"onclick="';
|
||||
$data[4] .= 'dashboardShowEventDialog(\'';
|
||||
$data[4] .= base64_encode($settings).'\');">';
|
||||
}
|
||||
|
||||
$data[2] .= substr(io_safe_output($event['evento']), 0, 150);
|
||||
$data[4] .= substr(\io_safe_output($event['evento']), 0, 150);
|
||||
if (strlen($event['evento']) > 150) {
|
||||
$data[2] .= '...';
|
||||
$data[4] .= '...';
|
||||
}
|
||||
|
||||
if ($this->publicLink === false) {
|
||||
$data[2] .= '<a>';
|
||||
$data[4] .= '<a>';
|
||||
}
|
||||
|
||||
$data[3] = ui_print_timestamp($event['timestamp'], true);
|
||||
$data[5] = \ui_print_timestamp($event['timestamp'], true);
|
||||
|
||||
$table->data[$i] = $data;
|
||||
|
||||
$table->cellstyle[$i][0] = 'background: #E8E8E8;';
|
||||
$rowclass = get_priority_class($event['criticity']);
|
||||
$rowclass = \events_get_criticity_class($event['criticity']);
|
||||
$table->cellclass[$i][1] = $rowclass;
|
||||
$table->cellclass[$i][2] = $rowclass;
|
||||
$table->cellclass[$i][3] = $rowclass;
|
||||
$table->cellclass[$i][4] = $rowclass;
|
||||
$table->cellclass[$i][5] = $rowclass;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$output .= html_print_table($table, true);
|
||||
$output .= \html_print_table($table, true);
|
||||
$output .= "<div id='event_details_window'></div>";
|
||||
$output .= "<div id='event_response_window'></div>";
|
||||
$output .= "<div id='event_response_command_window' title='".__('Parameters')."'></div>";
|
||||
$output .= ui_require_javascript_file(
|
||||
$output .= "<div id='event_response_command_window' title='";
|
||||
$output .= \__('Parameters')."'></div>";
|
||||
$output .= \ui_require_javascript_file(
|
||||
'pandora_events',
|
||||
'include/javascript/',
|
||||
true
|
||||
|
@ -632,7 +750,7 @@ class EventsListWidget extends Widget
|
|||
} else {
|
||||
$output .= '<div class="container-center">';
|
||||
$output .= \ui_print_info_message(
|
||||
__('There are no events matching selected search filters'),
|
||||
\__('There are no events matching selected search filters'),
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
@ -650,7 +768,7 @@ class EventsListWidget extends Widget
|
|||
*/
|
||||
public static function getDescription()
|
||||
{
|
||||
return __('List of latest events');
|
||||
return \__('List of latest events');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -283,7 +283,6 @@ class ModuleTableValueWidget extends Widget
|
|||
'label' => __('Module'),
|
||||
'arguments' => [
|
||||
'type' => 'autocomplete_module',
|
||||
'fields' => $fields,
|
||||
'name' => 'moduleId',
|
||||
'selected' => $values['moduleId'],
|
||||
'return' => true,
|
||||
|
@ -291,7 +290,9 @@ class ModuleTableValueWidget extends Widget
|
|||
'agent_id' => $values['agentId'],
|
||||
'metaconsole_id' => $values['metaconsoleId'],
|
||||
'style' => 'width: inherit;',
|
||||
'filter_modules' => users_access_to_agent($values['agentId']) === false ? [$values['moduleId']] : [],
|
||||
'filter_modules' => users_access_to_agent(
|
||||
($values['agentId']) === false
|
||||
) ? [$values['moduleId']] : [],
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -308,12 +309,12 @@ class ModuleTableValueWidget extends Widget
|
|||
];
|
||||
|
||||
$fields = [
|
||||
'<br>' => __('Carriage Return'),
|
||||
'|' => __('Vertical Bar'),
|
||||
';' => __('Semicolon'),
|
||||
':' => __('Colon'),
|
||||
',' => __('Commas'),
|
||||
' ' => __('Blank'),
|
||||
'
' => __('Carriage Return'),
|
||||
'|' => __('Vertical Bar'),
|
||||
';' => __('Semicolon'),
|
||||
':' => __('Colon'),
|
||||
',' => __('Commas'),
|
||||
' ' => __('Blank'),
|
||||
];
|
||||
|
||||
$inputs[] = [
|
||||
|
@ -358,11 +359,7 @@ class ModuleTableValueWidget extends Widget
|
|||
*/
|
||||
public function load()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$output = '';
|
||||
$id_agent = $this->values['agentId'];
|
||||
$id_group = \agents_get_agent_group($id_agent);
|
||||
|
||||
$id_module = $this->values['moduleId'];
|
||||
$size_text = $this->values['sizeLabel'];
|
||||
|
@ -370,33 +367,11 @@ class ModuleTableValueWidget extends Widget
|
|||
$data_module = modules_get_last_value($id_module);
|
||||
$value = (string) $data_module;
|
||||
|
||||
$array_values = explode('
', io_safe_input($value));
|
||||
|
||||
if (isset($array_values) === true && is_array($array_values) === true) {
|
||||
io_safe_output_array($array_values);
|
||||
|
||||
$value = implode(
|
||||
io_safe_output(
|
||||
$this->values['separator']
|
||||
),
|
||||
$array_values
|
||||
);
|
||||
|
||||
$value = preg_replace(
|
||||
'/'.$this->values['separator'].'/i',
|
||||
'<br>',
|
||||
$value
|
||||
);
|
||||
} else {
|
||||
$value = preg_replace(
|
||||
'/\n/i',
|
||||
io_safe_output(
|
||||
$this->values['separator']
|
||||
),
|
||||
io_safe_output($value)
|
||||
);
|
||||
$value = preg_replace('/\s/i', ' ', $value);
|
||||
}
|
||||
$value = str_replace(
|
||||
io_safe_output($this->values['separator']),
|
||||
'<br/>',
|
||||
$value
|
||||
);
|
||||
|
||||
$output .= '<div class="container-center">';
|
||||
$output .= '<div class="container-icon">';
|
||||
|
|
|
@ -274,12 +274,16 @@ class SystemGroupStatusWidget extends Widget
|
|||
if ($values['groupId']) {
|
||||
$selected_groups = explode(',', $values['groupId'][0]);
|
||||
|
||||
if (users_can_manage_group_all('RM') || ($selected_groups[0] !== '' && in_array(0, $selected_groups) === true)) {
|
||||
// Return all group if user has permissions or it is a currently selected group.
|
||||
if (users_can_manage_group_all('RM') === true
|
||||
|| ($selected_groups[0] !== ''
|
||||
&& in_array(0, $selected_groups) === true)
|
||||
) {
|
||||
// Return all group if user has permissions
|
||||
// or it is a currently selected group.
|
||||
$return_all_group = true;
|
||||
}
|
||||
} else {
|
||||
if (users_can_manage_group_all('RM')) {
|
||||
if (users_can_manage_group_all('RM') === true) {
|
||||
$return_all_group = true;
|
||||
}
|
||||
}
|
||||
|
@ -365,7 +369,7 @@ class SystemGroupStatusWidget extends Widget
|
|||
|
||||
$return_all_group = false;
|
||||
|
||||
if (users_can_manage_group_all('AR')) {
|
||||
if (users_can_manage_group_all('AR') === true) {
|
||||
$return_all_group = true;
|
||||
}
|
||||
|
||||
|
@ -374,16 +378,18 @@ class SystemGroupStatusWidget extends Widget
|
|||
$selected_groups = explode(',', $this->values['groupId'][0]);
|
||||
|
||||
if ($selected_groups[0] === '') {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
$all_counters = [];
|
||||
|
||||
if (in_array(0, $selected_groups)) {
|
||||
if (in_array(0, $selected_groups) === true) {
|
||||
$all_groups = db_get_all_rows_sql('select id_grupo from tgrupo');
|
||||
$all_groups_id = array_column($all_groups, 'id_grupo');
|
||||
|
||||
$all_groups_counters = groupview_get_modules_counters($all_groups_id);
|
||||
$all_groups_counters = groupview_get_modules_counters(
|
||||
$all_groups_id
|
||||
);
|
||||
|
||||
$all_counters['g'] = 0;
|
||||
$all_counters['name'] = __('All');
|
||||
|
@ -512,7 +518,7 @@ class SystemGroupStatusWidget extends Widget
|
|||
$outputLine .= '<a title="'.__('Modules in normal status');
|
||||
$outputLine .= '" class="group_view_data"';
|
||||
$outputLine .= ' style="'.$style.'"';
|
||||
$outputLine .= $show_link === true ? '" href="'.$url : '';
|
||||
$outputLine .= ($show_link === true) ? '" href="'.$url : '';
|
||||
$outputLine .= '&status='.AGENT_STATUS_NORMAL.'">';
|
||||
$outputLine .= $group['total_module_normal'];
|
||||
$outputLine .= '</a>';
|
||||
|
@ -528,7 +534,7 @@ class SystemGroupStatusWidget extends Widget
|
|||
$outputLine .= '<a title="'.__('Modules in warning status');
|
||||
$outputLine .= '" class="group_view_data"';
|
||||
$outputLine .= ' style="'.$style.'"';
|
||||
$outputLine .= $show_link === true ? '" href="'.$url : '';
|
||||
$outputLine .= ($show_link === true) ? '" href="'.$url : '';
|
||||
$outputLine .= '&status='.AGENT_STATUS_WARNING.'">';
|
||||
$outputLine .= $group['total_module_warning'];
|
||||
$outputLine .= '</a>';
|
||||
|
@ -545,7 +551,7 @@ class SystemGroupStatusWidget extends Widget
|
|||
$outputLine .= __('Modules in critical status');
|
||||
$outputLine .= '" class="group_view_data"';
|
||||
$outputLine .= ' style="'.$style.'"';
|
||||
$outputLine .= $show_link === true ? '" href="'.$url : '';
|
||||
$outputLine .= ($show_link === true) ? '" href="'.$url : '';
|
||||
$outputLine .= '&status='.AGENT_STATUS_CRITICAL.'">';
|
||||
$outputLine .= $group['total_module_critical'];
|
||||
$outputLine .= '</a>';
|
||||
|
@ -556,12 +562,17 @@ class SystemGroupStatusWidget extends Widget
|
|||
}
|
||||
|
||||
if ($show_alert_fired === true) {
|
||||
$url_alert = $config['homeurl'];
|
||||
$url_alert .= 'index.php?sec=view&';
|
||||
$url_alert .= 'sec2=operation/agentes/alerts_status';
|
||||
$url_alert .= '&ag_group='.$group['g'];
|
||||
|
||||
$outputLine = '<div class="bg_ff9">';
|
||||
$outputLine .= '<span>';
|
||||
$outputLine .= '<a title="'.__('Alerts fired');
|
||||
$outputLine .= '" class="group_view_data"';
|
||||
$outputLine .= ' style="'.$style.'"';
|
||||
$outputLine .= $show_link === true ? '" href="'.$url : '';
|
||||
$outputLine .= ($show_link === true) ? '" href="'.$url_alert : '';
|
||||
$outputLine .= '&filter=fired">';
|
||||
$outputLine .= $group['total_module_alerts'];
|
||||
$outputLine .= '</a>';
|
||||
|
|
|
@ -284,12 +284,15 @@ class TopNEventByGroupWidget extends Widget
|
|||
if ($values['groupId']) {
|
||||
$selected_groups = explode(',', $values['groupId'][0]);
|
||||
|
||||
if (users_can_manage_group_all('RM') || in_array(0, $selected_groups) === true) {
|
||||
// Return all group if user has permissions or it is a currently selected group.
|
||||
if (users_can_manage_group_all('RM') === true
|
||||
|| in_array(0, $selected_groups) === true
|
||||
) {
|
||||
// Return all group if user has permissions
|
||||
// or it is a currently selected group.
|
||||
$return_all_group = true;
|
||||
}
|
||||
} else {
|
||||
if (users_can_manage_group_all('RM')) {
|
||||
if (users_can_manage_group_all('RM') === true) {
|
||||
$return_all_group = true;
|
||||
}
|
||||
}
|
||||
|
@ -301,10 +304,11 @@ class TopNEventByGroupWidget extends Widget
|
|||
'name' => 'groupId[]',
|
||||
'returnAllGroup' => true,
|
||||
'privilege' => 'AR',
|
||||
'selected' => $selected_groups,
|
||||
'selected' => (empty($selected_groups) === true) ? [0] : $selected_groups,
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
'returnAllGroup' => $return_all_group,
|
||||
'required' => true,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -283,12 +283,15 @@ class TopNEventByModuleWidget extends Widget
|
|||
if ($values['groupId']) {
|
||||
$selected_groups = explode(',', $values['groupId'][0]);
|
||||
|
||||
if (users_can_manage_group_all('RM') || in_array(0, $selected_groups) === true) {
|
||||
// Return all group if user has permissions or it is a currently selected group.
|
||||
if (users_can_manage_group_all('RM') === true
|
||||
|| in_array(0, $selected_groups) === true
|
||||
) {
|
||||
// Return all group if user has permissions
|
||||
// or it is a currently selected group.
|
||||
$return_all_group = true;
|
||||
}
|
||||
} else {
|
||||
if (users_can_manage_group_all('RM')) {
|
||||
if (users_can_manage_group_all('RM') === true) {
|
||||
$return_all_group = true;
|
||||
}
|
||||
}
|
||||
|
@ -301,10 +304,11 @@ class TopNEventByModuleWidget extends Widget
|
|||
'name' => 'groupId[]',
|
||||
'returnAllGroup' => true,
|
||||
'privilege' => 'AR',
|
||||
'selected' => $selected_groups,
|
||||
'selected' => (empty($selected_groups) === true) ? [0] : $selected_groups,
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
'returnAllGroup' => $return_all_group,
|
||||
'required' => true,
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -362,7 +366,7 @@ class TopNEventByModuleWidget extends Widget
|
|||
$this->values['groupId'] = explode(',', $this->values['groupId'][0]);
|
||||
|
||||
if (empty($this->values['groupId']) === true) {
|
||||
$output .= '<div class="container-center">';
|
||||
$output = '<div class="container-center">';
|
||||
$output .= \ui_print_info_message(
|
||||
__('Please select one or more groups.'),
|
||||
'',
|
||||
|
@ -414,7 +418,7 @@ class TopNEventByModuleWidget extends Widget
|
|||
$result = db_get_all_rows_sql($sql);
|
||||
|
||||
if (empty($result) === true) {
|
||||
$output .= '<div class="container-center">';
|
||||
$output = '<div class="container-center">';
|
||||
$output .= \ui_print_error_message(
|
||||
__('There is not data to show.'),
|
||||
'',
|
||||
|
@ -503,7 +507,7 @@ class TopNEventByModuleWidget extends Widget
|
|||
break;
|
||||
}
|
||||
|
||||
$output .= pie_graph(
|
||||
$output = pie_graph(
|
||||
$data_pie,
|
||||
$width,
|
||||
$height,
|
||||
|
|
|
@ -587,6 +587,33 @@ class TreeViewWidget extends Widget
|
|||
true
|
||||
);
|
||||
|
||||
switch ($tab) {
|
||||
case 'policies':
|
||||
$foundMessage = __('Policies found');
|
||||
break;
|
||||
|
||||
case 'os':
|
||||
$foundMessage = __('Operating systems found');
|
||||
break;
|
||||
|
||||
case 'tag':
|
||||
$foundMessage = __('Tags found');
|
||||
break;
|
||||
|
||||
case 'module_group':
|
||||
$foundMessage = __('Module Groups found');
|
||||
break;
|
||||
|
||||
case 'module':
|
||||
$foundMessage = __('Modules found');
|
||||
break;
|
||||
|
||||
case 'group':
|
||||
default:
|
||||
$foundMessage = __('Groups found');
|
||||
break;
|
||||
}
|
||||
|
||||
$settings = [
|
||||
'page' => 'include/ajax/tree.ajax',
|
||||
'id_user' => $config['id_user'],
|
||||
|
@ -607,7 +634,7 @@ class TreeViewWidget extends Widget
|
|||
'userLanguage' => get_user_language(),
|
||||
'translate' => [
|
||||
'emptyMessage' => __('No data found'),
|
||||
'foundMessage' => 'not',
|
||||
'foundMessage' => $foundMessage,
|
||||
'total' => [
|
||||
'agents' => __('Total agents'),
|
||||
'modules' => __('Total modules'),
|
||||
|
|
|
@ -105,6 +105,23 @@ class Group extends Entity
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Alias of 'nombre'.
|
||||
*
|
||||
* @param string|null $name Name of group.
|
||||
*
|
||||
* @return string|void Name assigned or void if set operation.
|
||||
*/
|
||||
public function name(?string $name=null)
|
||||
{
|
||||
if ($name === null) {
|
||||
return $this->nombre();
|
||||
}
|
||||
|
||||
return $this->nombre($name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves a list of groups fitered.
|
||||
*
|
||||
|
@ -119,7 +136,7 @@ class Group extends Entity
|
|||
if (empty($filter['id_user']) === true) {
|
||||
// By default query current user groups.
|
||||
$filter['id_user'] = false;
|
||||
} else if (!\users_is_admin()) {
|
||||
} else if ((bool) \users_is_admin() === false) {
|
||||
// Override user queried if user is not an admin.
|
||||
$filter['id_user'] = false;
|
||||
}
|
||||
|
@ -226,8 +243,9 @@ class Group extends Entity
|
|||
if (isset($config['centralized_management']) === true
|
||||
&& $config['centralized_management'] > 0
|
||||
) {
|
||||
$msg = 'cannot be modified in a centralized management environment';
|
||||
throw new \Exception(
|
||||
get_class($this).' error, cannot be modified while centralized management environment.'
|
||||
get_class($this).' error, '.$msg
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -242,6 +242,13 @@ class Item extends CachedModel
|
|||
);
|
||||
}
|
||||
|
||||
$decodedData['agentDisabled'] = static::parseBool(
|
||||
$data['agentDisabled']
|
||||
);
|
||||
$decodedData['moduleDisabled'] = static::parseBool(
|
||||
$data['moduleDisabled']
|
||||
);
|
||||
|
||||
return $decodedData;
|
||||
}
|
||||
|
||||
|
@ -749,6 +756,7 @@ class Item extends CachedModel
|
|||
* Fetch a vc item data structure from the database using a filter.
|
||||
*
|
||||
* @param array $filter Filter of the Visual Console Item.
|
||||
* @param float $ratio Ratio resize view.
|
||||
*
|
||||
* @return array The Visual Console Item data structure stored into the DB.
|
||||
* @throws \Exception When the data cannot be retrieved from the DB.
|
||||
|
@ -906,7 +914,6 @@ class Item extends CachedModel
|
|||
* @return array The agent data structure stored into the DB.
|
||||
*
|
||||
* @throws \InvalidArgumentException When the input agent Id is invalid.
|
||||
* @throws \Exception When the data cannot be retrieved from the DB.
|
||||
*/
|
||||
protected static function fetchAgentDataFromDB(array $itemData): array
|
||||
{
|
||||
|
@ -923,7 +930,6 @@ class Item extends CachedModel
|
|||
$agentId = static::extractAgentId($itemData);
|
||||
if ($agentId === null) {
|
||||
$agentId = 0;
|
||||
// throw new \InvalidArgumentException('invalid agent Id');
|
||||
}
|
||||
|
||||
// Staticgraph don't need to have an agent.
|
||||
|
@ -931,15 +937,15 @@ class Item extends CachedModel
|
|||
return $agentData;
|
||||
}
|
||||
|
||||
if (\is_metaconsole() && $metaconsoleId === null) {
|
||||
if (\is_metaconsole() === true && $metaconsoleId === null) {
|
||||
throw new \InvalidArgumentException('missing metaconsole node Id');
|
||||
}
|
||||
|
||||
$agent = false;
|
||||
|
||||
if (\is_metaconsole()) {
|
||||
if (\is_metaconsole() === true) {
|
||||
$sql = sprintf(
|
||||
'SELECT nombre, alias, direccion, comentarios
|
||||
'SELECT nombre, alias, direccion, comentarios, `disabled`
|
||||
FROM tmetaconsole_agent
|
||||
WHERE id_tagente = %s and id_tmetaconsole_setup = %s',
|
||||
$agentId,
|
||||
|
@ -947,7 +953,7 @@ class Item extends CachedModel
|
|||
);
|
||||
} else {
|
||||
$sql = sprintf(
|
||||
'SELECT nombre, alias, direccion, comentarios
|
||||
'SELECT nombre, alias, direccion, comentarios, `disabled`
|
||||
FROM tagente
|
||||
WHERE id_agente = %s',
|
||||
$agentId
|
||||
|
@ -957,8 +963,8 @@ class Item extends CachedModel
|
|||
$agent = \db_get_row_sql($sql);
|
||||
|
||||
if ($agent === false) {
|
||||
$agentData['agentDisabled'] = true;
|
||||
return $agentData;
|
||||
// throw new \Exception('error fetching the data from the DB');
|
||||
}
|
||||
|
||||
// The agent name should be a valid string or a null value.
|
||||
|
@ -966,6 +972,7 @@ class Item extends CachedModel
|
|||
$agentData['agentAlias'] = $agent['alias'];
|
||||
$agentData['agentDescription'] = $agent['comentarios'];
|
||||
$agentData['agentAddress'] = $agent['direccion'];
|
||||
$agentData['agentDisabled'] = $agent['disabled'];
|
||||
|
||||
return \io_safe_output($agentData);
|
||||
}
|
||||
|
@ -979,7 +986,6 @@ class Item extends CachedModel
|
|||
*
|
||||
* @return array The module data structure stored into the DB.
|
||||
* @throws \InvalidArgumentException When the input module Id is invalid.
|
||||
* @throws \Exception When the data cannot be retrieved from the DB.
|
||||
*/
|
||||
protected static function fetchModuleDataFromDB(array $itemData): array
|
||||
{
|
||||
|
@ -988,7 +994,7 @@ class Item extends CachedModel
|
|||
include_once $config['homedir'].'/include/functions_io.php';
|
||||
|
||||
// Load side libraries.
|
||||
if (\is_metaconsole()) {
|
||||
if (\is_metaconsole() === true) {
|
||||
\enterprise_include_once('include/functions_metaconsole.php');
|
||||
}
|
||||
|
||||
|
@ -999,7 +1005,6 @@ class Item extends CachedModel
|
|||
$moduleId = static::extractModuleId($itemData);
|
||||
if ($moduleId === null) {
|
||||
$moduleId = 0;
|
||||
// throw new \InvalidArgumentException('invalid module Id');
|
||||
}
|
||||
|
||||
// Staticgraph don't need to have a module.
|
||||
|
@ -1010,14 +1015,14 @@ class Item extends CachedModel
|
|||
// We should add the metaconsole Id if we can.
|
||||
$metaconsoleId = static::extractMetaconsoleId($itemData);
|
||||
|
||||
if (\is_metaconsole() && $metaconsoleId === null) {
|
||||
if (\is_metaconsole() === true && $metaconsoleId === null) {
|
||||
throw new \InvalidArgumentException('missing metaconsole node Id');
|
||||
}
|
||||
|
||||
$moduleName = false;
|
||||
|
||||
// Connect to node.
|
||||
if (\is_metaconsole()
|
||||
if (\is_metaconsole() === true
|
||||
&& \metaconsole_connect(null, $metaconsoleId) !== NOERR
|
||||
) {
|
||||
throw new \InvalidArgumentException(
|
||||
|
@ -1026,7 +1031,7 @@ class Item extends CachedModel
|
|||
}
|
||||
|
||||
$sql = sprintf(
|
||||
'SELECT nombre, descripcion
|
||||
'SELECT nombre, descripcion, `disabled`
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = %s',
|
||||
$moduleId
|
||||
|
@ -1035,17 +1040,18 @@ class Item extends CachedModel
|
|||
$moduleName = \db_get_row_sql($sql);
|
||||
|
||||
// Restore connection.
|
||||
if (\is_metaconsole()) {
|
||||
if (\is_metaconsole() === true) {
|
||||
\metaconsole_restore_db();
|
||||
}
|
||||
|
||||
if ($moduleName === false) {
|
||||
$agentData['moduleDisabled'] = true;
|
||||
return $moduleData;
|
||||
// throw new \Exception('error fetching the data from the DB');
|
||||
}
|
||||
|
||||
$moduleData['moduleName'] = $moduleName['nombre'];
|
||||
$moduleData['moduleDescription'] = $moduleName['descripcion'];
|
||||
$moduleData['moduleDisabled'] = $moduleName['disabled'];
|
||||
|
||||
return \io_safe_output($moduleData);
|
||||
}
|
||||
|
@ -1065,7 +1071,7 @@ class Item extends CachedModel
|
|||
|
||||
// Load side libraries.
|
||||
include_once $config['homedir'].'/include/functions_ui.php';
|
||||
if (\is_metaconsole()) {
|
||||
if (\is_metaconsole() === true) {
|
||||
\enterprise_include_once('include/functions_metaconsole.php');
|
||||
\enterprise_include_once('meta/include/functions_ui_meta.php');
|
||||
}
|
||||
|
@ -1076,7 +1082,12 @@ class Item extends CachedModel
|
|||
|
||||
$baseUrl = \ui_get_full_url('index.php');
|
||||
|
||||
// TODO: There's a feature to get the link from the label.
|
||||
if ((bool) $data['agentDisabled'] === true
|
||||
|| (bool) $data['moduleDisabled'] === true
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (static::$useLinkedVisualConsole === true
|
||||
&& $linkedVisualConsole['linkedLayoutId'] !== null
|
||||
&& $linkedVisualConsole['linkedLayoutId'] > 0
|
||||
|
@ -1099,7 +1110,9 @@ class Item extends CachedModel
|
|||
return null;
|
||||
}
|
||||
|
||||
if (empty($linkedLayoutNodeId) === true && \is_metaconsole()) {
|
||||
if (empty($linkedLayoutNodeId) === true
|
||||
&& \is_metaconsole() === true
|
||||
) {
|
||||
/*
|
||||
* A Visual Console from this console.
|
||||
* We are in a metaconsole.
|
||||
|
@ -1115,7 +1128,7 @@ class Item extends CachedModel
|
|||
]
|
||||
);
|
||||
} else if (empty($linkedLayoutNodeId) === true
|
||||
&& !\is_metaconsole()
|
||||
&& \is_metaconsole() === false
|
||||
) {
|
||||
/*
|
||||
* A Visual Console from this console.
|
||||
|
@ -1130,7 +1143,9 @@ class Item extends CachedModel
|
|||
'pure' => (int) $config['pure'],
|
||||
]
|
||||
);
|
||||
} else if (\is_metaconsole() && \can_user_access_node()) {
|
||||
} else if (\is_metaconsole() === true
|
||||
&& (bool) \can_user_access_node() === true
|
||||
) {
|
||||
/*
|
||||
* A Visual Console from a meta node.
|
||||
* We are in a metaconsole.
|
||||
|
@ -1141,7 +1156,6 @@ class Item extends CachedModel
|
|||
$linkedLayoutNodeId
|
||||
);
|
||||
|
||||
// TODO: Link to a public view.
|
||||
return \ui_meta_get_node_url(
|
||||
$node,
|
||||
'network',
|
||||
|
@ -1164,7 +1178,9 @@ class Item extends CachedModel
|
|||
// The module can be from another node.
|
||||
$metaconsoleId = $linkedModule['metaconsoleId'];
|
||||
|
||||
if (empty($metaconsoleId) === true) {
|
||||
if (is_metaconsole() === false
|
||||
|| empty($metaconsoleId) === true
|
||||
) {
|
||||
/*
|
||||
* A module from this console.
|
||||
*/
|
||||
|
@ -1196,7 +1212,9 @@ class Item extends CachedModel
|
|||
}
|
||||
|
||||
return $baseUrl.'?'.http_build_query($queryParams);
|
||||
} else if (\is_metaconsole() && \can_user_access_node()) {
|
||||
} else if (\is_metaconsole() === true
|
||||
&& (bool) \can_user_access_node() === true
|
||||
) {
|
||||
/*
|
||||
* A module from a meta node.
|
||||
* We are in a metaconsole.
|
||||
|
@ -1264,7 +1282,9 @@ class Item extends CachedModel
|
|||
// The agent can be from another node.
|
||||
$metaconsoleId = $linkedAgent['metaconsoleId'];
|
||||
|
||||
if (empty($metaconsoleId) === true) {
|
||||
if (is_metaconsole() === false
|
||||
|| empty($metaconsoleId) === true
|
||||
) {
|
||||
/*
|
||||
* An agent from this console.
|
||||
* We are in a regular console.
|
||||
|
@ -1277,7 +1297,9 @@ class Item extends CachedModel
|
|||
'id_agente' => $agentId,
|
||||
]
|
||||
);
|
||||
} else if (\is_metaconsole() && \can_user_access_node()) {
|
||||
} else if (\is_metaconsole() === true
|
||||
&& (bool) \can_user_access_node() === true
|
||||
) {
|
||||
/*
|
||||
* An agent from a meta node.
|
||||
* We are in a metaconsole.
|
||||
|
@ -1291,7 +1313,7 @@ class Item extends CachedModel
|
|||
$node,
|
||||
'estado',
|
||||
'operation/agentes/ver_agente',
|
||||
['id_agente' => $moduleId],
|
||||
['id_agente' => $agentId],
|
||||
// No autologin from the public view.
|
||||
!$config['public_view']
|
||||
);
|
||||
|
@ -1424,6 +1446,7 @@ class Item extends CachedModel
|
|||
'enableLink',
|
||||
]
|
||||
);
|
||||
|
||||
if ($enable_link !== null) {
|
||||
$result['enable_link'] = static::parseBool($enable_link);
|
||||
}
|
||||
|
@ -1466,11 +1489,6 @@ class Item extends CachedModel
|
|||
$result['linked_layout_node_id'] = $linked_layout_node_id;
|
||||
}
|
||||
|
||||
if ($id_layout_linked > 0) {
|
||||
// If VC linked, force link status to enabled.
|
||||
$result['enable_link'] = 1;
|
||||
}
|
||||
|
||||
$linked_layout_status_type = static::notEmptyStringOr(
|
||||
static::issetInArray(
|
||||
$data,
|
||||
|
@ -1769,7 +1787,7 @@ class Item extends CachedModel
|
|||
|
||||
$item = static::fromDB(['id' => $save['id']]);
|
||||
// Update the model.
|
||||
if (!empty($item)) {
|
||||
if (empty($item) === false) {
|
||||
$this->setData($item->toArray());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,7 +133,8 @@ final class StaticGraph extends Item
|
|||
/**
|
||||
* Fetch a vc item data structure from the database using a filter.
|
||||
*
|
||||
* @param array $filter Filter of the Visual Console Item.
|
||||
* @param array $filter Filter of the Visual Console Item.
|
||||
* @param float|null $ratio Ratio.
|
||||
*
|
||||
* @return array The Visual Console Item data structure stored into the DB.
|
||||
* @throws \InvalidArgumentException When an agent Id cannot be found.
|
||||
|
@ -171,44 +172,57 @@ final class StaticGraph extends Item
|
|||
throw new \InvalidArgumentException('missing module Id');
|
||||
}
|
||||
|
||||
// Get the img src.
|
||||
// There's no need to connect to the metaconsole before searching for
|
||||
// the image status cause the function itself does that for us.
|
||||
$imagePath = \visual_map_get_image_status_element($data);
|
||||
$data['statusImageSrc'] = \ui_get_full_url(
|
||||
$imagePath,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
if ((bool) $data['agentDisabled'] === false
|
||||
&& (bool) $data['moduleDisabled'] === false
|
||||
) {
|
||||
// Get the img src.
|
||||
// There's no need to connect to the metaconsole before searching
|
||||
// for the image status cause the function itself does that for us.
|
||||
$imagePath = \visual_map_get_image_status_element($data);
|
||||
$data['statusImageSrc'] = \ui_get_full_url(
|
||||
$imagePath,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
$status = \visual_map_get_status_element($data);
|
||||
$status = \visual_map_get_status_element($data);
|
||||
|
||||
// Magic numbers from the hell.
|
||||
switch ($status) {
|
||||
case 1:
|
||||
case 4:
|
||||
// Critical or critical alert (BAD).
|
||||
$data['colorStatus'] = COL_CRITICAL;
|
||||
break;
|
||||
// Magic numbers from the hell.
|
||||
switch ($status) {
|
||||
case 1:
|
||||
case 4:
|
||||
// Critical or critical alert (BAD).
|
||||
$data['colorStatus'] = COL_CRITICAL;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
// Normal (OK).
|
||||
$data['colorStatus'] = COL_NORMAL;
|
||||
break;
|
||||
case 0:
|
||||
// Normal (OK).
|
||||
$data['colorStatus'] = COL_NORMAL;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 10:
|
||||
// Warning or warning alert.
|
||||
$data['colorStatus'] = COL_WARNING;
|
||||
break;
|
||||
case 2:
|
||||
case 10:
|
||||
// Warning or warning alert.
|
||||
$data['colorStatus'] = COL_WARNING;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// Unknown.
|
||||
default:
|
||||
// Default is Grey (Other).
|
||||
$data['colorStatus'] = COL_UNKNOWN;
|
||||
break;
|
||||
case 3:
|
||||
// Unknown.
|
||||
default:
|
||||
// Default is Grey (Other).
|
||||
$data['colorStatus'] = COL_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$data['colorStatus'] = COL_UNKNOWN;
|
||||
$imagePath = 'images/console/icons/'.$data['image'].'.png';
|
||||
$data['statusImageSrc'] = \ui_get_full_url(
|
||||
$imagePath,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
// If the width or the height are equal to 0 we will extract them
|
||||
|
@ -359,7 +373,6 @@ final class StaticGraph extends Item
|
|||
'label' => __('Module'),
|
||||
'arguments' => [
|
||||
'type' => 'autocomplete_module',
|
||||
'fields' => $fields,
|
||||
'name' => 'moduleId',
|
||||
'selected' => $values['moduleId'],
|
||||
'return' => true,
|
||||
|
|
|
@ -390,7 +390,6 @@ table.group_modules_status_box tr td > span {
|
|||
}
|
||||
|
||||
table.group_modules_status_box tr td div {
|
||||
background-color: #82b92e;
|
||||
width: 90%;
|
||||
padding: 3px;
|
||||
text-align: center;
|
||||
|
@ -534,3 +533,13 @@ div#main_pure {
|
|||
#select_multiple_modules_filtered > div > div > * {
|
||||
flex: auto;
|
||||
}
|
||||
|
||||
.visual-console-container-dashboard div.label strong {
|
||||
color: inherit;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual-console-container-dashboard div.label strong span {
|
||||
color: inherit;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
|
|
@ -2718,6 +2718,10 @@ span#plugin_description {
|
|||
background-color: #ededed;
|
||||
}
|
||||
|
||||
.tinyMCEBody span strong {
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_4pt,
|
||||
.visual_font_size_4pt > em,
|
||||
.visual_font_size_4pt > strong,
|
||||
|
@ -2729,6 +2733,7 @@ span#plugin_description {
|
|||
.visual_font_size_4pt span em {
|
||||
font-size: 4pt;
|
||||
line-height: 4pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
.visual_font_size_6pt,
|
||||
.visual_font_size_6pt > em,
|
||||
|
@ -2741,6 +2746,7 @@ span#plugin_description {
|
|||
.visual_font_size_6pt span em {
|
||||
font-size: 6pt;
|
||||
line-height: 6pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
.visual_font_size_8pt,
|
||||
.visual_font_size_8pt > em,
|
||||
|
@ -2753,6 +2759,7 @@ span#plugin_description {
|
|||
.visual_font_size_8pt span em {
|
||||
font-size: 8pt;
|
||||
line-height: 8pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
.visual_font_size_10pt,
|
||||
.visual_font_size_10pt > em,
|
||||
|
@ -2765,6 +2772,7 @@ span#plugin_description {
|
|||
.visual_font_size_10pt span em {
|
||||
font-size: 10pt;
|
||||
line-height: 10pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
.visual_font_size_12pt,
|
||||
.visual_font_size_12pt > em,
|
||||
|
@ -2777,6 +2785,7 @@ span#plugin_description {
|
|||
.visual_font_size_12pt span em {
|
||||
font-size: 12pt;
|
||||
line-height: 12pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
.visual_font_size_14pt,
|
||||
.visual_font_size_14pt > em,
|
||||
|
@ -2789,6 +2798,7 @@ span#plugin_description {
|
|||
.visual_font_size_14pt span em {
|
||||
font-size: 14pt;
|
||||
line-height: 14pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
.visual_font_size_18pt,
|
||||
.visual_font_size_18pt > em,
|
||||
|
@ -2801,6 +2811,7 @@ span#plugin_description {
|
|||
.visual_font_size_18pt span em {
|
||||
font-size: 18pt;
|
||||
line-height: 18pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_24pt,
|
||||
|
@ -2814,6 +2825,7 @@ span#plugin_description {
|
|||
.visual_font_size_24pt span em {
|
||||
font-size: 24pt;
|
||||
line-height: 24pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
.visual_font_size_28pt,
|
||||
.visual_font_size_28pt > em,
|
||||
|
@ -2826,6 +2838,7 @@ span#plugin_description {
|
|||
.visual_font_size_28pt span em {
|
||||
font-size: 28pt;
|
||||
line-height: 28pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
.visual_font_size_36pt,
|
||||
.visual_font_size_36pt > em,
|
||||
|
@ -2838,6 +2851,7 @@ span#plugin_description {
|
|||
.visual_font_size_36pt span em {
|
||||
font-size: 36pt;
|
||||
line-height: 36pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
.visual_font_size_48pt,
|
||||
.visual_font_size_48pt > em,
|
||||
|
@ -2850,6 +2864,7 @@ span#plugin_description {
|
|||
.visual_font_size_48pt span em {
|
||||
font-size: 48pt;
|
||||
line-height: 48pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
.visual_font_size_60pt,
|
||||
.visual_font_size_60pt > em,
|
||||
|
@ -2862,6 +2877,7 @@ span#plugin_description {
|
|||
.visual_font_size_60pt span em {
|
||||
font-size: 60pt;
|
||||
line-height: 60pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
.visual_font_size_72pt,
|
||||
.visual_font_size_72pt > em,
|
||||
|
@ -2874,6 +2890,7 @@ span#plugin_description {
|
|||
.visual_font_size_72pt span em {
|
||||
font-size: 72pt;
|
||||
line-height: 72pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_84pt,
|
||||
|
@ -2887,6 +2904,7 @@ span#plugin_description {
|
|||
.visual_font_size_84pt span em {
|
||||
font-size: 84pt;
|
||||
line-height: 84pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_96pt,
|
||||
|
@ -2900,6 +2918,7 @@ span#plugin_description {
|
|||
.visual_font_size_96pt span em {
|
||||
font-size: 96pt;
|
||||
line-height: 96pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_116pt,
|
||||
|
@ -2913,6 +2932,7 @@ span#plugin_description {
|
|||
.visual_font_size_116pt span em {
|
||||
font-size: 116pt;
|
||||
line-height: 116pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_128pt,
|
||||
|
@ -2926,6 +2946,7 @@ span#plugin_description {
|
|||
.visual_font_size_128pt span em {
|
||||
font-size: 128pt;
|
||||
line-height: 128pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_140pt,
|
||||
|
@ -2939,6 +2960,7 @@ span#plugin_description {
|
|||
.visual_font_size_140pt span em {
|
||||
font-size: 140pt;
|
||||
line-height: 140pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_154pt,
|
||||
|
@ -2952,6 +2974,7 @@ span#plugin_description {
|
|||
.visual_font_size_154pt span em {
|
||||
font-size: 154pt;
|
||||
line-height: 154pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_196pt,
|
||||
|
@ -2965,6 +2988,7 @@ span#plugin_description {
|
|||
.visual_font_size_196pt span em {
|
||||
font-size: 196pt;
|
||||
line-height: 196pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.resize_visual_font_size_8pt,
|
||||
|
@ -5973,7 +5997,7 @@ div#status_pie {
|
|||
.table_services_item {
|
||||
display: grid;
|
||||
align-items: center;
|
||||
grid-template-columns: 50px auto;
|
||||
grid-template-columns: auto auto auto;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -6319,7 +6343,6 @@ div.graph div.legend table {
|
|||
position: absolute;
|
||||
top: 0;
|
||||
left: 0px;
|
||||
display: none;
|
||||
padding: 5px;
|
||||
}
|
||||
/*
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
div.external-visual-console-container {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
div#vc-controls {
|
||||
position: fixed;
|
||||
top: 30px;
|
||||
|
@ -125,12 +130,26 @@ input.delete_min {
|
|||
input.delete_min[disabled] {
|
||||
background: url(../../images/cross.disabled.png) no-repeat center;
|
||||
}
|
||||
input.delete_min_white {
|
||||
background: url(../../images/cross.disabled.png) no-repeat center;
|
||||
}
|
||||
input.delete_min_white[disabled] {
|
||||
background: url(../../images/cross.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.graph_min {
|
||||
background: url(../../images/chart_curve.png) no-repeat center;
|
||||
}
|
||||
input.graph_min[disabled] {
|
||||
background: url(../../images/chart_curve.disabled.png) no-repeat center;
|
||||
}
|
||||
input.graph_min_white {
|
||||
background: url(../../images/chart_curve.disabled.png) no-repeat center;
|
||||
}
|
||||
input.graph_min_white[disabled] {
|
||||
background: url(../../images/chart_curve.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.bars_graph_min {
|
||||
background: url(../../images/icono-barras-arriba.png) no-repeat center;
|
||||
}
|
||||
|
@ -138,120 +157,260 @@ input.bars_graph_min[disabled] {
|
|||
background: url(../../images/icono-barras-arriba.disabled.png) no-repeat
|
||||
center;
|
||||
}
|
||||
input.bars_graph_min_white {
|
||||
background: url(../../images/icono-barras-arriba.disabled.png) no-repeat
|
||||
center;
|
||||
}
|
||||
input.bars_graph_min_white[disabled] {
|
||||
background: url(../../images/icono-barras-arriba.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.percentile_min {
|
||||
background: url(../../images/chart_bar.png) no-repeat center;
|
||||
}
|
||||
input.percentile_min[disabled] {
|
||||
background: url(../../images/chart_bar.disabled.png) no-repeat center;
|
||||
}
|
||||
input.percentile_min_white {
|
||||
background: url(../../images/chart_bar.disabled.png) no-repeat center;
|
||||
}
|
||||
input.percentile_min_white[disabled] {
|
||||
background: url(../../images/chart_bar.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.percentile_item_min {
|
||||
background: url(../../images/percentile_item.png) no-repeat center;
|
||||
}
|
||||
input.percentile_item_min[disabled] {
|
||||
background: url(../../images/percentile_item.disabled.png) no-repeat center;
|
||||
}
|
||||
input.percentile_item_min_white {
|
||||
background: url(../../images/percentile_item.disabled.png) no-repeat center;
|
||||
}
|
||||
input.percentile_item_min_white[disabled] {
|
||||
background: url(../../images/percentile_item.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.auto_sla_graph_min {
|
||||
background: url(../../images/auto_sla_graph.png) no-repeat center;
|
||||
}
|
||||
input.auto_sla_graph_min[disabled] {
|
||||
background: url(../../images/auto_sla_graph.disabled.png) no-repeat center;
|
||||
}
|
||||
input.auto_sla_graph_min_white {
|
||||
background: url(../../images/auto_sla_graph.disabled.png) no-repeat center;
|
||||
}
|
||||
input.auto_sla_graph_min_white[disabled] {
|
||||
background: url(../../images/auto_sla_graph.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.donut_graph_min {
|
||||
background: url(../../images/icono-quesito.png) no-repeat center;
|
||||
}
|
||||
input.donut_graph_min[disabled] {
|
||||
background: url(../../images/icono-quesito.disabled.png) no-repeat center;
|
||||
}
|
||||
input.donut_graph_min_white {
|
||||
background: url(../../images/icono-quesito.disabled.png) no-repeat center;
|
||||
}
|
||||
input.donut_graph_min_white[disabled] {
|
||||
background: url(../../images/icono-quesito.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.binary_min {
|
||||
background: url(../../images/binary.png) no-repeat center;
|
||||
}
|
||||
input.binary_min[disabled] {
|
||||
background: url(../../images/binary.disabled.png) no-repeat center;
|
||||
}
|
||||
input.binary_min_white {
|
||||
background: url(../../images/binary.disabled.png) no-repeat center;
|
||||
}
|
||||
input.binary_min_white[disabled] {
|
||||
background: url(../../images/binary.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.camera_min {
|
||||
background: url(../../images/camera.png) no-repeat center;
|
||||
}
|
||||
input.camera_min[disabled] {
|
||||
background: url(../../images/camera.disabled.png) no-repeat center;
|
||||
}
|
||||
input.camera_min_white {
|
||||
background: url(../../images/camera.disabled.png) no-repeat center;
|
||||
}
|
||||
input.camera_min_white[disabled] {
|
||||
background: url(../../images/camera.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.config_min {
|
||||
background: url(../../images/config.png) no-repeat center;
|
||||
}
|
||||
input.config_min[disabled] {
|
||||
background: url(../../images/config.disabled.png) no-repeat center;
|
||||
}
|
||||
input.config_min_white {
|
||||
background: url(../../images/config.disabled.png) no-repeat center;
|
||||
}
|
||||
input.config_min_white[disabled] {
|
||||
background: url(../../images/config.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.label_min {
|
||||
background: url(../../images/tag_red.png) no-repeat center;
|
||||
}
|
||||
input.label_min[disabled] {
|
||||
background: url(../../images/tag_red.disabled.png) no-repeat center;
|
||||
}
|
||||
input.label_min_white {
|
||||
background: url(../../images/tag_red.disabled.png) no-repeat center;
|
||||
}
|
||||
input.label_min_white[disabled] {
|
||||
background: url(../../images/tag_red.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.icon_min {
|
||||
background: url(../../images/photo.png) no-repeat center;
|
||||
}
|
||||
input.icon_min[disabled] {
|
||||
background: url(../../images/photo.disabled.png) no-repeat center;
|
||||
}
|
||||
input.icon_min_white {
|
||||
background: url(../../images/photo.disabled.png) no-repeat center;
|
||||
}
|
||||
input.icon_min_white[disabled] {
|
||||
background: url(../../images/photo.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.clock_min {
|
||||
background: url(../../images/clock-tab.png) no-repeat center;
|
||||
}
|
||||
input.clock_min[disabled] {
|
||||
background: url(../../images/clock-tab.disabled.png) no-repeat center;
|
||||
}
|
||||
input.clock_min_white {
|
||||
background: url(../../images/clock-tab.disabled.png) no-repeat center;
|
||||
}
|
||||
input.clock_min_white[disabled] {
|
||||
background: url(../../images/clock-tab.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.box_item {
|
||||
background: url(../../images/box_item.png) no-repeat center;
|
||||
}
|
||||
input.box_item[disabled] {
|
||||
background: url(../../images/box_item.disabled.png) no-repeat center;
|
||||
}
|
||||
input.box_item_white {
|
||||
background: url(../../images/box_item.disabled.png) no-repeat center;
|
||||
}
|
||||
input.box_item_white[disabled] {
|
||||
background: url(../../images/box_item.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.line_item {
|
||||
background: url(../../images/line_item.png) no-repeat center;
|
||||
}
|
||||
input.line_item[disabled] {
|
||||
background: url(../../images/line_item.disabled.png) no-repeat center;
|
||||
}
|
||||
input.line_item_white {
|
||||
background: url(../../images/line_item.disabled.png) no-repeat center;
|
||||
}
|
||||
input.line_item_white[disabled] {
|
||||
background: url(../../images/line_item.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.copy_item {
|
||||
background: url(../../images/copy_visualmap.png) no-repeat center;
|
||||
}
|
||||
input.copy_item[disabled] {
|
||||
background: url(../../images/copy_visualmap.disabled.png) no-repeat center;
|
||||
}
|
||||
input.copy_item_white {
|
||||
background: url(../../images/copy_visualmap.disabled.png) no-repeat center;
|
||||
}
|
||||
input.copy_item_white[disabled] {
|
||||
background: url(../../images/copy_visualmap.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.grid_min {
|
||||
background: url(../../images/grid.png) no-repeat center;
|
||||
}
|
||||
input.grid_min[disabled] {
|
||||
background: url(../../images/grid.disabled.png) no-repeat center;
|
||||
}
|
||||
input.grid_min_white {
|
||||
background: url(../../images/grid.disabled.png) no-repeat center;
|
||||
}
|
||||
input.grid_min_white[disabled] {
|
||||
background: url(../../images/grid.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.save_min {
|
||||
background: url(../../images/file.png) no-repeat center;
|
||||
}
|
||||
input.save_min[disabled] {
|
||||
background: url(../../images/file.disabled.png) no-repeat center;
|
||||
}
|
||||
input.save_min_white {
|
||||
background: url(../../images/file.disabled.png) no-repeat center;
|
||||
}
|
||||
input.save_min_white[disabled] {
|
||||
background: url(../../images/file.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.service_min {
|
||||
background: url(../../images/box.png) no-repeat center;
|
||||
}
|
||||
input.service_min[disabled] {
|
||||
background: url(../../images/box.disabled.png) no-repeat center;
|
||||
}
|
||||
input.service_min_white {
|
||||
background: url(../../images/box.disabled.png) no-repeat center;
|
||||
}
|
||||
input.service_min_white[disabled] {
|
||||
background: url(../../images/box.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.network_link_min {
|
||||
background: url(../../images/network_link_item.png) no-repeat center;
|
||||
}
|
||||
input.network_link_min[disabled] {
|
||||
background: url(../../images/network_link_item.disabled.png) no-repeat center;
|
||||
}
|
||||
input.network_link_min_white {
|
||||
background: url(../../images/network_link_item.disabled.png) no-repeat center;
|
||||
}
|
||||
input.network_link_min_white[disabled] {
|
||||
background: url(../../images/network_link_item.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.group_item_min {
|
||||
background: url(../../images/group_green.png) no-repeat center;
|
||||
}
|
||||
input.group_item_min[disabled] {
|
||||
background: url(../../images/group_green.disabled.png) no-repeat center;
|
||||
}
|
||||
input.group_item_min_white {
|
||||
background: url(../../images/group_green.disabled.png) no-repeat center;
|
||||
}
|
||||
input.group_item_min_white[disabled] {
|
||||
background: url(../../images/group_green.png) no-repeat center;
|
||||
}
|
||||
|
||||
input.color_cloud_min {
|
||||
background: url(../../images/color_cloud_item.png) no-repeat center;
|
||||
}
|
||||
input.color_cloud_min[disabled] {
|
||||
background: url(../../images/color_cloud_item.disabled.png) no-repeat center;
|
||||
}
|
||||
input.color_cloud_min_white {
|
||||
background: url(../../images/color_cloud_item.disabled.png) no-repeat center;
|
||||
}
|
||||
input.color_cloud_min_white[disabled] {
|
||||
background: url(../../images/color_cloud_item.png) no-repeat center;
|
||||
}
|
||||
|
||||
div#cont {
|
||||
position: fixed;
|
||||
|
@ -260,6 +419,16 @@ div#cont {
|
|||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
div.label strong {
|
||||
color: inherit;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
div.label strong span {
|
||||
color: inherit;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
/*.termframe{
|
||||
background-color: #82b92e;
|
||||
}*/
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.752';
|
||||
$build = '210322';
|
||||
$build = '210324';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
global $config;
|
||||
|
||||
// Don't display other errors, messes up XML.
|
||||
ini_set('display_errors', E_ALL);
|
||||
ini_set('display_errors', 0);
|
||||
|
||||
require_once '../../include/config.php';
|
||||
require_once '../../include/functions.php';
|
||||
|
|
|
@ -28,7 +28,6 @@ if (file_exists(ENTERPRISE_DIR.'/include/functions_login.php')) {
|
|||
|
||||
require_once $config['homedir'].'/vendor/autoload.php';
|
||||
|
||||
ui_require_css_file('visual_maps');
|
||||
ui_require_css_file('register', 'include/styles/', true);
|
||||
|
||||
// Connection lost alert.
|
||||
|
|
|
@ -235,80 +235,117 @@ if ($pure === false) {
|
|||
echo '<div id ="edit-vc">';
|
||||
echo '<div id ="edit-controls" class="visual-console-edit-controls" style="visibility:hidden">';
|
||||
echo '<div>';
|
||||
$class_camera = 'camera_min link-create-item';
|
||||
$class_percentile = 'percentile_item_min link-create-item';
|
||||
$class_module_graph = 'graph_min link-create-item';
|
||||
$class_donut = 'donut_graph_min link-create-item';
|
||||
$class_bars = 'bars_graph_min link-create-item';
|
||||
$class_value = 'binary_min link-create-item';
|
||||
$class_sla = 'auto_sla_graph_min link-create-item';
|
||||
$class_label = 'label_min link-create-item';
|
||||
$class_icon = 'icon_min link-create-item';
|
||||
$class_clock = 'clock_min link-create-item';
|
||||
$class_group = 'group_item_min link-create-item';
|
||||
$class_box = 'box_item link-create-item';
|
||||
$class_line = 'line_item link-create-item';
|
||||
$class_cloud = 'color_cloud_min link-create-item';
|
||||
$class_nlink = 'network_link_min link-create-item';
|
||||
$class_delete = 'delete_item delete_min';
|
||||
$class_copy = 'copy_item';
|
||||
if ($config['style'] === 'pandora_black') {
|
||||
$class_camera = 'camera_min_white link-create-item';
|
||||
$class_percentile = 'percentile_item_min_white link-create-item';
|
||||
$class_module_graph = 'graph_min_white link-create-item';
|
||||
$class_donut = 'donut_graph_min_white link-create-item';
|
||||
$class_bars = 'bars_graph_min_white link-create-item';
|
||||
$class_value = 'binary_min_white link-create-item';
|
||||
$class_sla = 'auto_sla_graph_min_white link-create-item';
|
||||
$class_label = 'label_min_white link-create-item';
|
||||
$class_icon = 'icon_min_white link-create-item';
|
||||
$class_clock = 'clock_min_white link-create-item';
|
||||
$class_group = 'group_item_min_white link-create-item';
|
||||
$class_box = 'box_item_white link-create-item';
|
||||
$class_line = 'line_item_white link-create-item';
|
||||
$class_cloud = 'color_cloud_min_white link-create-item';
|
||||
$class_nlink = 'network_link_min_white link-create-item';
|
||||
$class_delete = 'delete_item_white delete_min_white';
|
||||
$class_copy = 'copy_item_white';
|
||||
}
|
||||
|
||||
visual_map_print_button_editor_refactor(
|
||||
'STATIC_GRAPH',
|
||||
__('Static Image'),
|
||||
'camera_min link-create-item'
|
||||
$class_camera
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'PERCENTILE_BAR',
|
||||
__('Percentile Item'),
|
||||
'percentile_item_min link-create-item'
|
||||
$class_percentile
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'MODULE_GRAPH',
|
||||
__('Module Graph'),
|
||||
'graph_min link-create-item'
|
||||
$class_module_graph
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'DONUT_GRAPH',
|
||||
__('Serialized pie graph'),
|
||||
'donut_graph_min link-create-item'
|
||||
$class_donut
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'BARS_GRAPH',
|
||||
__('Bars Graph'),
|
||||
'bars_graph_min link-create-item'
|
||||
$class_bars
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'AUTO_SLA_GRAPH',
|
||||
__('Event history graph'),
|
||||
'auto_sla_graph_min link-create-item'
|
||||
$class_sla
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'SIMPLE_VALUE',
|
||||
__('Simple Value'),
|
||||
'binary_min link-create-item'
|
||||
$class_value
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'LABEL',
|
||||
__('Label'),
|
||||
'label_min link-create-item'
|
||||
$class_label
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'ICON',
|
||||
__('Icon'),
|
||||
'icon_min link-create-item'
|
||||
$class_icon
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'CLOCK',
|
||||
__('Clock'),
|
||||
'clock_min link-create-item'
|
||||
$class_clock
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'GROUP_ITEM',
|
||||
__('Group'),
|
||||
'group_item_min link-create-item'
|
||||
$class_group
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'BOX_ITEM',
|
||||
__('Box'),
|
||||
'box_item link-create-item'
|
||||
$class_box
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'LINE_ITEM',
|
||||
__('Line'),
|
||||
'line_item link-create-item'
|
||||
$class_line
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'COLOR_CLOUD',
|
||||
__('Color cloud'),
|
||||
'color_cloud_min link-create-item'
|
||||
$class_cloud
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'NETWORK_LINK',
|
||||
__('Network link'),
|
||||
'network_link_min link-create-item'
|
||||
$class_nlink
|
||||
);
|
||||
enterprise_include_once('include/functions_visual_map_editor.php');
|
||||
enterprise_hook(
|
||||
|
@ -319,13 +356,13 @@ if ($pure === false) {
|
|||
visual_map_print_button_editor_refactor(
|
||||
'button_delete',
|
||||
__('Delete Item'),
|
||||
'delete_item delete_min',
|
||||
$class_delete,
|
||||
true
|
||||
);
|
||||
visual_map_print_button_editor_refactor(
|
||||
'button_copy',
|
||||
__('Copy Item'),
|
||||
'copy_item',
|
||||
$class_copy,
|
||||
true
|
||||
);
|
||||
echo '</div>';
|
||||
|
@ -339,7 +376,9 @@ if ($pure === false) {
|
|||
}
|
||||
}
|
||||
|
||||
echo '<div class="external-visual-console-container">';
|
||||
echo '<div id="visual-console-container"></div>';
|
||||
echo '</div>';
|
||||
|
||||
if ($pure === true) {
|
||||
// Floating menu - Start.
|
||||
|
@ -447,6 +486,8 @@ ui_require_css_file('form');
|
|||
var props = <?php echo (string) $visualConsole; ?>;
|
||||
var items = <?php echo '['.implode($visualConsoleItems, ',').']'; ?>;
|
||||
var baseUrl = "<?php echo ui_get_full_url('/', false, false, false); ?>";
|
||||
var controls = document.getElementById('vc-controls');
|
||||
autoHideElement(controls, 1000);
|
||||
var handleUpdate = function (prevProps, newProps) {
|
||||
if (!newProps) return;
|
||||
|
||||
|
@ -462,7 +503,7 @@ ui_require_css_file('form');
|
|||
if (div !== null) {
|
||||
var parent = div.parentElement;
|
||||
if (parent !== null) {
|
||||
parent.removeChild(div);
|
||||
parent.removeChild(div);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.752
|
||||
%define release 210322
|
||||
%define release 210324
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.752
|
||||
%define release 210322
|
||||
%define release 210324
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.752
|
||||
%define release 210322
|
||||
%define release 210324
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -51,6 +51,7 @@ HTML::printForm(
|
|||
[
|
||||
'form' => $form,
|
||||
'inputs' => $htmlInputs,
|
||||
'js' => $js,
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -142,7 +142,9 @@ $publiclink['text'] .= html_print_image(
|
|||
$publiclink['text'] .= '</a>';
|
||||
|
||||
// Refresh selector time dashboards.
|
||||
if ($config['public_dashboard'] === true) {
|
||||
if (isset($config['public_dashboard']) === true
|
||||
&& (bool) $config['public_dashboard'] === true
|
||||
) {
|
||||
$urlRefresh = $publicUrl;
|
||||
} else {
|
||||
$queryRefresh = [
|
||||
|
@ -213,7 +215,9 @@ $newWidget['text'] .= html_print_image(
|
|||
);
|
||||
$newWidget['text'] .= '</a>';
|
||||
|
||||
if ($config['public_dashboard'] === true) {
|
||||
if (isset($config['public_dashboard']) === true
|
||||
&& (bool) $config['public_dashboard'] === true
|
||||
) {
|
||||
$buttons = [
|
||||
'combo_refresh_one_dashboard' => $comboRefresh,
|
||||
'combo_refresh_countdown' => $comboRefreshCountdown,
|
||||
|
|
|
@ -210,9 +210,6 @@ if (empty($dashboards) === true) {
|
|||
|
||||
if ($writeDashboards === 1) {
|
||||
$text = __('Create a new dashboard');
|
||||
if ($dashboard !== null) {
|
||||
$text = __('Update Dashboard');
|
||||
}
|
||||
|
||||
// Button for display modal options dashboard.
|
||||
$output = '<a href="#" class="float-right" onclick=\'';
|
||||
|
|
|
@ -91,10 +91,6 @@ if (isset($config['gotty']) === false) {
|
|||
config_update_value('gotty', '/usr/bin/gotty');
|
||||
}
|
||||
|
||||
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
$os = strtolower(PHP_OS);
|
||||
if (substr($os, 0, 3) !== 'win') {
|
||||
if (empty($config['gotty']) === false) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.752-210322
|
||||
Version: 7.0NG.752-210324
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.752-210322"
|
||||
pandora_version="7.0NG.752-210324"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -671,10 +671,6 @@ syslog_max 65535
|
|||
# Address
|
||||
# sync_address
|
||||
|
||||
# Target LogStash server, to allow Dataserver and SyslogServer store log information in ElasticSearch
|
||||
#logstash_host ip
|
||||
#logstash_port 10514
|
||||
|
||||
# Pandora FMS Database HA Tool execution interval in seconds (PANDORA FMS ENTERPRISE ONLY).
|
||||
ha_interval 30
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.752";
|
||||
my $pandora_build = "210322";
|
||||
my $pandora_build = "210324";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
@ -511,10 +511,6 @@ sub pandora_load_config {
|
|||
$pa_config->{"warmup_unknown_interval"} = 300; # 6.1
|
||||
$pa_config->{"warmup_unknown_on"} = 1; # 6.1
|
||||
|
||||
# Logstash
|
||||
$pa_config->{"logstash_host"} = '';
|
||||
$pa_config->{"logstash_port"} = 0;
|
||||
|
||||
$pa_config->{"wuxserver"} = 1; # 7.0
|
||||
$pa_config->{"wux_host"} = undef; # 7.0
|
||||
$pa_config->{"wux_port"} = 4444; # 7.0
|
||||
|
@ -1190,13 +1186,6 @@ sub pandora_load_config {
|
|||
elsif ($parametro =~ m/^mssql_driver\s+(.*)/i) {
|
||||
$pa_config->{'mssql_driver'}= clean_blank($1);
|
||||
}
|
||||
|
||||
elsif ($parametro =~ m/^logstash_host\s+(.*)/i) {
|
||||
$pa_config->{'logstash_host'}= clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^logstash_port\s+([0-9]*)/i) {
|
||||
$pa_config->{'logstash_port'}= clean_blank($1);
|
||||
}
|
||||
elsif ($parametro =~ m/^wuxserver\s+([0-1]*)/i) {
|
||||
$pa_config->{"wuxserver"} = clean_blank($1);
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.752";
|
||||
my $pandora_build = "210322";
|
||||
my $pandora_build = "210324";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
@ -504,10 +504,20 @@ sub print_agent {
|
|||
# print header
|
||||
$xml .= "<agent_data ";
|
||||
|
||||
my $group_password_specified = 0;
|
||||
|
||||
foreach my $kad (keys %{$agent_data}){
|
||||
no warnings "uninitialized";
|
||||
$xml .= $kad . "='";
|
||||
$xml .= $agent_data->{$kad} . "' ";
|
||||
|
||||
if ($kad eq 'group_password') {
|
||||
$group_password_specified = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($group_password_specified == 0 && !empty($config->{'group_password'})) {
|
||||
$xml .= " group_password='".$config->{'group_password'}."' ";
|
||||
}
|
||||
|
||||
$xml .= ">";
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.752
|
||||
%define release 210322
|
||||
%define release 210324
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.752
|
||||
%define release 210322
|
||||
%define release 210324
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.752"
|
||||
PI_BUILD="210322"
|
||||
PI_BUILD="210324"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.752 PS210322";
|
||||
my $version = "7.0NG.752 PS210324";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.752 PS210322";
|
||||
my $version = "7.0NG.752 PS210324";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
|
@ -797,11 +797,10 @@ export default class VisualConsole {
|
|||
public render(prevProps: VisualConsoleProps | null = null): void {
|
||||
if (prevProps) {
|
||||
if (prevProps.backgroundURL !== this.props.backgroundURL) {
|
||||
if (this.props.backgroundURL)
|
||||
this.containerRef.style.backgroundImage =
|
||||
this.props.backgroundURL !== null
|
||||
? `url(${this.props.backgroundURL})`
|
||||
: "";
|
||||
this.containerRef.style.backgroundImage =
|
||||
this.props.backgroundURL !== null
|
||||
? `url(${this.props.backgroundURL})`
|
||||
: "";
|
||||
}
|
||||
if (this.props.backgroundColor != null)
|
||||
if (prevProps.backgroundColor !== this.props.backgroundColor) {
|
||||
|
|
|
@ -75,9 +75,14 @@ export default class BarsGraph extends Item<BarsGraphProps> {
|
|||
element.className = "bars-graph";
|
||||
element.style.backgroundImage = `url(${this.props.html})`;
|
||||
element.style.backgroundRepeat = "no-repeat";
|
||||
element.style.backgroundSize = `${this.props.width}px ${
|
||||
this.props.height
|
||||
}px`;
|
||||
element.style.backgroundSize = `${this.props.width}px ${this.props.height}px`;
|
||||
|
||||
if (
|
||||
this.props.agentDisabled === true ||
|
||||
this.props.moduleDisabled === true
|
||||
) {
|
||||
element.style.opacity = "0.2";
|
||||
}
|
||||
|
||||
return element;
|
||||
}
|
||||
|
@ -85,8 +90,13 @@ export default class BarsGraph extends Item<BarsGraphProps> {
|
|||
protected updateDomElement(element: HTMLElement): void {
|
||||
element.style.backgroundImage = `url(${this.props.html})`;
|
||||
element.style.backgroundRepeat = "no-repeat";
|
||||
element.style.backgroundSize = `${this.props.width}px ${
|
||||
this.props.height
|
||||
}px`;
|
||||
element.style.backgroundSize = `${this.props.width}px ${this.props.height}px`;
|
||||
|
||||
if (
|
||||
this.props.agentDisabled === true ||
|
||||
this.props.moduleDisabled === true
|
||||
) {
|
||||
element.style.opacity = "0.2";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -231,7 +231,6 @@ class RangesInputGroup extends InputGroup<Partial<ColorCloudProps>> {
|
|||
const handleCreate = () => {
|
||||
if (isValid(state)) onCreate(state);
|
||||
state = initialState;
|
||||
console.log(state);
|
||||
rangesInputFromValue.value = `${state.fromValue || ""}`;
|
||||
rangesInputToValue.value = `${state.toValue || ""}`;
|
||||
rangesInputColor.value = `${state.color}`;
|
||||
|
@ -410,6 +409,13 @@ export default class ColorCloud extends Item<ColorCloudProps> {
|
|||
defs.append(radialGradient);
|
||||
svg.append(defs, circle);
|
||||
|
||||
if (
|
||||
this.props.agentDisabled === true ||
|
||||
this.props.moduleDisabled === true
|
||||
) {
|
||||
svg.setAttribute("opacity", "0.2");
|
||||
}
|
||||
|
||||
return svg;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,6 +56,13 @@ export default class DonutGraph extends Item<DonutGraphProps> {
|
|||
element.className = "donut-graph";
|
||||
element.innerHTML = this.props.html;
|
||||
|
||||
if (
|
||||
this.props.agentDisabled === true ||
|
||||
this.props.moduleDisabled === true
|
||||
) {
|
||||
element.style.opacity = "0.2";
|
||||
}
|
||||
|
||||
// Hack to execute the JS after the HTML is added to the DOM.
|
||||
const scripts = element.getElementsByTagName("script");
|
||||
for (let i = 0; i < scripts.length; i++) {
|
||||
|
|
|
@ -48,6 +48,13 @@ export default class EventsHistory extends Item<EventsHistoryProps> {
|
|||
element.className = "events-history";
|
||||
element.innerHTML = this.props.html;
|
||||
|
||||
if (
|
||||
this.props.agentDisabled === true ||
|
||||
this.props.moduleDisabled === true
|
||||
) {
|
||||
element.style.opacity = "0.2";
|
||||
}
|
||||
|
||||
// Hack to execute the JS after the HTML is added to the DOM.
|
||||
const scripts = element.getElementsByTagName("script");
|
||||
for (let i = 0; i < scripts.length; i++) {
|
||||
|
|
|
@ -97,6 +97,12 @@ export default class ModuleGraph extends Item<ModuleGraphProps> {
|
|||
|
||||
element.innerHTML = this.props.html;
|
||||
element.className = "module-graph";
|
||||
if (
|
||||
this.props.agentDisabled === true ||
|
||||
this.props.moduleDisabled === true
|
||||
) {
|
||||
element.style.opacity = "0.2";
|
||||
}
|
||||
|
||||
// Remove the overview graph.
|
||||
const legendP = element.getElementsByTagName("p");
|
||||
|
|
|
@ -261,6 +261,13 @@ export default class Percentile extends Item<PercentileProps> {
|
|||
break;
|
||||
}
|
||||
|
||||
if (
|
||||
this.props.agentDisabled === true ||
|
||||
this.props.moduleDisabled === true
|
||||
) {
|
||||
svg.setAttribute("opacity", "0.2");
|
||||
}
|
||||
|
||||
if (svg !== null) element.append(svg);
|
||||
|
||||
return element;
|
||||
|
|
|
@ -22,7 +22,8 @@ export type SimpleValueProps = {
|
|||
| {
|
||||
processValue: "avg" | "max" | "min";
|
||||
period: number;
|
||||
}) &
|
||||
}
|
||||
) &
|
||||
ItemProps &
|
||||
WithModuleProps &
|
||||
LinkedVisualConsoleProps;
|
||||
|
@ -95,6 +96,13 @@ export default class SimpleValue extends Item<SimpleValueProps> {
|
|||
const element = document.createElement("div");
|
||||
element.className = "simple-value";
|
||||
|
||||
if (
|
||||
this.props.agentDisabled === true ||
|
||||
this.props.moduleDisabled === true
|
||||
) {
|
||||
element.style.opacity = "0.2";
|
||||
}
|
||||
|
||||
if (this.props.valueType === "image") {
|
||||
const img = document.createElement("img");
|
||||
img.src = this.props.value;
|
||||
|
|
|
@ -78,6 +78,13 @@ export default class StaticGraph extends Item<StaticGraphProps> {
|
|||
element.style.backgroundSize = "contain";
|
||||
element.style.backgroundPosition = "center";
|
||||
|
||||
if (
|
||||
this.props.agentDisabled === true ||
|
||||
this.props.moduleDisabled === true
|
||||
) {
|
||||
element.style.opacity = "0.2";
|
||||
}
|
||||
|
||||
// Show last value in a tooltip.
|
||||
if (
|
||||
this.props.lastValue !== null &&
|
||||
|
|
|
@ -177,7 +177,8 @@ export function agentPropsDecoder(data: AnyObject): WithAgentProps {
|
|||
agentName: notEmptyStringOr(data.agentName, null),
|
||||
agentAlias: notEmptyStringOr(data.agentAlias, null),
|
||||
agentDescription: notEmptyStringOr(data.agentDescription, null),
|
||||
agentAddress: notEmptyStringOr(data.agentAddress, null)
|
||||
agentAddress: notEmptyStringOr(data.agentAddress, null),
|
||||
agentDisabled: parseBoolean(data.agentDisabled)
|
||||
};
|
||||
|
||||
return data.metaconsoleId != null
|
||||
|
@ -198,6 +199,7 @@ export function modulePropsDecoder(data: AnyObject): WithModuleProps {
|
|||
moduleId: parseIntOr(data.moduleId, null),
|
||||
moduleName: notEmptyStringOr(data.moduleName, null),
|
||||
moduleDescription: notEmptyStringOr(data.moduleDescription, null),
|
||||
moduleDisabled: parseBoolean(data.moduleDisabled),
|
||||
...agentPropsDecoder(data) // Object spread: http://es6-features.org/#SpreadOperator
|
||||
};
|
||||
}
|
||||
|
|
|
@ -23,12 +23,14 @@ export interface WithAgentProps {
|
|||
agentAlias: string | null;
|
||||
agentDescription: string | null;
|
||||
agentAddress: string | null;
|
||||
agentDisabled: boolean;
|
||||
}
|
||||
|
||||
export interface WithModuleProps extends WithAgentProps {
|
||||
moduleId: number | null;
|
||||
moduleName: string | null;
|
||||
moduleDescription: string | null;
|
||||
moduleDisabled: boolean;
|
||||
}
|
||||
|
||||
export type LinkedVisualConsolePropsStatus =
|
||||
|
|
Loading…
Reference in New Issue