icingadb-web/library/Icingadb/Widget/ItemTable/ServicegroupTable.php

39 lines
934 B
PHP
Raw Normal View History

<?php
/* Icinga DB Web | (c) 2020 Icinga GmbH | GPLv2 */
namespace Icinga\Module\Icingadb\Widget\ItemTable;
2023-08-09 08:25:44 -04:00
use Icinga\Module\Icingadb\Common\DetailActions;
use Icinga\Module\Icingadb\Common\ViewMode;
2023-08-09 08:25:44 -04:00
use ipl\Web\Common\BaseItemTable;
use ipl\Web\Url;
class ServicegroupTable extends BaseItemTable
{
2023-08-09 08:25:44 -04:00
use DetailActions;
use ViewMode;
protected $defaultAttributes = ['class' => 'servicegroup-table'];
2023-08-09 08:25:44 -04:00
protected function init(): void
{
2023-08-09 08:25:44 -04:00
$this->initializeDetailActions();
$this->setDetailUrl(Url::fromPath('icingadb/servicegroup'));
}
protected function getLayout(): string
{
return $this->getViewMode() === 'grid'
? 'group-grid'
: parent::getLayout();
}
protected function getItemClass(): string
{
return $this->getViewMode() === 'grid'
? ServicegroupGridCell::class
: ServicegroupTableRow::class;
}
}