diff --git a/application/controllers/HostController.php b/application/controllers/HostController.php index 47e649d7..e3eedc16 100644 --- a/application/controllers/HostController.php +++ b/application/controllers/HostController.php @@ -15,6 +15,7 @@ use Icinga\Module\Icingadb\Model\History; use Icinga\Module\Icingadb\Model\Host; use Icinga\Module\Icingadb\Model\Service; use Icinga\Module\Icingadb\Model\ServicestateSummary; +use Icinga\Module\Icingadb\Redis\VolatileStateResults; use Icinga\Module\Icingadb\Web\Controller; use Icinga\Module\Icingadb\Widget\Detail\HostDetail; use Icinga\Module\Icingadb\Widget\Detail\HostInspectionDetail; @@ -38,6 +39,7 @@ class HostController extends Controller $name = $this->params->getRequired('name'); $query = Host::on($this->getDb())->with(['state', 'icon_image']); + $query->setResultSetClass(VolatileStateResults::class); $query->getSelectBase() ->where(['host.name = ?' => $name]); @@ -188,6 +190,7 @@ class HostController extends Controller 'host', 'host.state' ]); + $services->setResultSetClass(VolatileStateResults::class); $services ->getSelectBase() diff --git a/application/controllers/HostgroupController.php b/application/controllers/HostgroupController.php index 383692d3..458c39e4 100644 --- a/application/controllers/HostgroupController.php +++ b/application/controllers/HostgroupController.php @@ -7,6 +7,7 @@ namespace Icinga\Module\Icingadb\Controllers; use Icinga\Exception\NotFoundError; use Icinga\Module\Icingadb\Model\Host; use Icinga\Module\Icingadb\Model\Hostgroupsummary; +use Icinga\Module\Icingadb\Redis\VolatileStateResults; use Icinga\Module\Icingadb\Web\Controller; use Icinga\Module\Icingadb\Widget\ItemList\HostList; use Icinga\Module\Icingadb\Widget\ItemList\HostgroupList; @@ -46,6 +47,7 @@ class HostgroupController extends Controller $db = $this->getDb(); $hosts = Host::on($db)->with(['state', 'state.last_comment', 'icon_image'])->utilize('hostgroup'); + $hosts->setResultSetClass(VolatileStateResults::class); $hosts->getSelectBase()->where(['host_hostgroup.id = ?' => $this->hostgroup->id]); $this->applyRestrictions($hosts); diff --git a/application/controllers/HostsController.php b/application/controllers/HostsController.php index 2c51e7e9..512d33cc 100644 --- a/application/controllers/HostsController.php +++ b/application/controllers/HostsController.php @@ -9,6 +9,7 @@ use Icinga\Module\Icingadb\Common\CommandActions; use Icinga\Module\Icingadb\Common\Links; use Icinga\Module\Icingadb\Model\Host; use Icinga\Module\Icingadb\Model\HoststateSummary; +use Icinga\Module\Icingadb\Redis\VolatileStateResults; use Icinga\Module\Icingadb\Util\FeatureStatus; use Icinga\Module\Icingadb\Web\Control\SearchBar\ObjectSuggestions; use Icinga\Module\Icingadb\Web\Controller; @@ -36,6 +37,7 @@ class HostsController extends Controller $db = $this->getDb(); $hosts = Host::on($db)->with(['state', 'icon_image', 'state.last_comment']); + $hosts->setResultSetClass(VolatileStateResults::class); $this->handleSearchRequest($hosts); @@ -124,6 +126,7 @@ class HostsController extends Controller $db = $this->getDb(); $hosts = Host::on($db)->with(['state', 'icon_image']); + $hosts->setResultSetClass(VolatileStateResults::class); $summary = HoststateSummary::on($db)->with(['state']); $this->filter($hosts); @@ -194,6 +197,7 @@ class HostsController extends Controller $db = $this->getDb(); $hosts = Host::on($db)->with('state'); + $hosts->setResultSetClass(VolatileStateResults::class); switch ($this->getRequest()->getActionName()) { case 'acknowledge': diff --git a/application/controllers/ServiceController.php b/application/controllers/ServiceController.php index 83d9463c..be6de10b 100644 --- a/application/controllers/ServiceController.php +++ b/application/controllers/ServiceController.php @@ -13,6 +13,7 @@ use Icinga\Module\Icingadb\Common\ServiceLinks; use Icinga\Module\Icingadb\Hook\TabHook\HookActions; use Icinga\Module\Icingadb\Model\History; use Icinga\Module\Icingadb\Model\Service; +use Icinga\Module\Icingadb\Redis\VolatileStateResults; use Icinga\Module\Icingadb\Web\Controller; use Icinga\Module\Icingadb\Widget\Detail\QuickActions; use Icinga\Module\Icingadb\Widget\Detail\ServiceDetail; @@ -41,6 +42,8 @@ class ServiceController extends Controller 'host', 'host.state' ]); + $query->setResultSetClass(VolatileStateResults::class); + $query->getSelectBase() ->where(['service.name = ?' => $name]) ->where(['service_host.name = ?' => $hostName]); diff --git a/application/controllers/ServicegroupController.php b/application/controllers/ServicegroupController.php index 91e59a0f..7ee8e862 100644 --- a/application/controllers/ServicegroupController.php +++ b/application/controllers/ServicegroupController.php @@ -7,6 +7,7 @@ namespace Icinga\Module\Icingadb\Controllers; use Icinga\Exception\NotFoundError; use Icinga\Module\Icingadb\Model\Service; use Icinga\Module\Icingadb\Model\ServicegroupSummary; +use Icinga\Module\Icingadb\Redis\VolatileStateResults; use Icinga\Module\Icingadb\Web\Controller; use Icinga\Module\Icingadb\Widget\ItemList\ServiceList; use Icinga\Module\Icingadb\Widget\ItemList\ServicegroupList; @@ -52,6 +53,7 @@ class ServicegroupController extends Controller 'host', 'host.state' ])->utilize('servicegroup'); + $services->setResultSetClass(VolatileStateResults::class); $services->getSelectBase()->where(['service_servicegroup.id = ?' => $this->servicegroup->id]); $this->applyRestrictions($services); diff --git a/application/controllers/ServicesController.php b/application/controllers/ServicesController.php index f9061bd8..0a31c957 100644 --- a/application/controllers/ServicesController.php +++ b/application/controllers/ServicesController.php @@ -10,6 +10,7 @@ use Icinga\Module\Icingadb\Common\Links; use Icinga\Module\Icingadb\Data\PivotTable; use Icinga\Module\Icingadb\Model\Service; use Icinga\Module\Icingadb\Model\ServicestateSummary; +use Icinga\Module\Icingadb\Redis\VolatileStateResults; use Icinga\Module\Icingadb\Util\FeatureStatus; use Icinga\Module\Icingadb\Web\Control\ProblemToggle; use Icinga\Module\Icingadb\Web\Control\SearchBar\ObjectSuggestions; @@ -45,6 +46,7 @@ class ServicesController extends Controller 'host.state', 'icon_image' ]); + $services->setResultSetClass(VolatileStateResults::class); $this->handleSearchRequest($services); @@ -139,6 +141,7 @@ class ServicesController extends Controller 'host', 'host.state' ]); + $services->setResultSetClass(VolatileStateResults::class); $summary = ServicestateSummary::on($db)->with(['state']); $this->filter($services); @@ -214,6 +217,7 @@ class ServicesController extends Controller 'host', 'host.state' ]); + $query->setResultSetClass(VolatileStateResults::class); $this->handleSearchRequest($query); @@ -317,6 +321,7 @@ class ServicesController extends Controller 'host', 'host.state' ]); + $services->setResultSetClass(VolatileStateResults::class); switch ($this->getRequest()->getActionName()) { case 'acknowledge':