Command center

This commit is contained in:
daniel 2021-03-24 11:43:51 +00:00 committed by Daniel Rodriguez
parent 00375710c2
commit 774fc9ebe5
18 changed files with 237 additions and 132 deletions

View File

@ -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 string|array $value String or array of strings to be cleaned.
* @param boolean $utf8 Flag, set the output encoding in utf8, by default true. * @param boolean $utf8 Flag, set the output encoding in utf8, by default true.
* *
* @return string * @return mixed
*/ */
function io_safe_output($value, $utf8=true) function io_safe_output($value, $utf8=true)
{ {

View File

@ -202,6 +202,42 @@ function load_modal(settings) {
if (Array.isArray(settings.form) === false) { if (Array.isArray(settings.form) === false) {
$("#" + settings.form + " :input").each(function() { $("#" + settings.form + " :input").each(function() {
if (this.checkValidity() === false) { if (this.checkValidity() === false) {
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).next();
setTimeout(
function(element) {
element.tooltip("destroy");
element.removeAttr("title");
},
3000,
element
);
} else {
$(this).attr("title", this.validationMessage); $(this).attr("title", this.validationMessage);
$(this).tooltip({ $(this).tooltip({
tooltipClass: "uitooltip", tooltipClass: "uitooltip",
@ -229,6 +265,7 @@ function load_modal(settings) {
3000, 3000,
element element
); );
}
flagError = true; flagError = true;
} }

View File

@ -283,7 +283,6 @@ class ModuleTableValueWidget extends Widget
'label' => __('Module'), 'label' => __('Module'),
'arguments' => [ 'arguments' => [
'type' => 'autocomplete_module', 'type' => 'autocomplete_module',
'fields' => $fields,
'name' => 'moduleId', 'name' => 'moduleId',
'selected' => $values['moduleId'], 'selected' => $values['moduleId'],
'return' => true, 'return' => true,
@ -291,7 +290,9 @@ class ModuleTableValueWidget extends Widget
'agent_id' => $values['agentId'], 'agent_id' => $values['agentId'],
'metaconsole_id' => $values['metaconsoleId'], 'metaconsole_id' => $values['metaconsoleId'],
'style' => 'width: inherit;', '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 = [ $fields = [
'&lt;br&gt;' => __('Carriage Return'), '&#x0a;' => __('Carriage Return'),
'|' => __('Vertical Bar'), '|' => __('Vertical Bar'),
';' => __('Semicolon'), ';' => __('Semicolon'),
':' => __('Colon'), ':' => __('Colon'),
',' => __('Commas'), ',' => __('Commas'),
'&nbsp;' => __('Blank'), '&#x20;' => __('Blank'),
]; ];
$inputs[] = [ $inputs[] = [
@ -358,11 +359,7 @@ class ModuleTableValueWidget extends Widget
*/ */
public function load() public function load()
{ {
global $config;
$output = ''; $output = '';
$id_agent = $this->values['agentId'];
$id_group = \agents_get_agent_group($id_agent);
$id_module = $this->values['moduleId']; $id_module = $this->values['moduleId'];
$size_text = $this->values['sizeLabel']; $size_text = $this->values['sizeLabel'];
@ -370,33 +367,11 @@ class ModuleTableValueWidget extends Widget
$data_module = modules_get_last_value($id_module); $data_module = modules_get_last_value($id_module);
$value = (string) $data_module; $value = (string) $data_module;
$array_values = explode('&#x0a;', io_safe_input($value)); $value = str_replace(
io_safe_output($this->values['separator']),
if (isset($array_values) === true && is_array($array_values) === true) { '<br/>',
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 $value
); );
} else {
$value = preg_replace(
'/\n/i',
io_safe_output(
$this->values['separator']
),
io_safe_output($value)
);
$value = preg_replace('/\s/i', '&nbsp;', $value);
}
$output .= '<div class="container-center">'; $output .= '<div class="container-center">';
$output .= '<div class="container-icon">'; $output .= '<div class="container-icon">';

View File

@ -274,12 +274,16 @@ class SystemGroupStatusWidget extends Widget
if ($values['groupId']) { if ($values['groupId']) {
$selected_groups = explode(',', $values['groupId'][0]); $selected_groups = explode(',', $values['groupId'][0]);
if (users_can_manage_group_all('RM') || ($selected_groups[0] !== '' && in_array(0, $selected_groups) === true)) { if (users_can_manage_group_all('RM') === true
// Return all group if user has permissions or it is a currently selected group. || ($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; $return_all_group = true;
} }
} else { } else {
if (users_can_manage_group_all('RM')) { if (users_can_manage_group_all('RM') === true) {
$return_all_group = true; $return_all_group = true;
} }
} }
@ -365,7 +369,7 @@ class SystemGroupStatusWidget extends Widget
$return_all_group = false; $return_all_group = false;
if (users_can_manage_group_all('AR')) { if (users_can_manage_group_all('AR') === true) {
$return_all_group = true; $return_all_group = true;
} }
@ -374,16 +378,18 @@ class SystemGroupStatusWidget extends Widget
$selected_groups = explode(',', $this->values['groupId'][0]); $selected_groups = explode(',', $this->values['groupId'][0]);
if ($selected_groups[0] === '') { if ($selected_groups[0] === '') {
return; return false;
} }
$all_counters = []; $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 = db_get_all_rows_sql('select id_grupo from tgrupo');
$all_groups_id = array_column($all_groups, 'id_grupo'); $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['g'] = 0;
$all_counters['name'] = __('All'); $all_counters['name'] = __('All');
@ -512,7 +518,7 @@ class SystemGroupStatusWidget extends Widget
$outputLine .= '<a title="'.__('Modules in normal status'); $outputLine .= '<a title="'.__('Modules in normal status');
$outputLine .= '" class="group_view_data"'; $outputLine .= '" class="group_view_data"';
$outputLine .= ' style="'.$style.'"'; $outputLine .= ' style="'.$style.'"';
$outputLine .= $show_link === true ? '" href="'.$url : ''; $outputLine .= ($show_link === true) ? '" href="'.$url : '';
$outputLine .= '&status='.AGENT_STATUS_NORMAL.'">'; $outputLine .= '&status='.AGENT_STATUS_NORMAL.'">';
$outputLine .= $group['total_module_normal']; $outputLine .= $group['total_module_normal'];
$outputLine .= '</a>'; $outputLine .= '</a>';
@ -528,7 +534,7 @@ class SystemGroupStatusWidget extends Widget
$outputLine .= '<a title="'.__('Modules in warning status'); $outputLine .= '<a title="'.__('Modules in warning status');
$outputLine .= '" class="group_view_data"'; $outputLine .= '" class="group_view_data"';
$outputLine .= ' style="'.$style.'"'; $outputLine .= ' style="'.$style.'"';
$outputLine .= $show_link === true ? '" href="'.$url : ''; $outputLine .= ($show_link === true) ? '" href="'.$url : '';
$outputLine .= '&status='.AGENT_STATUS_WARNING.'">'; $outputLine .= '&status='.AGENT_STATUS_WARNING.'">';
$outputLine .= $group['total_module_warning']; $outputLine .= $group['total_module_warning'];
$outputLine .= '</a>'; $outputLine .= '</a>';
@ -545,7 +551,7 @@ class SystemGroupStatusWidget extends Widget
$outputLine .= __('Modules in critical status'); $outputLine .= __('Modules in critical status');
$outputLine .= '" class="group_view_data"'; $outputLine .= '" class="group_view_data"';
$outputLine .= ' style="'.$style.'"'; $outputLine .= ' style="'.$style.'"';
$outputLine .= $show_link === true ? '" href="'.$url : ''; $outputLine .= ($show_link === true) ? '" href="'.$url : '';
$outputLine .= '&status='.AGENT_STATUS_CRITICAL.'">'; $outputLine .= '&status='.AGENT_STATUS_CRITICAL.'">';
$outputLine .= $group['total_module_critical']; $outputLine .= $group['total_module_critical'];
$outputLine .= '</a>'; $outputLine .= '</a>';
@ -556,12 +562,17 @@ class SystemGroupStatusWidget extends Widget
} }
if ($show_alert_fired === true) { 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 = '<div class="bg_ff9">';
$outputLine .= '<span>'; $outputLine .= '<span>';
$outputLine .= '<a title="'.__('Alerts fired'); $outputLine .= '<a title="'.__('Alerts fired');
$outputLine .= '" class="group_view_data"'; $outputLine .= '" class="group_view_data"';
$outputLine .= ' style="'.$style.'"'; $outputLine .= ' style="'.$style.'"';
$outputLine .= $show_link === true ? '" href="'.$url : ''; $outputLine .= ($show_link === true) ? '" href="'.$url_alert : '';
$outputLine .= '&filter=fired">'; $outputLine .= '&filter=fired">';
$outputLine .= $group['total_module_alerts']; $outputLine .= $group['total_module_alerts'];
$outputLine .= '</a>'; $outputLine .= '</a>';

View File

@ -284,12 +284,15 @@ class TopNEventByGroupWidget extends Widget
if ($values['groupId']) { if ($values['groupId']) {
$selected_groups = explode(',', $values['groupId'][0]); $selected_groups = explode(',', $values['groupId'][0]);
if (users_can_manage_group_all('RM') || in_array(0, $selected_groups) === true) { if (users_can_manage_group_all('RM') === true
// Return all group if user has permissions or it is a currently selected group. || in_array(0, $selected_groups) === true
) {
// Return all group if user has permissions
// or it is a currently selected group.
$return_all_group = true; $return_all_group = true;
} }
} else { } else {
if (users_can_manage_group_all('RM')) { if (users_can_manage_group_all('RM') === true) {
$return_all_group = true; $return_all_group = true;
} }
} }
@ -301,10 +304,11 @@ class TopNEventByGroupWidget extends Widget
'name' => 'groupId[]', 'name' => 'groupId[]',
'returnAllGroup' => true, 'returnAllGroup' => true,
'privilege' => 'AR', 'privilege' => 'AR',
'selected' => $selected_groups, 'selected' => (empty($selected_groups) === true) ? [0] : $selected_groups,
'return' => true, 'return' => true,
'multiple' => true, 'multiple' => true,
'returnAllGroup' => $return_all_group, 'returnAllGroup' => $return_all_group,
'required' => true,
], ],
]; ];

View File

@ -283,12 +283,15 @@ class TopNEventByModuleWidget extends Widget
if ($values['groupId']) { if ($values['groupId']) {
$selected_groups = explode(',', $values['groupId'][0]); $selected_groups = explode(',', $values['groupId'][0]);
if (users_can_manage_group_all('RM') || in_array(0, $selected_groups) === true) { if (users_can_manage_group_all('RM') === true
// Return all group if user has permissions or it is a currently selected group. || in_array(0, $selected_groups) === true
) {
// Return all group if user has permissions
// or it is a currently selected group.
$return_all_group = true; $return_all_group = true;
} }
} else { } else {
if (users_can_manage_group_all('RM')) { if (users_can_manage_group_all('RM') === true) {
$return_all_group = true; $return_all_group = true;
} }
} }
@ -301,10 +304,11 @@ class TopNEventByModuleWidget extends Widget
'name' => 'groupId[]', 'name' => 'groupId[]',
'returnAllGroup' => true, 'returnAllGroup' => true,
'privilege' => 'AR', 'privilege' => 'AR',
'selected' => $selected_groups, 'selected' => (empty($selected_groups) === true) ? [0] : $selected_groups,
'return' => true, 'return' => true,
'multiple' => true, 'multiple' => true,
'returnAllGroup' => $return_all_group, 'returnAllGroup' => $return_all_group,
'required' => true,
], ],
]; ];
@ -362,7 +366,7 @@ class TopNEventByModuleWidget extends Widget
$this->values['groupId'] = explode(',', $this->values['groupId'][0]); $this->values['groupId'] = explode(',', $this->values['groupId'][0]);
if (empty($this->values['groupId']) === true) { if (empty($this->values['groupId']) === true) {
$output .= '<div class="container-center">'; $output = '<div class="container-center">';
$output .= \ui_print_info_message( $output .= \ui_print_info_message(
__('Please select one or more groups.'), __('Please select one or more groups.'),
'', '',
@ -414,7 +418,7 @@ class TopNEventByModuleWidget extends Widget
$result = db_get_all_rows_sql($sql); $result = db_get_all_rows_sql($sql);
if (empty($result) === true) { if (empty($result) === true) {
$output .= '<div class="container-center">'; $output = '<div class="container-center">';
$output .= \ui_print_error_message( $output .= \ui_print_error_message(
__('There is not data to show.'), __('There is not data to show.'),
'', '',
@ -503,7 +507,7 @@ class TopNEventByModuleWidget extends Widget
break; break;
} }
$output .= pie_graph( $output = pie_graph(
$data_pie, $data_pie,
$width, $width,
$height, $height,

View File

@ -587,6 +587,33 @@ class TreeViewWidget extends Widget
true 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 = [ $settings = [
'page' => 'include/ajax/tree.ajax', 'page' => 'include/ajax/tree.ajax',
'id_user' => $config['id_user'], 'id_user' => $config['id_user'],
@ -607,7 +634,7 @@ class TreeViewWidget extends Widget
'userLanguage' => get_user_language(), 'userLanguage' => get_user_language(),
'translate' => [ 'translate' => [
'emptyMessage' => __('No data found'), 'emptyMessage' => __('No data found'),
'foundMessage' => 'not', 'foundMessage' => $foundMessage,
'total' => [ 'total' => [
'agents' => __('Total agents'), 'agents' => __('Total agents'),
'modules' => __('Total modules'), 'modules' => __('Total modules'),

View File

@ -756,6 +756,7 @@ class Item extends CachedModel
* Fetch a vc item data structure from the database using a filter. * 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 $ratio Ratio resize view.
* *
* @return array The Visual Console Item data structure stored into the DB. * @return array The Visual Console Item data structure stored into the DB.
* @throws \Exception When the data cannot be retrieved from the DB. * @throws \Exception When the data cannot be retrieved from the DB.
@ -913,7 +914,6 @@ class Item extends CachedModel
* @return array The agent data structure stored into the DB. * @return array The agent data structure stored into the DB.
* *
* @throws \InvalidArgumentException When the input agent Id is invalid. * @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 protected static function fetchAgentDataFromDB(array $itemData): array
{ {
@ -930,7 +930,6 @@ class Item extends CachedModel
$agentId = static::extractAgentId($itemData); $agentId = static::extractAgentId($itemData);
if ($agentId === null) { if ($agentId === null) {
$agentId = 0; $agentId = 0;
// throw new \InvalidArgumentException('invalid agent Id');
} }
// Staticgraph don't need to have an agent. // Staticgraph don't need to have an agent.
@ -938,13 +937,13 @@ class Item extends CachedModel
return $agentData; return $agentData;
} }
if (\is_metaconsole() && $metaconsoleId === null) { if (\is_metaconsole() === true && $metaconsoleId === null) {
throw new \InvalidArgumentException('missing metaconsole node Id'); throw new \InvalidArgumentException('missing metaconsole node Id');
} }
$agent = false; $agent = false;
if (\is_metaconsole()) { if (\is_metaconsole() === true) {
$sql = sprintf( $sql = sprintf(
'SELECT nombre, alias, direccion, comentarios, `disabled` 'SELECT nombre, alias, direccion, comentarios, `disabled`
FROM tmetaconsole_agent FROM tmetaconsole_agent
@ -964,8 +963,8 @@ class Item extends CachedModel
$agent = \db_get_row_sql($sql); $agent = \db_get_row_sql($sql);
if ($agent === false) { if ($agent === false) {
$agentData['agentDisabled'] = true;
return $agentData; return $agentData;
// throw new \Exception('error fetching the data from the DB');
} }
// The agent name should be a valid string or a null value. // The agent name should be a valid string or a null value.
@ -987,7 +986,6 @@ class Item extends CachedModel
* *
* @return array The module data structure stored into the DB. * @return array The module data structure stored into the DB.
* @throws \InvalidArgumentException When the input module Id is invalid. * @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 protected static function fetchModuleDataFromDB(array $itemData): array
{ {
@ -996,7 +994,7 @@ class Item extends CachedModel
include_once $config['homedir'].'/include/functions_io.php'; include_once $config['homedir'].'/include/functions_io.php';
// Load side libraries. // Load side libraries.
if (\is_metaconsole()) { if (\is_metaconsole() === true) {
\enterprise_include_once('include/functions_metaconsole.php'); \enterprise_include_once('include/functions_metaconsole.php');
} }
@ -1007,7 +1005,6 @@ class Item extends CachedModel
$moduleId = static::extractModuleId($itemData); $moduleId = static::extractModuleId($itemData);
if ($moduleId === null) { if ($moduleId === null) {
$moduleId = 0; $moduleId = 0;
// throw new \InvalidArgumentException('invalid module Id');
} }
// Staticgraph don't need to have a module. // Staticgraph don't need to have a module.
@ -1018,14 +1015,14 @@ class Item extends CachedModel
// We should add the metaconsole Id if we can. // We should add the metaconsole Id if we can.
$metaconsoleId = static::extractMetaconsoleId($itemData); $metaconsoleId = static::extractMetaconsoleId($itemData);
if (\is_metaconsole() && $metaconsoleId === null) { if (\is_metaconsole() === true && $metaconsoleId === null) {
throw new \InvalidArgumentException('missing metaconsole node Id'); throw new \InvalidArgumentException('missing metaconsole node Id');
} }
$moduleName = false; $moduleName = false;
// Connect to node. // Connect to node.
if (\is_metaconsole() if (\is_metaconsole() === true
&& \metaconsole_connect(null, $metaconsoleId) !== NOERR && \metaconsole_connect(null, $metaconsoleId) !== NOERR
) { ) {
throw new \InvalidArgumentException( throw new \InvalidArgumentException(
@ -1043,13 +1040,13 @@ class Item extends CachedModel
$moduleName = \db_get_row_sql($sql); $moduleName = \db_get_row_sql($sql);
// Restore connection. // Restore connection.
if (\is_metaconsole()) { if (\is_metaconsole() === true) {
\metaconsole_restore_db(); \metaconsole_restore_db();
} }
if ($moduleName === false) { if ($moduleName === false) {
$agentData['moduleDisabled'] = true;
return $moduleData; return $moduleData;
// throw new \Exception('error fetching the data from the DB');
} }
$moduleData['moduleName'] = $moduleName['nombre']; $moduleData['moduleName'] = $moduleName['nombre'];
@ -1074,7 +1071,7 @@ class Item extends CachedModel
// Load side libraries. // Load side libraries.
include_once $config['homedir'].'/include/functions_ui.php'; 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('include/functions_metaconsole.php');
\enterprise_include_once('meta/include/functions_ui_meta.php'); \enterprise_include_once('meta/include/functions_ui_meta.php');
} }
@ -1091,7 +1088,6 @@ class Item extends CachedModel
return null; return null;
} }
// TODO: There's a feature to get the link from the label.
if (static::$useLinkedVisualConsole === true if (static::$useLinkedVisualConsole === true
&& $linkedVisualConsole['linkedLayoutId'] !== null && $linkedVisualConsole['linkedLayoutId'] !== null
&& $linkedVisualConsole['linkedLayoutId'] > 0 && $linkedVisualConsole['linkedLayoutId'] > 0
@ -1114,7 +1110,9 @@ class Item extends CachedModel
return null; return null;
} }
if (empty($linkedLayoutNodeId) === true && \is_metaconsole()) { if (empty($linkedLayoutNodeId) === true
&& \is_metaconsole() === true
) {
/* /*
* A Visual Console from this console. * A Visual Console from this console.
* We are in a metaconsole. * We are in a metaconsole.
@ -1130,7 +1128,7 @@ class Item extends CachedModel
] ]
); );
} else if (empty($linkedLayoutNodeId) === true } else if (empty($linkedLayoutNodeId) === true
&& !\is_metaconsole() && \is_metaconsole() === false
) { ) {
/* /*
* A Visual Console from this console. * A Visual Console from this console.
@ -1145,7 +1143,9 @@ class Item extends CachedModel
'pure' => (int) $config['pure'], '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. * A Visual Console from a meta node.
* We are in a metaconsole. * We are in a metaconsole.
@ -1156,7 +1156,6 @@ class Item extends CachedModel
$linkedLayoutNodeId $linkedLayoutNodeId
); );
// TODO: Link to a public view.
return \ui_meta_get_node_url( return \ui_meta_get_node_url(
$node, $node,
'network', 'network',
@ -1179,7 +1178,9 @@ class Item extends CachedModel
// The module can be from another node. // The module can be from another node.
$metaconsoleId = $linkedModule['metaconsoleId']; $metaconsoleId = $linkedModule['metaconsoleId'];
if (empty($metaconsoleId) === true) { if (is_metaconsole() === false
|| empty($metaconsoleId) === true
) {
/* /*
* A module from this console. * A module from this console.
*/ */
@ -1211,7 +1212,9 @@ class Item extends CachedModel
} }
return $baseUrl.'?'.http_build_query($queryParams); 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. * A module from a meta node.
* We are in a metaconsole. * We are in a metaconsole.
@ -1279,7 +1282,9 @@ class Item extends CachedModel
// The agent can be from another node. // The agent can be from another node.
$metaconsoleId = $linkedAgent['metaconsoleId']; $metaconsoleId = $linkedAgent['metaconsoleId'];
if (empty($metaconsoleId) === true) { if (is_metaconsole() === false
|| empty($metaconsoleId) === true
) {
/* /*
* An agent from this console. * An agent from this console.
* We are in a regular console. * We are in a regular console.
@ -1292,7 +1297,9 @@ class Item extends CachedModel
'id_agente' => $agentId, '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. * An agent from a meta node.
* We are in a metaconsole. * We are in a metaconsole.
@ -1306,7 +1313,7 @@ class Item extends CachedModel
$node, $node,
'estado', 'estado',
'operation/agentes/ver_agente', 'operation/agentes/ver_agente',
['id_agente' => $moduleId], ['id_agente' => $agentId],
// No autologin from the public view. // No autologin from the public view.
!$config['public_view'] !$config['public_view']
); );
@ -1439,6 +1446,7 @@ class Item extends CachedModel
'enableLink', 'enableLink',
] ]
); );
if ($enable_link !== null) { if ($enable_link !== null) {
$result['enable_link'] = static::parseBool($enable_link); $result['enable_link'] = static::parseBool($enable_link);
} }
@ -1481,11 +1489,6 @@ class Item extends CachedModel
$result['linked_layout_node_id'] = $linked_layout_node_id; $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( $linked_layout_status_type = static::notEmptyStringOr(
static::issetInArray( static::issetInArray(
$data, $data,
@ -1784,7 +1787,7 @@ class Item extends CachedModel
$item = static::fromDB(['id' => $save['id']]); $item = static::fromDB(['id' => $save['id']]);
// Update the model. // Update the model.
if (!empty($item)) { if (empty($item) === false) {
$this->setData($item->toArray()); $this->setData($item->toArray());
} }
} }

View File

@ -390,7 +390,6 @@ table.group_modules_status_box tr td > span {
} }
table.group_modules_status_box tr td div { table.group_modules_status_box tr td div {
background-color: #82b92e;
width: 90%; width: 90%;
padding: 3px; padding: 3px;
text-align: center; text-align: center;
@ -534,3 +533,13 @@ div#main_pure {
#select_multiple_modules_filtered > div > div > * { #select_multiple_modules_filtered > div > div > * {
flex: auto; 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;
}

View File

@ -2713,6 +2713,10 @@ span#plugin_description {
background-color: #ededed; background-color: #ededed;
} }
.tinyMCEBody span strong {
font-family: inherit;
}
.visual_font_size_4pt, .visual_font_size_4pt,
.visual_font_size_4pt > em, .visual_font_size_4pt > em,
.visual_font_size_4pt > strong, .visual_font_size_4pt > strong,
@ -2724,6 +2728,7 @@ span#plugin_description {
.visual_font_size_4pt span em { .visual_font_size_4pt span em {
font-size: 4pt; font-size: 4pt;
line-height: 4pt; line-height: 4pt;
font-family: inherit;
} }
.visual_font_size_6pt, .visual_font_size_6pt,
.visual_font_size_6pt > em, .visual_font_size_6pt > em,
@ -2736,6 +2741,7 @@ span#plugin_description {
.visual_font_size_6pt span em { .visual_font_size_6pt span em {
font-size: 6pt; font-size: 6pt;
line-height: 6pt; line-height: 6pt;
font-family: inherit;
} }
.visual_font_size_8pt, .visual_font_size_8pt,
.visual_font_size_8pt > em, .visual_font_size_8pt > em,
@ -2748,6 +2754,7 @@ span#plugin_description {
.visual_font_size_8pt span em { .visual_font_size_8pt span em {
font-size: 8pt; font-size: 8pt;
line-height: 8pt; line-height: 8pt;
font-family: inherit;
} }
.visual_font_size_10pt, .visual_font_size_10pt,
.visual_font_size_10pt > em, .visual_font_size_10pt > em,
@ -2760,6 +2767,7 @@ span#plugin_description {
.visual_font_size_10pt span em { .visual_font_size_10pt span em {
font-size: 10pt; font-size: 10pt;
line-height: 10pt; line-height: 10pt;
font-family: inherit;
} }
.visual_font_size_12pt, .visual_font_size_12pt,
.visual_font_size_12pt > em, .visual_font_size_12pt > em,
@ -2772,6 +2780,7 @@ span#plugin_description {
.visual_font_size_12pt span em { .visual_font_size_12pt span em {
font-size: 12pt; font-size: 12pt;
line-height: 12pt; line-height: 12pt;
font-family: inherit;
} }
.visual_font_size_14pt, .visual_font_size_14pt,
.visual_font_size_14pt > em, .visual_font_size_14pt > em,
@ -2784,6 +2793,7 @@ span#plugin_description {
.visual_font_size_14pt span em { .visual_font_size_14pt span em {
font-size: 14pt; font-size: 14pt;
line-height: 14pt; line-height: 14pt;
font-family: inherit;
} }
.visual_font_size_18pt, .visual_font_size_18pt,
.visual_font_size_18pt > em, .visual_font_size_18pt > em,
@ -2796,6 +2806,7 @@ span#plugin_description {
.visual_font_size_18pt span em { .visual_font_size_18pt span em {
font-size: 18pt; font-size: 18pt;
line-height: 18pt; line-height: 18pt;
font-family: inherit;
} }
.visual_font_size_24pt, .visual_font_size_24pt,
@ -2809,6 +2820,7 @@ span#plugin_description {
.visual_font_size_24pt span em { .visual_font_size_24pt span em {
font-size: 24pt; font-size: 24pt;
line-height: 24pt; line-height: 24pt;
font-family: inherit;
} }
.visual_font_size_28pt, .visual_font_size_28pt,
.visual_font_size_28pt > em, .visual_font_size_28pt > em,
@ -2821,6 +2833,7 @@ span#plugin_description {
.visual_font_size_28pt span em { .visual_font_size_28pt span em {
font-size: 28pt; font-size: 28pt;
line-height: 28pt; line-height: 28pt;
font-family: inherit;
} }
.visual_font_size_36pt, .visual_font_size_36pt,
.visual_font_size_36pt > em, .visual_font_size_36pt > em,
@ -2833,6 +2846,7 @@ span#plugin_description {
.visual_font_size_36pt span em { .visual_font_size_36pt span em {
font-size: 36pt; font-size: 36pt;
line-height: 36pt; line-height: 36pt;
font-family: inherit;
} }
.visual_font_size_48pt, .visual_font_size_48pt,
.visual_font_size_48pt > em, .visual_font_size_48pt > em,
@ -2845,6 +2859,7 @@ span#plugin_description {
.visual_font_size_48pt span em { .visual_font_size_48pt span em {
font-size: 48pt; font-size: 48pt;
line-height: 48pt; line-height: 48pt;
font-family: inherit;
} }
.visual_font_size_60pt, .visual_font_size_60pt,
.visual_font_size_60pt > em, .visual_font_size_60pt > em,
@ -2857,6 +2872,7 @@ span#plugin_description {
.visual_font_size_60pt span em { .visual_font_size_60pt span em {
font-size: 60pt; font-size: 60pt;
line-height: 60pt; line-height: 60pt;
font-family: inherit;
} }
.visual_font_size_72pt, .visual_font_size_72pt,
.visual_font_size_72pt > em, .visual_font_size_72pt > em,
@ -2869,6 +2885,7 @@ span#plugin_description {
.visual_font_size_72pt span em { .visual_font_size_72pt span em {
font-size: 72pt; font-size: 72pt;
line-height: 72pt; line-height: 72pt;
font-family: inherit;
} }
.visual_font_size_84pt, .visual_font_size_84pt,
@ -2882,6 +2899,7 @@ span#plugin_description {
.visual_font_size_84pt span em { .visual_font_size_84pt span em {
font-size: 84pt; font-size: 84pt;
line-height: 84pt; line-height: 84pt;
font-family: inherit;
} }
.visual_font_size_96pt, .visual_font_size_96pt,
@ -2895,6 +2913,7 @@ span#plugin_description {
.visual_font_size_96pt span em { .visual_font_size_96pt span em {
font-size: 96pt; font-size: 96pt;
line-height: 96pt; line-height: 96pt;
font-family: inherit;
} }
.visual_font_size_116pt, .visual_font_size_116pt,
@ -2908,6 +2927,7 @@ span#plugin_description {
.visual_font_size_116pt span em { .visual_font_size_116pt span em {
font-size: 116pt; font-size: 116pt;
line-height: 116pt; line-height: 116pt;
font-family: inherit;
} }
.visual_font_size_128pt, .visual_font_size_128pt,
@ -2921,6 +2941,7 @@ span#plugin_description {
.visual_font_size_128pt span em { .visual_font_size_128pt span em {
font-size: 128pt; font-size: 128pt;
line-height: 128pt; line-height: 128pt;
font-family: inherit;
} }
.visual_font_size_140pt, .visual_font_size_140pt,
@ -2934,6 +2955,7 @@ span#plugin_description {
.visual_font_size_140pt span em { .visual_font_size_140pt span em {
font-size: 140pt; font-size: 140pt;
line-height: 140pt; line-height: 140pt;
font-family: inherit;
} }
.visual_font_size_154pt, .visual_font_size_154pt,
@ -2947,6 +2969,7 @@ span#plugin_description {
.visual_font_size_154pt span em { .visual_font_size_154pt span em {
font-size: 154pt; font-size: 154pt;
line-height: 154pt; line-height: 154pt;
font-family: inherit;
} }
.visual_font_size_196pt, .visual_font_size_196pt,
@ -2960,6 +2983,7 @@ span#plugin_description {
.visual_font_size_196pt span em { .visual_font_size_196pt span em {
font-size: 196pt; font-size: 196pt;
line-height: 196pt; line-height: 196pt;
font-family: inherit;
} }
.resize_visual_font_size_8pt, .resize_visual_font_size_8pt,

View File

@ -4,6 +4,11 @@
* --------------------------------------------------------------------- * ---------------------------------------------------------------------
*/ */
div.external-visual-console-container {
width: 100%;
overflow-x: auto;
}
div#vc-controls { div#vc-controls {
position: fixed; position: fixed;
top: 30px; top: 30px;
@ -414,6 +419,16 @@ div#cont {
overflow-x: hidden; overflow-x: hidden;
} }
div.label strong {
color: inherit;
font-family: inherit;
}
div.label strong span {
color: inherit;
font-family: inherit;
}
/*.termframe{ /*.termframe{
background-color: #82b92e; 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

View File

@ -28,7 +28,6 @@ if (file_exists(ENTERPRISE_DIR.'/include/functions_login.php')) {
require_once $config['homedir'].'/vendor/autoload.php'; require_once $config['homedir'].'/vendor/autoload.php';
ui_require_css_file('visual_maps');
ui_require_css_file('register', 'include/styles/', true); ui_require_css_file('register', 'include/styles/', true);
// Connection lost alert. // Connection lost alert.

View File

@ -376,7 +376,9 @@ if ($pure === false) {
} }
} }
echo '<div class="external-visual-console-container">';
echo '<div id="visual-console-container"></div>'; echo '<div id="visual-console-container"></div>';
echo '</div>';
if ($pure === true) { if ($pure === true) {
// Floating menu - Start. // Floating menu - Start.

View File

@ -210,9 +210,6 @@ if (empty($dashboards) === true) {
if ($writeDashboards === 1) { if ($writeDashboards === 1) {
$text = __('Create a new dashboard'); $text = __('Create a new dashboard');
if ($dashboard !== null) {
$text = __('Update Dashboard');
}
// Button for display modal options dashboard. // Button for display modal options dashboard.
$output = '<a href="#" class="float-right" onclick=\''; $output = '<a href="#" class="float-right" onclick=\'';

View File

@ -797,7 +797,6 @@ export default class VisualConsole {
public render(prevProps: VisualConsoleProps | null = null): void { public render(prevProps: VisualConsoleProps | null = null): void {
if (prevProps) { if (prevProps) {
if (prevProps.backgroundURL !== this.props.backgroundURL) { if (prevProps.backgroundURL !== this.props.backgroundURL) {
if (this.props.backgroundURL)
this.containerRef.style.backgroundImage = this.containerRef.style.backgroundImage =
this.props.backgroundURL !== null this.props.backgroundURL !== null
? `url(${this.props.backgroundURL})` ? `url(${this.props.backgroundURL})`

View File

@ -231,7 +231,6 @@ class RangesInputGroup extends InputGroup<Partial<ColorCloudProps>> {
const handleCreate = () => { const handleCreate = () => {
if (isValid(state)) onCreate(state); if (isValid(state)) onCreate(state);
state = initialState; state = initialState;
console.log(state);
rangesInputFromValue.value = `${state.fromValue || ""}`; rangesInputFromValue.value = `${state.fromValue || ""}`;
rangesInputToValue.value = `${state.toValue || ""}`; rangesInputToValue.value = `${state.toValue || ""}`;
rangesInputColor.value = `${state.color}`; rangesInputColor.value = `${state.color}`;