mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
MonitoredObject: Only select history entries for the respective object
And fix that the default sort order is not applied. fixes #9963
This commit is contained in:
parent
7812f6ddcc
commit
65806fafbf
@ -496,7 +496,8 @@ abstract class DataView implements QueryInterface, SortRules, FilterColumns, Ite
|
|||||||
*/
|
*/
|
||||||
public function peekAhead($state = true)
|
public function peekAhead($state = true)
|
||||||
{
|
{
|
||||||
return $this->query->peekAhead($state);
|
$this->query->peekAhead($state);
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -450,21 +450,29 @@ abstract class MonitoredObject implements Filterable
|
|||||||
*/
|
*/
|
||||||
public function fetchEventhistory()
|
public function fetchEventhistory()
|
||||||
{
|
{
|
||||||
$eventHistory = $this->backend->select()->from('eventhistory', array(
|
$eventHistory = $this->backend
|
||||||
'object_type',
|
->select()
|
||||||
'host_name',
|
->from(
|
||||||
'host_display_name',
|
'eventhistory',
|
||||||
'service_description',
|
array(
|
||||||
'service_display_name',
|
'object_type',
|
||||||
'timestamp',
|
'host_name',
|
||||||
'state',
|
'host_display_name',
|
||||||
'output',
|
'service_description',
|
||||||
'type'
|
'service_display_name',
|
||||||
))
|
'timestamp',
|
||||||
|
'state',
|
||||||
|
'output',
|
||||||
|
'type'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
->where('object_type', $this->type)
|
||||||
->where('host_name', $this->host_name);
|
->where('host_name', $this->host_name);
|
||||||
|
|
||||||
if ($this->type === self::TYPE_SERVICE) {
|
if ($this->type === self::TYPE_SERVICE) {
|
||||||
$eventHistory->where('service_description', $this->service_description);
|
$eventHistory->where('service_description', $this->service_description);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->eventhistory = $eventHistory->applyFilter($this->getFilter());
|
$this->eventhistory = $eventHistory->applyFilter($this->getFilter());
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user