Merge branch 'ent-9229-revisar-comportamiento-de-widgets-con-elementos-eliminados' into 'develop'
fixed widget dashboards no exist item pandora_enterprise#9229 pandora_enterprise#9229 See merge request artica/pandorafms!5035
This commit is contained in:
commit
3ec710a62f
|
@ -86,7 +86,8 @@ function groupview_get_modules_counters($groups_ids=false)
|
|||
WHERE tasg.id_group IN ($groups_ids)
|
||||
GROUP BY tasg.id_group
|
||||
) x GROUP BY g";
|
||||
return db_get_all_rows_sql($sql);
|
||||
$data = db_get_all_rows_sql($sql);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11537,7 +11537,7 @@ function reporting_get_group_stats_resume($id_group=0, $access='AR', $ignore_per
|
|||
$data['status'] = 'critical';
|
||||
} else if ($data['monitor_warning'] > 0) {
|
||||
$data['status'] = 'warning';
|
||||
} else if (($data['monitor_unknown'] > 0) || ($data['agents_unknown'] > 0)) {
|
||||
} else if (($data['monitor_unknown'] > 0) || ($data['agent_unknown'] > 0)) {
|
||||
$data['status'] = 'unknown';
|
||||
} else if ($data['monitor_ok'] > 0) {
|
||||
$data['status'] = 'ok';
|
||||
|
|
|
@ -3788,6 +3788,7 @@ function visual_map_get_user_layouts(
|
|||
unset($filter['can_manage_group_all']);
|
||||
}
|
||||
|
||||
$where = '';
|
||||
if ($check_user_groups === true && !empty($groups)) {
|
||||
if (empty($where)) {
|
||||
$where = '';
|
||||
|
@ -4080,7 +4081,7 @@ function visual_map_get_layout_status($layout_id, $status_data=[], $depth=0)
|
|||
// When the status calculation type is 'default', only one critical
|
||||
// element is required to set the layout status as critical, so we can
|
||||
// return the critical status right now.
|
||||
if ($status_data['linked_layout_status_type'] === 'default'
|
||||
if ((isset($status_data['linked_layout_status_type']) === true && $status_data['linked_layout_status_type'] === 'default')
|
||||
&& ($status == VISUAL_MAP_STATUS_CRITICAL_BAD
|
||||
|| $status == VISUAL_MAP_STATUS_CRITICAL_ALERT)
|
||||
) {
|
||||
|
@ -4104,71 +4105,73 @@ function visual_map_get_layout_status($layout_id, $status_data=[], $depth=0)
|
|||
metaconsole_restore_db();
|
||||
}
|
||||
|
||||
// Status calculation.
|
||||
switch ($status_data['linked_layout_status_type']) {
|
||||
default:
|
||||
case 'default':
|
||||
$num_items_critical_alert = $num_elements_by_status[VISUAL_MAP_STATUS_CRITICAL_ALERT];
|
||||
$num_items_critical = $num_elements_by_status[VISUAL_MAP_STATUS_CRITICAL_BAD];
|
||||
$num_items_warning_alert = $num_elements_by_status[VISUAL_MAP_STATUS_WARNING_ALERT];
|
||||
$num_items_warning = $num_elements_by_status[VISUAL_MAP_STATUS_WARNING];
|
||||
$num_items_unknown = $num_elements_by_status[VISUAL_MAP_STATUS_UNKNOWN];
|
||||
if (isset($status_data['linked_layout_status_type']) === true) {
|
||||
// Status calculation.
|
||||
switch ($status_data['linked_layout_status_type']) {
|
||||
default:
|
||||
case 'default':
|
||||
$num_items_critical_alert = $num_elements_by_status[VISUAL_MAP_STATUS_CRITICAL_ALERT];
|
||||
$num_items_critical = $num_elements_by_status[VISUAL_MAP_STATUS_CRITICAL_BAD];
|
||||
$num_items_warning_alert = $num_elements_by_status[VISUAL_MAP_STATUS_WARNING_ALERT];
|
||||
$num_items_warning = $num_elements_by_status[VISUAL_MAP_STATUS_WARNING];
|
||||
$num_items_unknown = $num_elements_by_status[VISUAL_MAP_STATUS_UNKNOWN];
|
||||
|
||||
if ($num_items_critical_alert > 0) {
|
||||
return VISUAL_MAP_STATUS_CRITICAL_ALERT;
|
||||
} else if ($num_items_critical > 0) {
|
||||
return VISUAL_MAP_STATUS_CRITICAL_BAD;
|
||||
} else if ($num_items_warning_alert > 0) {
|
||||
return VISUAL_MAP_STATUS_WARNING_ALERT;
|
||||
} else if ($num_items_warning > 0) {
|
||||
return VISUAL_MAP_STATUS_WARNING;
|
||||
} else if ($num_items_unknown > 0) {
|
||||
return VISUAL_MAP_STATUS_UNKNOWN;
|
||||
} else {
|
||||
return VISUAL_MAP_STATUS_NORMAL;
|
||||
}
|
||||
break;
|
||||
case 'weight':
|
||||
$weight = $status_data['id_layout_linked_weight'];
|
||||
$num_items = count($valid_layout_items);
|
||||
$num_items_critical_alert = $num_elements_by_status[VISUAL_MAP_STATUS_CRITICAL_ALERT];
|
||||
$num_items_critical = $num_elements_by_status[VISUAL_MAP_STATUS_CRITICAL_BAD];
|
||||
$num_items_warning_alert = $num_elements_by_status[VISUAL_MAP_STATUS_WARNING_ALERT];
|
||||
$num_items_warning = $num_elements_by_status[VISUAL_MAP_STATUS_WARNING];
|
||||
$num_items_unknown = $num_elements_by_status[VISUAL_MAP_STATUS_UNKNOWN];
|
||||
if ($num_items_critical_alert > 0) {
|
||||
return VISUAL_MAP_STATUS_CRITICAL_ALERT;
|
||||
} else if ($num_items_critical > 0) {
|
||||
return VISUAL_MAP_STATUS_CRITICAL_BAD;
|
||||
} else if ($num_items_warning_alert > 0) {
|
||||
return VISUAL_MAP_STATUS_WARNING_ALERT;
|
||||
} else if ($num_items_warning > 0) {
|
||||
return VISUAL_MAP_STATUS_WARNING;
|
||||
} else if ($num_items_unknown > 0) {
|
||||
return VISUAL_MAP_STATUS_UNKNOWN;
|
||||
} else {
|
||||
return VISUAL_MAP_STATUS_NORMAL;
|
||||
}
|
||||
break;
|
||||
case 'weight':
|
||||
$weight = $status_data['id_layout_linked_weight'];
|
||||
$num_items = count($valid_layout_items);
|
||||
$num_items_critical_alert = $num_elements_by_status[VISUAL_MAP_STATUS_CRITICAL_ALERT];
|
||||
$num_items_critical = $num_elements_by_status[VISUAL_MAP_STATUS_CRITICAL_BAD];
|
||||
$num_items_warning_alert = $num_elements_by_status[VISUAL_MAP_STATUS_WARNING_ALERT];
|
||||
$num_items_warning = $num_elements_by_status[VISUAL_MAP_STATUS_WARNING];
|
||||
$num_items_unknown = $num_elements_by_status[VISUAL_MAP_STATUS_UNKNOWN];
|
||||
|
||||
if (($num_items_critical > 0 || $num_items_critical_alert > 0)
|
||||
&& ((($num_items_critical_alert + $num_items_critical) * 100) / $num_items) >= $weight
|
||||
) {
|
||||
return ($num_items_critical_alert > 0) ? VISUAL_MAP_STATUS_CRITICAL_ALERT : VISUAL_MAP_STATUS_CRITICAL_BAD;
|
||||
} else if (($num_items_warning > 0 || $num_items_warning_alert > 0)
|
||||
&& (($num_items_warning_alert + $num_items_warning * 100) / $num_items) >= $weight
|
||||
) {
|
||||
return ($num_items_warning_alert > 0) ? VISUAL_MAP_STATUS_WARNING_ALERT : VISUAL_MAP_STATUS_WARNING;
|
||||
} else if ($num_items_unknown > 0
|
||||
&& (($num_items_unknown * 100) / $num_items) >= $weight
|
||||
) {
|
||||
return VISUAL_MAP_STATUS_UNKNOWN;
|
||||
} else {
|
||||
return VISUAL_MAP_STATUS_NORMAL;
|
||||
}
|
||||
break;
|
||||
if (($num_items_critical > 0 || $num_items_critical_alert > 0)
|
||||
&& ((($num_items_critical_alert + $num_items_critical) * 100) / $num_items) >= $weight
|
||||
) {
|
||||
return ($num_items_critical_alert > 0) ? VISUAL_MAP_STATUS_CRITICAL_ALERT : VISUAL_MAP_STATUS_CRITICAL_BAD;
|
||||
} else if (($num_items_warning > 0 || $num_items_warning_alert > 0)
|
||||
&& (($num_items_warning_alert + $num_items_warning * 100) / $num_items) >= $weight
|
||||
) {
|
||||
return ($num_items_warning_alert > 0) ? VISUAL_MAP_STATUS_WARNING_ALERT : VISUAL_MAP_STATUS_WARNING;
|
||||
} else if ($num_items_unknown > 0
|
||||
&& (($num_items_unknown * 100) / $num_items) >= $weight
|
||||
) {
|
||||
return VISUAL_MAP_STATUS_UNKNOWN;
|
||||
} else {
|
||||
return VISUAL_MAP_STATUS_NORMAL;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'service':
|
||||
$num_items_critical = ($num_elements_by_status[VISUAL_MAP_STATUS_CRITICAL_BAD] + $num_elements_by_status[VISUAL_MAP_STATUS_CRITICAL_ALERT]);
|
||||
$critical_percentage = (($num_items_critical * 100) / count($valid_layout_items));
|
||||
case 'service':
|
||||
$num_items_critical = ($num_elements_by_status[VISUAL_MAP_STATUS_CRITICAL_BAD] + $num_elements_by_status[VISUAL_MAP_STATUS_CRITICAL_ALERT]);
|
||||
$critical_percentage = (($num_items_critical * 100) / count($valid_layout_items));
|
||||
|
||||
$num_items_warning = ($num_elements_by_status[VISUAL_MAP_STATUS_WARNING] + $num_elements_by_status[VISUAL_MAP_STATUS_WARNING_ALERT]);
|
||||
$warning_percentage = (($num_items_warning * 100) / count($valid_layout_items));
|
||||
$num_items_warning = ($num_elements_by_status[VISUAL_MAP_STATUS_WARNING] + $num_elements_by_status[VISUAL_MAP_STATUS_WARNING_ALERT]);
|
||||
$warning_percentage = (($num_items_warning * 100) / count($valid_layout_items));
|
||||
|
||||
if ($critical_percentage >= $status_data['linked_layout_status_as_service_critical'] && $critical_percentage !== 0) {
|
||||
return VISUAL_MAP_STATUS_CRITICAL_BAD;
|
||||
} else if ($warning_percentage >= $status_data['linked_layout_status_as_service_warning'] && $warning_percentage !== 0) {
|
||||
return VISUAL_MAP_STATUS_WARNING;
|
||||
} else {
|
||||
return VISUAL_MAP_STATUS_NORMAL;
|
||||
}
|
||||
break;
|
||||
if ($critical_percentage >= $status_data['linked_layout_status_as_service_critical'] && $critical_percentage !== 0) {
|
||||
return VISUAL_MAP_STATUS_CRITICAL_BAD;
|
||||
} else if ($warning_percentage >= $status_data['linked_layout_status_as_service_warning'] && $warning_percentage !== 0) {
|
||||
return VISUAL_MAP_STATUS_WARNING;
|
||||
} else {
|
||||
return VISUAL_MAP_STATUS_NORMAL;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -526,8 +526,7 @@ function print_clock_analogic_1(
|
|||
$color,
|
||||
$title=true
|
||||
) {
|
||||
global $config;
|
||||
$output .= '<style type="text/css">
|
||||
$output = '<style type="text/css">
|
||||
#rim {
|
||||
fill: none;
|
||||
stroke: #999;
|
||||
|
|
|
@ -387,17 +387,17 @@ class BlockHistogram extends Widget
|
|||
$output = '';
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$modules_nodes = array_reduce(
|
||||
$this->values['moduleBlockHistogram'],
|
||||
function ($carry, $item) {
|
||||
$explode = explode('|', $item);
|
||||
$carry[$explode[0]][] = $explode[1];
|
||||
return $carry;
|
||||
},
|
||||
[]
|
||||
);
|
||||
$modules_nodes = array_reduce(
|
||||
$this->values['moduleBlockHistogram'],
|
||||
function ($carry, $item) {
|
||||
$explode = explode('|', $item);
|
||||
$carry[$explode[0]][] = $explode[1];
|
||||
return $carry;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
$modules = [];
|
||||
$modules = [];
|
||||
foreach ($modules_nodes as $n => $mod) {
|
||||
try {
|
||||
$node = new Node((int) $n);
|
||||
|
@ -475,7 +475,8 @@ class BlockHistogram extends Widget
|
|||
private function getInfoModules(array $modules): array
|
||||
{
|
||||
$where = sprintf(
|
||||
'tagente_modulo.id_agente_modulo IN (%s)',
|
||||
'tagente_modulo.id_agente_modulo IN (%s)
|
||||
AND tagente_modulo.delete_pending = 0',
|
||||
implode(',', $modules)
|
||||
);
|
||||
|
||||
|
|
|
@ -426,7 +426,8 @@ class ColorModuleTabs extends Widget
|
|||
private function getInfoModules(array $modules): array
|
||||
{
|
||||
$where = sprintf(
|
||||
'tagente_modulo.id_agente_modulo IN (%s)',
|
||||
'tagente_modulo.id_agente_modulo IN (%s)
|
||||
AND tagente_modulo.delete_pending = 0',
|
||||
implode(',', $modules)
|
||||
);
|
||||
|
||||
|
|
|
@ -170,6 +170,17 @@ class AlertsFiredWidget extends Widget
|
|||
$this->configurationRequired = false;
|
||||
if (isset($this->values['groupId']) === false) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
$check_exist = \db_get_value(
|
||||
'id_grupo',
|
||||
'tgrupo',
|
||||
'id_grupo',
|
||||
$this->values['groupId']
|
||||
);
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->overflow_scrollbars = false;
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
namespace PandoraFMS\Dashboard;
|
||||
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
|
||||
/**
|
||||
* Custom graph Widgets
|
||||
*/
|
||||
|
@ -178,6 +180,41 @@ class CustomGraphWidget extends Widget
|
|||
$this->configurationRequired = false;
|
||||
if (empty($this->values['id_graph']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node = new Node($this->values['node']);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
$check_exist = \db_get_value(
|
||||
'name',
|
||||
'tgraph',
|
||||
'id_graph',
|
||||
$this->values['id_graph']
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$check_exist = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -553,6 +553,18 @@ class EventsListWidget extends Widget
|
|||
);
|
||||
$filter['module_search'] = $name[0]['nombre'];
|
||||
}
|
||||
} else if (empty($this->values['customFilter']) === false
|
||||
&& (int) $this->values['customFilter'] !== -1
|
||||
) {
|
||||
$output = '<div class="container-center">';
|
||||
$output .= \ui_print_error_message(
|
||||
__('Widget cannot be loaded').'. '.__('Please, event filter has been removed.'),
|
||||
'',
|
||||
true
|
||||
);
|
||||
$output .= '</div>';
|
||||
echo $output;
|
||||
return;
|
||||
} else {
|
||||
// Filtering.
|
||||
$filter['event_view_hr'] = $this->values['maxHours'];
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
namespace PandoraFMS\Dashboard;
|
||||
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
|
||||
global $config;
|
||||
|
||||
/**
|
||||
|
@ -183,6 +185,44 @@ class GraphModuleHistogramWidget extends Widget
|
|||
$this->configurationRequired = false;
|
||||
if (empty($this->values['moduleId']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node = new Node($this->values['metaconsoleId']);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
$check_exist = db_get_sql(
|
||||
sprintf(
|
||||
'SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = %s
|
||||
AND delete_pending = 0',
|
||||
$this->values['moduleId']
|
||||
)
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$check_exist = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->overflow_scrollbars = false;
|
||||
|
@ -304,7 +344,6 @@ class GraphModuleHistogramWidget extends Widget
|
|||
'label' => __('Module'),
|
||||
'arguments' => [
|
||||
'type' => 'autocomplete_module',
|
||||
'fields' => $fields,
|
||||
'name' => 'moduleId',
|
||||
'selected' => $values['moduleId'],
|
||||
'return' => true,
|
||||
|
@ -312,7 +351,9 @@ class GraphModuleHistogramWidget 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']] : [],
|
||||
'nothing' => __('None'),
|
||||
'nothing_value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -166,6 +166,17 @@ class GroupsStatusWidget extends Widget
|
|||
$this->configurationRequired = false;
|
||||
if (empty($this->values['groupId']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
$check_exist = \db_get_value(
|
||||
'id_grupo',
|
||||
'tgrupo',
|
||||
'id_grupo',
|
||||
$this->values['groupId']
|
||||
);
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->overflow_scrollbars = false;
|
||||
|
@ -520,7 +531,7 @@ class GroupsStatusWidget extends Widget
|
|||
{
|
||||
$size = [
|
||||
'width' => 400,
|
||||
'height' => 270,
|
||||
'height' => 330,
|
||||
];
|
||||
|
||||
return $size;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
namespace PandoraFMS\Dashboard;
|
||||
// Load Visual Console.
|
||||
use Models\VisualConsole\Container as VisualConsole;
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
use PandoraFMS\User;
|
||||
/**
|
||||
* Maps by users Widgets.
|
||||
|
@ -183,12 +184,36 @@ class MapsMadeByUser extends Widget
|
|||
if (empty($this->values['vcId']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
$check_exist = db_get_value(
|
||||
'id',
|
||||
'tlayout',
|
||||
'id',
|
||||
$this->values['vcId']
|
||||
);
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node = new Node($this->values['node']);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
$check_exist = db_get_value(
|
||||
'id',
|
||||
'tlayout',
|
||||
'id',
|
||||
$this->values['vcId']
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$check_exist = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
|
@ -334,12 +359,14 @@ class MapsMadeByUser extends Widget
|
|||
$inputs[] = [
|
||||
'label' => __('Visual console'),
|
||||
'arguments' => [
|
||||
'id' => 'vcId',
|
||||
'type' => 'select',
|
||||
'fields' => $fields,
|
||||
'name' => 'vcId',
|
||||
'selected' => $values['vcId'],
|
||||
'return' => true,
|
||||
'id' => 'vcId',
|
||||
'type' => 'select',
|
||||
'fields' => $fields,
|
||||
'name' => 'vcId',
|
||||
'selected' => $values['vcId'],
|
||||
'return' => true,
|
||||
'nothing' => __('None'),
|
||||
'nothing_value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -320,6 +320,17 @@ class MapsStatusWidget extends Widget
|
|||
$output = '';
|
||||
if (isset($maps) === true && empty($maps) === false) {
|
||||
foreach ($maps as $id_layout) {
|
||||
$check_exist = db_get_value(
|
||||
'id',
|
||||
'tlayout',
|
||||
'id',
|
||||
$id_layout
|
||||
);
|
||||
|
||||
if ($check_exist === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
|
||||
$url = $config['homeurl'];
|
||||
|
@ -366,12 +377,22 @@ class MapsStatusWidget extends Widget
|
|||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
// 31 px for each map.
|
||||
$minHeight = (count($maps) * 31);
|
||||
$style = 'min-width:200px; min-height:'.$minHeight.'px';
|
||||
$output = '<div class="container-center" style="'.$style.'">';
|
||||
$output .= html_print_table($table, true);
|
||||
$output .= '</div>';
|
||||
if (empty($table->data) === false) {
|
||||
// 31 px for each map.
|
||||
$minHeight = (count($maps) * 31);
|
||||
$style = 'min-width:200px; min-height:'.$minHeight.'px';
|
||||
$output = '<div class="container-center" style="'.$style.'">';
|
||||
$output .= html_print_table($table, true);
|
||||
$output .= '</div>';
|
||||
} else {
|
||||
$output .= '<div class="container-center">';
|
||||
$output .= \ui_print_error_message(
|
||||
__('Widget cannot be loaded').'. '.__('Please, configure the widget again to recover it'),
|
||||
'',
|
||||
true
|
||||
);
|
||||
$output .= '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
namespace PandoraFMS\Dashboard;
|
||||
use PandoraFMS\Dashboard;
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
|
||||
global $config;
|
||||
|
||||
|
@ -186,6 +187,44 @@ class ModuleIconWidget extends Widget
|
|||
$this->configurationRequired = false;
|
||||
if (empty($this->values['moduleId']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node = new Node($this->values['metaconsoleId']);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
$check_exist = db_get_sql(
|
||||
sprintf(
|
||||
'SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = %s
|
||||
AND delete_pending = 0',
|
||||
$this->values['moduleId']
|
||||
)
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$check_exist = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->overflow_scrollbars = false;
|
||||
|
@ -334,7 +373,6 @@ class ModuleIconWidget extends Widget
|
|||
'label' => __('Module'),
|
||||
'arguments' => [
|
||||
'type' => 'autocomplete_module',
|
||||
'fields' => $fields,
|
||||
'name' => 'moduleId',
|
||||
'selected' => $values['moduleId'],
|
||||
'return' => true,
|
||||
|
@ -343,6 +381,8 @@ class ModuleIconWidget extends Widget
|
|||
'metaconsole_id' => $values['metaconsoleId'],
|
||||
'style' => 'width: inherit;',
|
||||
'filter_modules' => users_access_to_agent($values['agentId']) === false ? [$values['moduleId']] : [],
|
||||
'nothing' => __('None'),
|
||||
'nothing_value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
namespace PandoraFMS\Dashboard;
|
||||
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
|
||||
global $config;
|
||||
|
||||
/**
|
||||
|
@ -181,6 +183,44 @@ class ModuleStatusWidget extends Widget
|
|||
$this->configurationRequired = false;
|
||||
if (empty($this->values['moduleId']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node = new Node($this->values['metaconsoleId']);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
$check_exist = db_get_sql(
|
||||
sprintf(
|
||||
'SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = %s
|
||||
AND delete_pending = 0',
|
||||
$this->values['moduleId']
|
||||
)
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$check_exist = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->overflow_scrollbars = false;
|
||||
|
@ -324,7 +364,6 @@ class ModuleStatusWidget extends Widget
|
|||
'label' => __('Module'),
|
||||
'arguments' => [
|
||||
'type' => 'autocomplete_module',
|
||||
'fields' => $fields,
|
||||
'name' => 'moduleId',
|
||||
'selected' => $values['moduleId'],
|
||||
'return' => true,
|
||||
|
@ -332,7 +371,9 @@ class ModuleStatusWidget 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']] : [],
|
||||
'nothing' => __('None'),
|
||||
'nothing_value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -454,15 +495,8 @@ class ModuleStatusWidget extends Widget
|
|||
*/
|
||||
public function load()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$output .= '';
|
||||
|
||||
$id_agent = $this->values['agentId'];
|
||||
$id_group = agents_get_agent_group($id_agent);
|
||||
|
||||
$output = '';
|
||||
$id_module = $this->values['moduleId'];
|
||||
|
||||
$icon = $this->values['imageSrc'];
|
||||
$label = $this->values['label'];
|
||||
$sizeLabel = (isset($this->values['sizeLabel']) === true) ? $this->values['sizeLabel'] : 30;
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
namespace PandoraFMS\Dashboard;
|
||||
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
|
||||
global $config;
|
||||
|
||||
|
||||
|
@ -183,6 +185,44 @@ class ModuleTableValueWidget extends Widget
|
|||
$this->configurationRequired = false;
|
||||
if (empty($this->values['moduleId']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node = new Node($this->values['metaconsoleId']);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
$check_exist = db_get_sql(
|
||||
sprintf(
|
||||
'SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = %s
|
||||
AND delete_pending = 0',
|
||||
$this->values['moduleId']
|
||||
)
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$check_exist = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->overflow_scrollbars = false;
|
||||
|
@ -293,6 +333,8 @@ class ModuleTableValueWidget extends Widget
|
|||
'filter_modules' => users_access_to_agent(
|
||||
($values['agentId']) === false
|
||||
) ? [$values['moduleId']] : [],
|
||||
'nothing' => __('None'),
|
||||
'nothing_value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
namespace PandoraFMS\Dashboard;
|
||||
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
|
@ -181,6 +183,44 @@ class ModuleValueWidget extends Widget
|
|||
$this->configurationRequired = false;
|
||||
if (empty($this->values['moduleId']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node = new Node($this->values['metaconsoleId']);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
$check_exist = db_get_sql(
|
||||
sprintf(
|
||||
'SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = %s
|
||||
AND delete_pending = 0',
|
||||
$this->values['moduleId']
|
||||
)
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$check_exist = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->overflow_scrollbars = false;
|
||||
|
@ -308,7 +348,6 @@ class ModuleValueWidget extends Widget
|
|||
'label' => __('Module'),
|
||||
'arguments' => [
|
||||
'type' => 'autocomplete_module',
|
||||
'fields' => $fields,
|
||||
'name' => 'moduleId',
|
||||
'selected' => $values['moduleId'],
|
||||
'return' => true,
|
||||
|
@ -316,7 +355,9 @@ class ModuleValueWidget 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']] : [],
|
||||
'nothing' => __('None'),
|
||||
'nothing_value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -380,9 +421,6 @@ class ModuleValueWidget extends Widget
|
|||
|
||||
$output = '';
|
||||
|
||||
$id_agent = $this->values['agentId'];
|
||||
$id_group = agents_get_agent_group($id_agent);
|
||||
|
||||
$id_module = $this->values['moduleId'];
|
||||
|
||||
$data_module = \modules_get_last_value($id_module);
|
||||
|
|
|
@ -236,7 +236,7 @@ class MonitorHealthWidget extends Widget
|
|||
|
||||
$all_data = tactical_status_modules_agents(
|
||||
$config['id_user'],
|
||||
$user_strict,
|
||||
false,
|
||||
'AR'
|
||||
);
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
namespace PandoraFMS\Dashboard;
|
||||
|
||||
use PandoraFMS\Dashboard\Manager;
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
|
||||
/**
|
||||
* Network map Widgets.
|
||||
|
@ -180,6 +181,42 @@ class NetworkMapWidget extends Widget
|
|||
$this->configurationRequired = false;
|
||||
if (empty($this->values['networkmapId']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node = new Node($this->values['node']);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
// Reports.
|
||||
$check_exist = db_get_value(
|
||||
'id',
|
||||
'tmap',
|
||||
'id',
|
||||
$this->values['networkmapId']
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$check_exist = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->overflow_scrollbars = false;
|
||||
|
@ -312,8 +349,6 @@ class NetworkMapWidget extends Widget
|
|||
$values['networkmapId']
|
||||
);
|
||||
|
||||
$fields[$selected] = $selected_networkmap;
|
||||
|
||||
if ((bool) is_metaconsole() === true) {
|
||||
metaconsole_restore_db();
|
||||
}
|
||||
|
@ -322,11 +357,13 @@ class NetworkMapWidget extends Widget
|
|||
$inputs[] = [
|
||||
'label' => __('Map'),
|
||||
'arguments' => [
|
||||
'type' => 'select',
|
||||
'fields' => $fields,
|
||||
'name' => 'networkmapId',
|
||||
'selected' => $selected,
|
||||
'return' => true,
|
||||
'type' => 'select',
|
||||
'fields' => $fields,
|
||||
'name' => 'networkmapId',
|
||||
'selected' => $selected,
|
||||
'return' => true,
|
||||
'nothing' => __('None'),
|
||||
'nothing_value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
namespace PandoraFMS\Dashboard;
|
||||
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
|
||||
global $config;
|
||||
require_once $config['homedir'].'/include/Image/image_functions.php';
|
||||
require_once $config['homedir'].'/include/functions_reporting_html.php';
|
||||
|
@ -173,12 +175,37 @@ class ReportsWidget extends Widget
|
|||
if (empty($this->values['reportId']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
$check_exist = db_get_value(
|
||||
'id_report',
|
||||
'treport',
|
||||
'id_report',
|
||||
$this->values['reportId']
|
||||
);
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node = new Node($this->values['node']);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
// Reports.
|
||||
$check_exist = db_get_value(
|
||||
'id_report',
|
||||
'treport',
|
||||
'id_report',
|
||||
$this->values['reportId']
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$check_exist = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
|
@ -227,15 +254,39 @@ class ReportsWidget extends Widget
|
|||
$return_all_group = true;
|
||||
}
|
||||
|
||||
// Reports.
|
||||
$reports = \reports_get_reports(
|
||||
false,
|
||||
[
|
||||
'id_report',
|
||||
'name',
|
||||
],
|
||||
$return_all_group
|
||||
);
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node = new Node($this->values['node']);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
// Reports.
|
||||
$reports = \reports_get_reports(
|
||||
false,
|
||||
[
|
||||
'id_report',
|
||||
'name',
|
||||
],
|
||||
$return_all_group
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$reports = [];
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['node'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
// If currently selected report is not included in fields array
|
||||
// (it belongs to a group over which user has no permissions), then add
|
||||
|
@ -363,7 +414,7 @@ class ReportsWidget extends Widget
|
|||
$output .= 'Click to view: <a href="?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$this->values['reportId'].'">'.__('Report').'</a>';
|
||||
$output .= '</div>';
|
||||
} else {
|
||||
$this->load_error = true;
|
||||
$this->loadError = true;
|
||||
}
|
||||
|
||||
return $output;
|
||||
|
|
|
@ -200,6 +200,17 @@ class ServiceMapWidget extends Widget
|
|||
$this->configurationRequired = false;
|
||||
if (empty($this->values['serviceId']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
$check_exist = db_get_value(
|
||||
'id',
|
||||
'tservice',
|
||||
'id',
|
||||
$this->values['serviceId']
|
||||
);
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->overflow_scrollbars = false;
|
||||
|
|
|
@ -194,11 +194,9 @@ class ServiceViewWidget extends Widget
|
|||
$this->name = 'service_view';
|
||||
}
|
||||
|
||||
// // This forces at least a first configuration.
|
||||
// $this->configurationRequired = false;
|
||||
// if (empty($this->values['serviceId']) === true) {
|
||||
// $this->configurationRequired = true;
|
||||
// }
|
||||
// This forces at least a first configuration.
|
||||
$this->configurationRequired = false;
|
||||
|
||||
$this->overflow_scrollbars = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
namespace PandoraFMS\Dashboard;
|
||||
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
|
||||
global $config;
|
||||
|
||||
/**
|
||||
|
@ -178,6 +180,44 @@ class SingleGraphWidget extends Widget
|
|||
$this->configurationRequired = false;
|
||||
if (empty($this->values['moduleId']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node = new Node($this->values['metaconsoleId']);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
$check_exist = db_get_sql(
|
||||
sprintf(
|
||||
'SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = %s
|
||||
AND delete_pending = 0',
|
||||
$this->values['moduleId']
|
||||
)
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$check_exist = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->overflow_scrollbars = false;
|
||||
|
@ -286,6 +326,8 @@ class SingleGraphWidget extends Widget
|
|||
'agent_id' => $values['agentId'],
|
||||
'metaconsole_id' => $values['metaconsoleId'],
|
||||
'style' => 'width: inherit;',
|
||||
'nothing' => __('None'),
|
||||
'nothing_value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
|
||||
namespace PandoraFMS\Dashboard;
|
||||
|
||||
use PandoraFMS\Enterprise\Metaconsole\Node;
|
||||
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
|
@ -182,6 +184,44 @@ class SLAPercentWidget extends Widget
|
|||
$this->configurationRequired = false;
|
||||
if (empty($this->values['moduleId']) === true) {
|
||||
$this->configurationRequired = true;
|
||||
} else {
|
||||
try {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node = new Node($this->values['metaconsoleId']);
|
||||
$node->connect();
|
||||
}
|
||||
|
||||
$check_exist = db_get_sql(
|
||||
sprintf(
|
||||
'SELECT id_agente_modulo
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente_modulo = %s
|
||||
AND delete_pending = 0',
|
||||
$this->values['moduleId']
|
||||
)
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
// Unexistent agent.
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
|
||||
$check_exist = false;
|
||||
} finally {
|
||||
if (is_metaconsole() === true
|
||||
&& $this->values['metaconsoleId'] > 0
|
||||
) {
|
||||
$node->disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
if ($check_exist === false) {
|
||||
$this->loadError = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->overflow_scrollbars = false;
|
||||
|
@ -315,7 +355,6 @@ class SLAPercentWidget extends Widget
|
|||
'label' => __('Module'),
|
||||
'arguments' => [
|
||||
'type' => 'autocomplete_module',
|
||||
'fields' => $fields,
|
||||
'name' => 'moduleId',
|
||||
'selected' => $values['moduleId'],
|
||||
'return' => true,
|
||||
|
@ -323,6 +362,8 @@ class SLAPercentWidget extends Widget
|
|||
'agent_id' => $values['agentId'],
|
||||
'metaconsole_id' => $values['metaconsoleId'],
|
||||
'style' => 'width: inherit;',
|
||||
'nothing' => __('None'),
|
||||
'nothing_value' => 0,
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
@ -459,18 +459,19 @@ class SystemGroupStatusWidget extends Widget
|
|||
}
|
||||
|
||||
$module_counters = groupview_get_modules_counters($selected_groups);
|
||||
$result_groups = [];
|
||||
if (empty($module_counters) === false) {
|
||||
foreach ($module_counters as $key => $item) {
|
||||
$module_counters[$key]['name'] = groups_get_name($item['g']);
|
||||
}
|
||||
|
||||
foreach ($module_counters as $key => $item) {
|
||||
$module_counters[$key]['name'] = groups_get_name($item['g']);
|
||||
}
|
||||
$keys = array_column($module_counters, 'g');
|
||||
$values = array_values($module_counters);
|
||||
$result_groups = array_combine($keys, $values);
|
||||
|
||||
$keys = array_column($module_counters, 'g');
|
||||
$values = array_values($module_counters);
|
||||
|
||||
$result_groups = array_combine($keys, $values);
|
||||
|
||||
if (empty($all_counters) === false) {
|
||||
$result_groups[0] = $all_counters;
|
||||
if (empty($all_counters) === false) {
|
||||
$result_groups[0] = $all_counters;
|
||||
}
|
||||
}
|
||||
|
||||
$this->values['groupId'] = $selected_groups;
|
||||
|
|
|
@ -501,7 +501,10 @@ class TreeViewWidget extends Widget
|
|||
}
|
||||
|
||||
$id_cell = $this->cellId;
|
||||
$all_nodes = $this->values['openAllGroups'];
|
||||
$all_nodes = false;
|
||||
if (isset($this->values['openAllGroups']) === true) {
|
||||
$all_nodes = $this->values['openAllGroups'];
|
||||
}
|
||||
|
||||
$tab = 'group';
|
||||
if (empty($this->values['typeTree']) === false) {
|
||||
|
@ -587,7 +590,7 @@ class TreeViewWidget extends Widget
|
|||
|
||||
$output .= \html_print_input_hidden(
|
||||
'publi_dash_tree_view_hash',
|
||||
$hash,
|
||||
'',
|
||||
true
|
||||
);
|
||||
$output .= \html_print_input_hidden(
|
||||
|
|
|
@ -1150,7 +1150,7 @@ class Item extends CachedModel
|
|||
'sec2' => 'screens/screens',
|
||||
'action' => 'visualmap',
|
||||
'id_visualmap' => $vcId,
|
||||
'pure' => (int) $config['pure'],
|
||||
'pure' => (int) (isset($config['pure']) === true) ? $config['pure'] : 0,
|
||||
]
|
||||
);
|
||||
} else if (empty($linkedLayoutNodeId) === true
|
||||
|
@ -1175,7 +1175,7 @@ class Item extends CachedModel
|
|||
'sec' => 'network',
|
||||
'sec2' => 'operation/visual_console/view',
|
||||
'id' => $vcId,
|
||||
'pure' => (int) $config['pure'],
|
||||
'pure' => (int) (isset($config['pure']) === true) ? $config['pure'] : 0,
|
||||
]
|
||||
);
|
||||
} else if (\is_metaconsole() === true
|
||||
|
@ -1313,7 +1313,7 @@ class Item extends CachedModel
|
|||
'operation/agentes/status_monitor',
|
||||
['id_module' => $moduleId],
|
||||
// No autologin from the public view.
|
||||
!$config['public_view'],
|
||||
!((isset($config['public_view']) === true) ? $config['public_view'] : false),
|
||||
$mobile_navigation,
|
||||
[
|
||||
'id' => $moduleId,
|
||||
|
|
|
@ -236,6 +236,7 @@ li#div-textarea label {
|
|||
}
|
||||
|
||||
.container-center > .parent_graph p {
|
||||
margin-top: 0px;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue