fixed error with node link events list dashboard

This commit is contained in:
marcos 2021-09-02 16:43:16 +02:00
parent f49d6d3088
commit 8b048c8c19
1 changed files with 8 additions and 6 deletions

View File

@ -628,12 +628,6 @@ class EventsListWidget extends Widget
$fields[] = 'te.server_id';
}
// If its node, get direccion value and contruct rute.
if ($this->nodeId !== null && $this->nodeId > 0) {
$result = db_get_all_rows_sql('SELECT direccion FROM tagente WHERE id_agente = '.$this->nodeId.'');
$home_url = 'http://'.$result[0]['direccion'].'/pandora_console';
}
$events = \events_get_all(
// Fields.
$fields,
@ -684,6 +678,14 @@ class EventsListWidget extends Widget
$table->size = [];
$table->rowclass = [];
// If its node, get direccion value and construct rute.
if ($this->nodeId !== null && $this->nodeId > 0) {
metaconsole_restore_db();
$result = db_get_all_rows_sql('SELECT server_url FROM tmetaconsole_setup WHERE id = '.$this->nodeId.'');
$home_url = $result[0]['server_url'];
metaconsole_connect(null, $this->nodeId);
}
foreach ($events as $event) {
$data = [];
$event['evento'] = \io_safe_output($event['evento']);