mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Ugly temporary fix for Monitoring\Object problems
This commit is contained in:
parent
8ccd748310
commit
23daa39205
@ -42,6 +42,18 @@ abstract class AbstractObject
|
|||||||
|
|
||||||
public function fetchComments()
|
public function fetchComments()
|
||||||
{
|
{
|
||||||
|
// WTF???
|
||||||
|
$query = Comment::fromParams(array('backend' => null), array(
|
||||||
|
'comment_timestamp',
|
||||||
|
'comment_author',
|
||||||
|
'comment_data',
|
||||||
|
'comment_type',
|
||||||
|
))->getQuery();
|
||||||
|
$query->where('comment_objecttype_id', $this->type);
|
||||||
|
$this->applyObjectFilter($query);
|
||||||
|
$this->comments = $query->fetchAll();
|
||||||
|
return $this;
|
||||||
|
|
||||||
$this->comments = Comment::fromRequest(
|
$this->comments = Comment::fromRequest(
|
||||||
$this->request,
|
$this->request,
|
||||||
array(
|
array(
|
||||||
@ -52,7 +64,7 @@ abstract class AbstractObject
|
|||||||
'comment_type',
|
'comment_type',
|
||||||
)
|
)
|
||||||
)->getQuery()
|
)->getQuery()
|
||||||
->where('comment_objecttype_id', 1)
|
//->where('comment_objecttype_id', 1)
|
||||||
|
|
||||||
->fetchAll();
|
->fetchAll();
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace Icinga\Module\Monitoring\Object;
|
namespace Icinga\Module\Monitoring\Object;
|
||||||
|
|
||||||
use Icinga\Module\Monitoring\DataView\HostStatus;
|
use Icinga\Module\Monitoring\DataView\HostStatus;
|
||||||
|
use Icinga\Data\Db\Query;
|
||||||
|
|
||||||
class Host extends AbstractObject
|
class Host extends AbstractObject
|
||||||
{
|
{
|
||||||
@ -11,6 +12,10 @@ class Host extends AbstractObject
|
|||||||
public $prefix = 'host_';
|
public $prefix = 'host_';
|
||||||
private $view = null;
|
private $view = null;
|
||||||
|
|
||||||
|
protected function applyObjectFilter(Query $query)
|
||||||
|
{
|
||||||
|
return $query->where('host_name', $this->host_name);
|
||||||
|
}
|
||||||
|
|
||||||
public function populate()
|
public function populate()
|
||||||
{
|
{
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace Icinga\Module\Monitoring\Object;
|
namespace Icinga\Module\Monitoring\Object;
|
||||||
|
|
||||||
use Icinga\Module\Monitoring\DataView\ServiceStatus;
|
use Icinga\Module\Monitoring\DataView\ServiceStatus;
|
||||||
|
use Icinga\Data\Db\Query;
|
||||||
|
|
||||||
class Service extends AbstractObject
|
class Service extends AbstractObject
|
||||||
{
|
{
|
||||||
@ -11,6 +12,12 @@ class Service extends AbstractObject
|
|||||||
public $prefix = 'service_';
|
public $prefix = 'service_';
|
||||||
private $view = null;
|
private $view = null;
|
||||||
|
|
||||||
|
protected function applyObjectFilter(Query $query)
|
||||||
|
{
|
||||||
|
return $query->where('service_host_name', $this->host_name)
|
||||||
|
->where('service_description', $this->service_description);
|
||||||
|
}
|
||||||
|
|
||||||
public function populate()
|
public function populate()
|
||||||
{
|
{
|
||||||
$this->fetchComments()
|
$this->fetchComments()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user