mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 18:59:05 +02:00
ConfigHealthItemRenderer: ask branch for count
This commit is contained in:
parent
085cec0eb7
commit
6ff5b0c8d7
@ -9,7 +9,7 @@ use Icinga\Application\Web;
|
|||||||
use Icinga\Authentication\Auth;
|
use Icinga\Authentication\Auth;
|
||||||
use Icinga\Module\Director\Db;
|
use Icinga\Module\Director\Db;
|
||||||
use Icinga\Module\Director\Db\Branch\Branch;
|
use Icinga\Module\Director\Db\Branch\Branch;
|
||||||
use Icinga\Module\Director\Db\Branch\BranchActivityStore;
|
use Icinga\Module\Director\Db\Branch\BranchStore;
|
||||||
use Icinga\Module\Director\Db\Migrations;
|
use Icinga\Module\Director\Db\Migrations;
|
||||||
use Icinga\Module\Director\KickstartHelper;
|
use Icinga\Module\Director\KickstartHelper;
|
||||||
use Icinga\Module\Director\Web\Controller\Extension\DirectorDb;
|
use Icinga\Module\Director\Web\Controller\Extension\DirectorDb;
|
||||||
@ -104,10 +104,9 @@ class ConfigHealthItemRenderer extends BadgeNavigationItemRenderer
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$branch = Branch::detect();
|
$branch = Branch::detect(new BranchStore($this->db()));
|
||||||
if ($branch->isBranch()) {
|
if ($branch->isBranch()) {
|
||||||
$store = new BranchActivityStore($this->db());
|
$count = $branch->getActivityCount();
|
||||||
$count = $store->count($branch->getUuid());
|
|
||||||
if ($count > 0) {
|
if ($count > 0) {
|
||||||
$this->directorState = self::STATE_PENDING;
|
$this->directorState = self::STATE_PENDING;
|
||||||
$this->count = $count;
|
$this->count = $count;
|
||||||
@ -131,8 +130,6 @@ class ConfigHealthItemRenderer extends BadgeNavigationItemRenderer
|
|||||||
),
|
),
|
||||||
$pendingChanges
|
$pendingChanges
|
||||||
);
|
);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user