diff --git a/application/tables/IcingaCommandTable.php b/application/tables/IcingaCommandTable.php index cb7a19ad..b7e0b10a 100644 --- a/application/tables/IcingaCommandTable.php +++ b/application/tables/IcingaCommandTable.php @@ -2,9 +2,9 @@ namespace Icinga\Module\Director\Tables; -use Icinga\Module\Director\Web\Table\QuickTable; +use Icinga\Module\Director\Web\Table\IcingaObjectTable; -class IcingaCommandTable extends QuickTable +class IcingaCommandTable extends IcingaObjectTable { protected $searchColumns = array( 'command', @@ -29,23 +29,6 @@ class IcingaCommandTable extends QuickTable } } - protected function listTableClasses() - { - return array_merge(array('check-commands'), parent::listTableClasses()); - } - - protected function getRowClasses($row) - { - switch ($row->object_type) { - case 'object': - return 'icinga-object'; - case 'template': - return 'icinga-template'; - case 'external_object': - return 'icinga-object-external'; - } - } - public function getTitles() { $view = $this->view(); diff --git a/application/tables/IcingaEndpointTable.php b/application/tables/IcingaEndpointTable.php index 7a424440..c2a41a61 100644 --- a/application/tables/IcingaEndpointTable.php +++ b/application/tables/IcingaEndpointTable.php @@ -2,9 +2,9 @@ namespace Icinga\Module\Director\Tables; -use Icinga\Module\Director\Web\Table\QuickTable; +use Icinga\Module\Director\Web\Table\IcingaObjectTable; -class IcingaEndpointTable extends QuickTable +class IcingaEndpointTable extends IcingaObjectTable { protected $searchColumns = array( 'endpoint', diff --git a/application/tables/IcingaHostTable.php b/application/tables/IcingaHostTable.php index 172ddc7d..22de08ec 100644 --- a/application/tables/IcingaHostTable.php +++ b/application/tables/IcingaHostTable.php @@ -3,9 +3,9 @@ namespace Icinga\Module\Director\Tables; use Icinga\Data\Limitable; -use Icinga\Module\Director\Web\Table\QuickTable; +use Icinga\Module\Director\Web\Table\IcingaObjectTable; -class IcingaHostTable extends QuickTable +class IcingaHostTable extends IcingaObjectTable { protected $searchColumns = array( 'host', @@ -14,11 +14,12 @@ class IcingaHostTable extends QuickTable public function getColumns() { return array( - 'id' => 'h.id', - 'host' => 'h.object_name', - 'address' => 'h.address', - 'zone' => 'z.object_name', - 'parents' => "GROUP_CONCAT(ih.object_name ORDER BY hi.weight SEPARATOR ', ')" + 'id' => 'h.id', + 'host' => 'h.object_name', + 'object_type' => 'h.object_type', + 'address' => 'h.address', + 'zone' => 'z.object_name', + 'parents' => "GROUP_CONCAT(ih.object_name ORDER BY hi.weight SEPARATOR ', ')" ); } diff --git a/application/tables/IcingaServiceTable.php b/application/tables/IcingaServiceTable.php index 25f75818..1167d42b 100644 --- a/application/tables/IcingaServiceTable.php +++ b/application/tables/IcingaServiceTable.php @@ -2,9 +2,9 @@ namespace Icinga\Module\Director\Tables; -use Icinga\Module\Director\Web\Table\QuickTable; +use Icinga\Module\Director\Web\Table\IcingaObjectTable; -class IcingaServiceTable extends QuickTable +class IcingaServiceTable extends IcingaObjectTable { protected $searchColumns = array( 'service', @@ -14,10 +14,11 @@ class IcingaServiceTable extends QuickTable public function getColumns() { return array( - 'id' => 's.id', - 'host_id' => 's.host_id', - 'host' => 'h.object_name', - 'service' => 's.object_name', + 'id' => 's.id', + 'host_id' => 's.host_id', + 'host' => 'h.object_name', + 'service' => 's.object_name', + 'object_type' => 's.object_type', ); } diff --git a/application/tables/IcingaUserTable.php b/application/tables/IcingaUserTable.php index eeb7e960..f1e39ea7 100644 --- a/application/tables/IcingaUserTable.php +++ b/application/tables/IcingaUserTable.php @@ -2,9 +2,9 @@ namespace Icinga\Module\Director\Tables; -use Icinga\Module\Director\Web\Table\QuickTable; +use Icinga\Module\Director\Web\Table\IcingaObjectTable; -class IcingaUserTable extends QuickTable +class IcingaUserTable extends IcingaObjectTable { protected $searchColumns = array( 'user', @@ -14,6 +14,7 @@ class IcingaUserTable extends QuickTable { return array( 'id' => 'u.id', + 'object_type' => 'u.object_type', 'user' => 'u.object_name', // 'display_name' => 'u.display_name', 'email' => 'u.email', diff --git a/application/tables/IcingaZoneTable.php b/application/tables/IcingaZoneTable.php index 2de2fffb..2dc2db19 100644 --- a/application/tables/IcingaZoneTable.php +++ b/application/tables/IcingaZoneTable.php @@ -2,9 +2,9 @@ namespace Icinga\Module\Director\Tables; -use Icinga\Module\Director\Web\Table\QuickTable; +use Icinga\Module\Director\Web\Table\IcingaObjectTable; -class IcingaZoneTable extends QuickTable +class IcingaZoneTable extends IcingaObjectTable { protected $searchColumns = array( 'zone', @@ -19,9 +19,10 @@ class IcingaZoneTable extends QuickTable } return array( - 'id' => 'z.id', - 'zone' => 'z.object_name', - 'endpoints' => $endpoints, + 'id' => 'z.id', + 'zone' => 'z.object_name', + 'object_type' => 'z.object_type', + 'endpoints' => $endpoints, ); } diff --git a/library/Director/Web/Table/IcingaObjectTable.php b/library/Director/Web/Table/IcingaObjectTable.php new file mode 100644 index 00000000..664209d8 --- /dev/null +++ b/library/Director/Web/Table/IcingaObjectTable.php @@ -0,0 +1,23 @@ +object_type) { + case 'object': + return 'icinga-object'; + case 'template': + return 'icinga-template'; + case 'external_object': + return 'icinga-object-external'; + } + } + + protected function listTableClasses() + { + return array_merge(array('icinga-objects'), parent::listTableClasses()); + } +} diff --git a/public/css/module.less b/public/css/module.less index 7ecc5526..237b5793 100644 --- a/public/css/module.less +++ b/public/css/module.less @@ -365,7 +365,7 @@ table.syncstate { } } -table.check-commands { +table.icinga-objects { tr td:first-child { padding-left: 2em; &::before {