Fixed VC events history

This commit is contained in:
daniel 2021-03-09 16:36:37 +00:00 committed by Daniel Rodriguez
parent 4d1cab6b67
commit 0c5cfcc90e
2 changed files with 30 additions and 14 deletions

View File

@ -4008,7 +4008,7 @@ function graph_graphic_agentevents(
$width, $width,
$height, $height,
$period=0, $period=0,
$homeurl, $homeurl='',
$return=false, $return=false,
$from_agent_view=false, $from_agent_view=false,
$widgets=false, $widgets=false,

View File

@ -73,6 +73,7 @@ final class EventsHistory extends Item
* 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 visual console in dashboards.
* *
* @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 \InvalidArgumentException When an agent Id cannot be found. * @throws \InvalidArgumentException When an agent Id cannot be found.
@ -124,6 +125,18 @@ final class EventsHistory extends Item
$data['height'] = 11; $data['height'] = 11;
} }
if (empty($moduleId) === true) {
$html = \graph_graphic_agentevents(
$agentId,
100,
(int) $data['height'],
static::extractMaxTime($data),
'',
true,
false,
500
);
} else {
// Use the same HTML output as the old VC. // Use the same HTML output as the old VC.
$html = \graph_graphic_moduleevents( $html = \graph_graphic_moduleevents(
$agentId, $agentId,
@ -136,6 +149,7 @@ final class EventsHistory extends Item
1, 1,
$data['width'] $data['width']
); );
}
$data['html'] = $html; $data['html'] = $html;
@ -211,7 +225,7 @@ final class EventsHistory extends Item
'return' => true, 'return' => true,
'module_input' => true, 'module_input' => true,
'module_name' => 'moduleId', 'module_name' => 'moduleId',
'module_none' => false, 'module_none' => true,
], ],
]; ];
@ -227,6 +241,8 @@ final class EventsHistory extends Item
'sort' => false, 'sort' => false,
'agent_id' => $values['agentId'], 'agent_id' => $values['agentId'],
'metaconsole_id' => $values['metaconsoleId'], 'metaconsole_id' => $values['metaconsoleId'],
'nothing' => '--',
'nothing_value' => 0,
], ],
]; ];