Skip to content

Commit

Permalink
RedundancygroupController: Add CSV/JSON export option for `members & …
Browse files Browse the repository at this point in the history
…children` tab
  • Loading branch information
sukhwinder33445 committed Jan 9, 2025
1 parent ffd5126 commit dea28f8
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions application/controllers/RedundancygroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Icinga\Module\Icingadb\Controllers;

use Icinga\Exception\NotFoundError;
use Icinga\Module\Icingadb\Common\CommandActions;
use Icinga\Module\Icingadb\Data\DependencyNodes;
use Icinga\Module\Icingadb\Model\DependencyNode;
Expand All @@ -17,8 +16,7 @@
use Icinga\Module\Icingadb\Widget\Detail\RedundancyGroupDetail;
use Icinga\Module\Icingadb\Widget\Detail\RedundancyGroupHeader;
use Icinga\Module\Icingadb\Widget\ItemList\DependencyNodeList;
use ipl\Html\HtmlElement;
use ipl\Html\Text;
use Generator;
use ipl\Orm\Query;
use ipl\Stdlib\Filter;
use ipl\Web\Control\LimitControl;
Expand Down Expand Up @@ -96,7 +94,7 @@ public function indexAction(): void
$this->addContent(new RedundancyGroupDetail($this->group));
}

public function membersAction(): void
public function membersAction(): Generator
{
$this->loadGroup();
$nodesQuery = $this->fetchNodes(true);
Expand Down Expand Up @@ -138,6 +136,8 @@ public function membersAction(): void

$nodesQuery->filter($filter);

yield $this->export($nodesQuery);

$this->addControl($paginationControl);
$this->addControl($sortControl);
$this->addControl($limitControl);
Expand All @@ -156,7 +156,7 @@ public function membersAction(): void
$this->setAutorefreshInterval(10);
}

public function childrenAction(): void
public function childrenAction(): Generator
{
$this->loadGroup();
$nodesQuery = $this->fetchNodes();
Expand Down Expand Up @@ -202,6 +202,8 @@ public function childrenAction(): void

$nodesQuery->filter($filter);

yield $this->export($nodesQuery);

$this->addControl($paginationControl);
$this->addControl($sortControl);
$this->addControl($limitControl);
Expand Down

0 comments on commit dea28f8

Please sign in to comment.