Merge branch 'ent-7112-bugs-consola-visual-y-dashboards' into 'develop'
Command center See merge request artica/pandorafms!3887
This commit is contained in:
commit
ce2f4ec7cc
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -756,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.
|
||||
|
@ -913,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
|
||||
{
|
||||
|
@ -930,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.
|
||||
|
@ -938,13 +937,13 @@ 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, `disabled`
|
||||
FROM tmetaconsole_agent
|
||||
|
@ -964,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.
|
||||
|
@ -987,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
|
||||
{
|
||||
|
@ -996,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');
|
||||
}
|
||||
|
||||
|
@ -1007,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.
|
||||
|
@ -1018,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(
|
||||
|
@ -1043,13 +1040,13 @@ 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'];
|
||||
|
@ -1074,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');
|
||||
}
|
||||
|
@ -1091,7 +1088,6 @@ class Item extends CachedModel
|
|||
return null;
|
||||
}
|
||||
|
||||
// TODO: There's a feature to get the link from the label.
|
||||
if (static::$useLinkedVisualConsole === true
|
||||
&& $linkedVisualConsole['linkedLayoutId'] !== null
|
||||
&& $linkedVisualConsole['linkedLayoutId'] > 0
|
||||
|
@ -1114,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.
|
||||
|
@ -1130,7 +1128,7 @@ class Item extends CachedModel
|
|||
]
|
||||
);
|
||||
} else if (empty($linkedLayoutNodeId) === true
|
||||
&& !\is_metaconsole()
|
||||
&& \is_metaconsole() === false
|
||||
) {
|
||||
/*
|
||||
* A Visual Console from this console.
|
||||
|
@ -1145,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.
|
||||
|
@ -1156,7 +1156,6 @@ class Item extends CachedModel
|
|||
$linkedLayoutNodeId
|
||||
);
|
||||
|
||||
// TODO: Link to a public view.
|
||||
return \ui_meta_get_node_url(
|
||||
$node,
|
||||
'network',
|
||||
|
@ -1179,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.
|
||||
*/
|
||||
|
@ -1211,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.
|
||||
|
@ -1279,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.
|
||||
|
@ -1292,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.
|
||||
|
@ -1306,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']
|
||||
);
|
||||
|
@ -1439,6 +1446,7 @@ class Item extends CachedModel
|
|||
'enableLink',
|
||||
]
|
||||
);
|
||||
|
||||
if ($enable_link !== null) {
|
||||
$result['enable_link'] = static::parseBool($enable_link);
|
||||
}
|
||||
|
@ -1481,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,
|
||||
|
@ -1784,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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -2713,6 +2713,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,
|
||||
|
@ -2724,6 +2728,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,
|
||||
|
@ -2736,6 +2741,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,
|
||||
|
@ -2748,6 +2754,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,
|
||||
|
@ -2760,6 +2767,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,
|
||||
|
@ -2772,6 +2780,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,
|
||||
|
@ -2784,6 +2793,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,
|
||||
|
@ -2796,6 +2806,7 @@ span#plugin_description {
|
|||
.visual_font_size_18pt span em {
|
||||
font-size: 18pt;
|
||||
line-height: 18pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_24pt,
|
||||
|
@ -2809,6 +2820,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,
|
||||
|
@ -2821,6 +2833,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,
|
||||
|
@ -2833,6 +2846,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,
|
||||
|
@ -2845,6 +2859,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,
|
||||
|
@ -2857,6 +2872,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,
|
||||
|
@ -2869,6 +2885,7 @@ span#plugin_description {
|
|||
.visual_font_size_72pt span em {
|
||||
font-size: 72pt;
|
||||
line-height: 72pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_84pt,
|
||||
|
@ -2882,6 +2899,7 @@ span#plugin_description {
|
|||
.visual_font_size_84pt span em {
|
||||
font-size: 84pt;
|
||||
line-height: 84pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_96pt,
|
||||
|
@ -2895,6 +2913,7 @@ span#plugin_description {
|
|||
.visual_font_size_96pt span em {
|
||||
font-size: 96pt;
|
||||
line-height: 96pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_116pt,
|
||||
|
@ -2908,6 +2927,7 @@ span#plugin_description {
|
|||
.visual_font_size_116pt span em {
|
||||
font-size: 116pt;
|
||||
line-height: 116pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_128pt,
|
||||
|
@ -2921,6 +2941,7 @@ span#plugin_description {
|
|||
.visual_font_size_128pt span em {
|
||||
font-size: 128pt;
|
||||
line-height: 128pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_140pt,
|
||||
|
@ -2934,6 +2955,7 @@ span#plugin_description {
|
|||
.visual_font_size_140pt span em {
|
||||
font-size: 140pt;
|
||||
line-height: 140pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_154pt,
|
||||
|
@ -2947,6 +2969,7 @@ span#plugin_description {
|
|||
.visual_font_size_154pt span em {
|
||||
font-size: 154pt;
|
||||
line-height: 154pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.visual_font_size_196pt,
|
||||
|
@ -2960,6 +2983,7 @@ span#plugin_description {
|
|||
.visual_font_size_196pt span em {
|
||||
font-size: 196pt;
|
||||
line-height: 196pt;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.resize_visual_font_size_8pt,
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
* ---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
div.external-visual-console-container {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
div#vc-controls {
|
||||
position: fixed;
|
||||
top: 30px;
|
||||
|
@ -414,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
|
@ -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.
|
||||
|
|
|
@ -376,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.
|
||||
|
@ -501,7 +503,7 @@ ui_require_css_file('form');
|
|||
if (div !== null) {
|
||||
var parent = div.parentElement;
|
||||
if (parent !== null) {
|
||||
parent.removeChild(div);
|
||||
parent.removeChild(div);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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=\'';
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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}`;
|
||||
|
|
Loading…
Reference in New Issue