mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
Make list items in host and service headers non-clickable
This commit is contained in:
parent
64f13209a1
commit
76c7c04a26
5 changed files with 13 additions and 21 deletions
|
|
@ -64,6 +64,7 @@ class HostController extends Controller
|
|||
|
||||
$this->addControl((new HostList([$this->host]))
|
||||
->setViewMode('minimal')
|
||||
->setDetailActionsDisabled()
|
||||
->setNoSubjectLink());
|
||||
$this->addControl(new QuickActions($this->host));
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ class ServiceController extends Controller
|
|||
|
||||
$this->addControl((new ServiceList([$this->service]))
|
||||
->setViewMode('minimal')
|
||||
->setDetailActionsDisabled()
|
||||
->setNoSubjectLink());
|
||||
$this->addControl(new QuickActions($this->service));
|
||||
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@ abstract class BaseHostListItem extends StateListItem
|
|||
{
|
||||
parent::init();
|
||||
|
||||
$this->setMultiselectFilter(Filter::equal('host.name', $this->item->name));
|
||||
$this->setDetailFilter(Filter::equal('name', $this->item->name));
|
||||
|
||||
if ($this->list->getNoSubjectLink()) {
|
||||
$this->setNoSubjectLink();
|
||||
}
|
||||
|
||||
$this->list->addDetailFilterAttribute($this, Filter::equal('name', $this->item->name))
|
||||
->addMultiselectFilterAttribute($this, Filter::equal('host.name', $this->item->name));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ namespace Icinga\Module\Icingadb\Widget;
|
|||
|
||||
use Icinga\Module\Icingadb\Common\BaseFilter;
|
||||
use Icinga\Module\Icingadb\Common\BaseTableRowItem;
|
||||
use Icinga\Module\Icingadb\Common\DetailActions;
|
||||
use InvalidArgumentException;
|
||||
use ipl\Html\BaseHtmlElement;
|
||||
use ipl\Web\Url;
|
||||
|
||||
/**
|
||||
* Base class for item lists
|
||||
|
|
@ -18,8 +18,9 @@ use ipl\Web\Url;
|
|||
abstract class BaseItemList extends BaseHtmlElement
|
||||
{
|
||||
use BaseFilter;
|
||||
use DetailActions;
|
||||
|
||||
protected $baseAttributes = ['class' => 'action-list item-list', 'data-base-target' => '_next'];
|
||||
protected $baseAttributes = ['class' => 'item-list', 'data-base-target' => '_next'];
|
||||
|
||||
/** @var iterable */
|
||||
protected $data;
|
||||
|
|
@ -41,6 +42,7 @@ abstract class BaseItemList extends BaseHtmlElement
|
|||
|
||||
$this->addAttributes($this->baseAttributes);
|
||||
|
||||
$this->initializeDetailActions();
|
||||
$this->init();
|
||||
}
|
||||
|
||||
|
|
@ -55,20 +57,6 @@ abstract class BaseItemList extends BaseHtmlElement
|
|||
{
|
||||
}
|
||||
|
||||
protected function setMultiselectUrl(Url $url)
|
||||
{
|
||||
$this->addAttributes(['data-icinga-multiselect-url' => $url]);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function setDetailUrl(Url $url)
|
||||
{
|
||||
$this->addAttributes(['data-icinga-detail-url' => $url]);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function assemble()
|
||||
{
|
||||
$itemClass = $this->getItemClass();
|
||||
|
|
|
|||
|
|
@ -51,13 +51,15 @@ abstract class BaseServiceListItem extends StateListItem
|
|||
$this->setNoSubjectLink();
|
||||
}
|
||||
|
||||
$this->setMultiselectFilter(
|
||||
$this->list->addMultiselectFilterAttribute(
|
||||
$this,
|
||||
Filter::all(
|
||||
Filter::equal('service.name', $this->item->name),
|
||||
Filter::equal('host.name', $this->item->host->name)
|
||||
)
|
||||
);
|
||||
$this->setDetailFilter(
|
||||
$this->list->addDetailFilterAttribute(
|
||||
$this,
|
||||
Filter::all(
|
||||
Filter::equal('name', $this->item->name),
|
||||
Filter::equal('host.name', $this->item->host->name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue