diff --git a/application/controllers/HostController.php b/application/controllers/HostController.php index ca3cebcf5..2c6e6fa09 100644 --- a/application/controllers/HostController.php +++ b/application/controllers/HostController.php @@ -234,7 +234,7 @@ public function servicesAction(): \Generator $this->setAutorefreshInterval(10); } - public function parentsAction(): void + public function parentsAction(): \Generator { $nodesQuery = $this->fetchNodes(true); @@ -275,6 +275,8 @@ public function parentsAction(): void $nodesQuery->filter($filter); + yield $this->export($nodesQuery); + $this->addControl($paginationControl); $this->addControl($sortControl); $this->addControl($limitControl); @@ -293,7 +295,7 @@ public function parentsAction(): void $this->setAutorefreshInterval(10); } - public function childrenAction(): void + public function childrenAction(): \Generator { $nodesQuery = $this->fetchNodes(); @@ -337,6 +339,8 @@ public function childrenAction(): void $nodesQuery->filter($filter); + yield $this->export($nodesQuery); + $this->addControl($paginationControl); $this->addControl($sortControl); $this->addControl($limitControl); diff --git a/application/controllers/ServiceController.php b/application/controllers/ServiceController.php index 7ca6f4399..886638f06 100644 --- a/application/controllers/ServiceController.php +++ b/application/controllers/ServiceController.php @@ -100,7 +100,7 @@ public function indexAction(): void $this->setAutorefreshInterval(10); } - public function parentsAction(): void + public function parentsAction(): \Generator { $nodesQuery = $this->fetchNodes(true); @@ -142,6 +142,8 @@ public function parentsAction(): void $nodesQuery->filter($filter); + yield $this->export($nodesQuery); + $this->addControl($paginationControl); $this->addControl($sortControl); $this->addControl($limitControl); @@ -160,7 +162,7 @@ public function parentsAction(): void $this->setAutorefreshInterval(10); } - public function childrenAction(): void + public function childrenAction(): \Generator { $nodesQuery = $this->fetchNodes(); @@ -205,6 +207,8 @@ public function childrenAction(): void $nodesQuery->filter($filter); + yield $this->export($nodesQuery); + $this->addControl($paginationControl); $this->addControl($sortControl); $this->addControl($limitControl); diff --git a/library/Icingadb/Data/CsvResultSetUtils.php b/library/Icingadb/Data/CsvResultSetUtils.php index 61995d3a2..862260cc8 100644 --- a/library/Icingadb/Data/CsvResultSetUtils.php +++ b/library/Icingadb/Data/CsvResultSetUtils.php @@ -6,6 +6,7 @@ use DateTime; use DateTimeZone; +use Icinga\Module\Icingadb\Model\DependencyNode; use Icinga\Module\Icingadb\Model\Host; use Icinga\Module\Icingadb\Model\Service; use ipl\Orm\Model; @@ -67,7 +68,8 @@ protected function extractKeysAndValues(Model $model, string $path = ''): array public static function stream(Query $query): void { - if ($query->getModel() instanceof Host || $query->getModel() instanceof Service) { + $model = $query->getModel(); + if ($model instanceof Host || $model instanceof Service || $model instanceof DependencyNode) { $query->setResultSetClass(VolatileCsvResults::class); } else { $query->setResultSetClass(__CLASS__); diff --git a/library/Icingadb/Data/JsonResultSetUtils.php b/library/Icingadb/Data/JsonResultSetUtils.php index 8b8857122..dc78fe094 100644 --- a/library/Icingadb/Data/JsonResultSetUtils.php +++ b/library/Icingadb/Data/JsonResultSetUtils.php @@ -6,6 +6,7 @@ use DateTime; use DateTimeZone; +use Icinga\Module\Icingadb\Model\DependencyNode; use Icinga\Module\Icingadb\Model\Host; use Icinga\Module\Icingadb\Model\Service; use Icinga\Util\Json; @@ -61,7 +62,8 @@ protected function createObject(Model $model): array public static function stream(Query $query): void { - if ($query->getModel() instanceof Host || $query->getModel() instanceof Service) { + $model = $query->getModel(); + if ($model instanceof Host || $model instanceof Service || $model instanceof DependencyNode) { $query->setResultSetClass(VolatileJsonResults::class); } else { $query->setResultSetClass(__CLASS__);