#11179 Fixed heatmap and latest events

This commit is contained in:
Daniel Maya 2023-05-11 12:05:00 +02:00
parent ba5e3a0f08
commit 45d6f2b5f5
4 changed files with 45 additions and 13 deletions

View File

@ -208,7 +208,7 @@ $table->data[2][] = html_print_label_input_block(
if ($action === 'new') {
$backgroundColorInput = html_print_input_color(
'background_color',
'white',
'#FFFFFF',
'background_color',
false,
true

View File

@ -102,12 +102,26 @@ class Heatmap
protected $group = null;
/**
* Heatmap group.
* Heatmap dashboard.
*
* @var boolean
*/
protected $dashboard = null;
/**
* Public hash.
*
* @var boolean
*/
protected $hash = null;
/**
* Public user.
*
* @var boolean
*/
protected $publicUser = null;
/**
* Constructor function
@ -131,7 +145,9 @@ class Heatmap
int $height=0,
string $search=null,
int $group=1,
bool $dashboard=false
bool $dashboard=false,
string $hash='',
string $publicUser=''
) {
$this->type = $type;
$this->filter = $filter;
@ -142,6 +158,8 @@ class Heatmap
$this->search = $search;
$this->group = $group;
$this->dashboard = $dashboard;
$this->hash = $hash;
$this->publicUser = $publicUser;
}
@ -164,15 +182,18 @@ class Heatmap
false
),
'data' => [
'page' => 'operation/heatmap',
'method' => 'showHeatmap',
'randomId' => $this->randomId,
'type' => $this->type,
'filter' => $this->filter,
'refresh' => $this->refresh,
'search' => $this->search,
'group' => $this->group,
'dashboard' => (int) $this->dashboard,
'page' => 'operation/heatmap',
'method' => 'showHeatmap',
'randomId' => $this->randomId,
'type' => $this->type,
'filter' => $this->filter,
'refresh' => $this->refresh,
'search' => $this->search,
'group' => $this->group,
'dashboard' => (int) $this->dashboard,
'auth_hash' => $this->hash,
'auth_class' => 'PandoraFMS\Dashboard\Manager',
'id_user' => $this->publicUser,
],
];

View File

@ -658,6 +658,10 @@ class EventsListWidget extends Widget
$table_id = 'dashboard_list_events_'.$this->cellId;
// Public dashboard.
$hash = get_parameter('auth_hash', '');
$id_user = get_parameter('id_user', '');
// Print datatable.
$output .= ui_print_datatable(
[
@ -671,6 +675,9 @@ class EventsListWidget extends Widget
'filter' => $filter,
'length' => $this->values['limit'],
'groupRecursion' => (bool) $this->values['groupRecursion'],
'auth_hash' => $hash,
'auth_class' => 'PandoraFMS\Dashboard\Manager',
'id_user' => $id_user,
],
'default_pagination' => $this->values['limit'],
'pagination_options' => [

View File

@ -441,8 +441,12 @@ class HeatmapWidget extends Widget
$filter = explode(',', $values['module_groups'][0]);
}
// Public dashboard.
$auth_hash = get_parameter('auth_hash', '');
$public_user = get_parameter('id_user', '');
// Control call flow.
$heatmap = new Heatmap($type, $filter, null, 300, 400, 200, $search, 0, true);
$heatmap = new Heatmap($type, $filter, null, 300, 400, 200, $search, 0, true, $auth_hash, $public_user);
// AJAX controller.
if (is_ajax() === true) {
$method = get_parameter('method');