From b18bc644404e02b57635bfcc8258e85abb141146 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:44:46 +0200 Subject: Adding upstream version 1.1.1. Signed-off-by: Daniel Baumann --- library/Icingadb/Widget/ItemTable/HostRowItem.php | 51 +++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 library/Icingadb/Widget/ItemTable/HostRowItem.php (limited to 'library/Icingadb/Widget/ItemTable/HostRowItem.php') diff --git a/library/Icingadb/Widget/ItemTable/HostRowItem.php b/library/Icingadb/Widget/ItemTable/HostRowItem.php new file mode 100644 index 0000000..cff70dd --- /dev/null +++ b/library/Icingadb/Widget/ItemTable/HostRowItem.php @@ -0,0 +1,51 @@ +list->addDetailFilterAttribute($this, Filter::equal('name', $this->item->name)) + ->addMultiselectFilterAttribute($this, Filter::equal('host.name', $this->item->name)); + } + + protected function assembleCell(BaseHtmlElement $cell, string $path, $value) + { + switch ($path) { + case 'name': + case 'display_name': + $cell->addHtml(new Link($this->item->$path, Links::host($this->item), [ + 'class' => 'subject', + 'title' => $this->item->$path + ])); + break; + case 'service.name': + case 'service.display_name': + $column = substr($path, 8); + $cell->addHtml(new Link( + $this->item->service->$column, + Links::service($this->item->service, $this->item) + )); + break; + default: + parent::assembleCell($cell, $path, $value); + } + } +} -- cgit v1.2.3