-
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.
Introduce (Host|Service)Header class
- Use this class to create object header for host and service - Remove previous implementation - Add required changes to `object-header.less` - StateList: Remove now unused NoSubjectLink wip
- Loading branch information
1 parent
d8c6735
commit 892f40f
Showing
18 changed files
with
435 additions
and
310 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
51 changes: 51 additions & 0 deletions
51
library/Icingadb/Widget/Detail/BaseHostAndServiceHeader.php
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,51 @@ | ||
<?php | ||
|
||
/* Icinga DB Web | (c) 2024 Icinga GmbH | GPLv2 */ | ||
|
||
namespace Icinga\Module\Icingadb\Widget\Detail; | ||
|
||
use Icinga\Module\Icingadb\Common\ListItemMinimalLayout; | ||
use ipl\Html\Attributes; | ||
use ipl\Html\HtmlElement; | ||
use ipl\Html\Text; | ||
use ipl\Html\ValidHtml; | ||
use ipl\Orm\Model; | ||
|
||
class BaseHostAndServiceHeader extends BaseObjectHeader | ||
{ | ||
use HostAndServiceHeaderUtils; | ||
use ListItemMinimalLayout; | ||
|
||
protected function getObject(): Model | ||
{ | ||
return $this->object; | ||
} | ||
|
||
protected function getSubject(): ValidHtml | ||
{ | ||
return new HtmlElement( | ||
'span', | ||
Attributes::create(['class' => 'subject']), | ||
Text::create($this->object->display_name) | ||
); | ||
} | ||
|
||
protected function getStateBallSize(): string | ||
{ | ||
return ''; // not required because the parent class overrides the assembleVisual method | ||
} | ||
|
||
protected function wantIconImage(): bool | ||
{ | ||
return isset($this->object->icon_image->icon_image); | ||
} | ||
|
||
protected function assemble(): void | ||
{ | ||
$this->add([ | ||
$this->createVisual(), | ||
$this->createIconImage(), | ||
$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
Oops, something went wrong.