-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
892f40f
commit 0a1ecca
Showing
8 changed files
with
134 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
/* Icinga DB Web | (c) 2024 Icinga GmbH | GPLv2 */ | ||
|
||
namespace Icinga\Module\Icingadb\Widget\Detail; | ||
|
||
use Icinga\Module\Icingadb\Model\Hostgroupsummary; | ||
use ipl\Html\BaseHtmlElement; | ||
use ipl\Html\HtmlElement; | ||
use ipl\Html\Text; | ||
use ipl\Stdlib\Filter; | ||
|
||
/** | ||
* @property Hostgroupsummary $object | ||
*/ | ||
class HostgroupHeader extends BaseObjectHeader | ||
{ | ||
protected $defaultAttributes = ['class' => 'hostgroup-header']; | ||
|
||
protected function assembleTitle(BaseHtmlElement $title): void | ||
{ | ||
$title->addHtml($this->createSubject()); | ||
$title->addHtml(new HtmlElement('span', null, Text::create($this->object->name))); | ||
} | ||
|
||
protected function assembleHeader(BaseHtmlElement $header): void | ||
{ | ||
$header->addHtml($this->createTitle()); | ||
|
||
$hostStats = (new HostStatistics($this->object)) | ||
->setBaseFilter(Filter::equal('hostgroup.name', $this->object->name)); | ||
|
||
|
||
$serviceStats = (new ServiceStatistics($this->object)) | ||
->setBaseFilter(Filter::equal('hostgroup.name', $this->object->name)); | ||
|
||
$header->addHtml($hostStats, $serviceStats); | ||
} | ||
|
||
protected function assembleMain(BaseHtmlElement $main): void | ||
{ | ||
$main->addHtml($this->createHeader()); | ||
} | ||
|
||
protected function assemble(): void | ||
{ | ||
$this->addHtml($this->createMain()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Icinga\Module\Icingadb\Widget\Detail; | ||
|
||
use ipl\Html\BaseHtmlElement; | ||
use ipl\Stdlib\Filter; | ||
|
||
class ServicegroupHeader extends HostgroupHeader | ||
{ | ||
protected function assembleHeader(BaseHtmlElement $header): void | ||
{ | ||
$header->addHtml($this->createTitle()); | ||
|
||
$serviceStats = (new ServiceStatistics($this->object)) | ||
->setBaseFilter(Filter::equal('servicegroup.name', $this->object->name)); | ||
|
||
$header->addHtml($serviceStats); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters