diff --git a/application/controllers/HostController.php b/application/controllers/HostController.php index 6d825458..9367749a 100644 --- a/application/controllers/HostController.php +++ b/application/controllers/HostController.php @@ -10,7 +10,7 @@ use Icinga\Module\Icingadb\Model\History; use Icinga\Module\Icingadb\Model\Host; use Icinga\Module\Icingadb\Model\Service; use Icinga\Module\Icingadb\Web\Controller; -use Icinga\Module\Icingadb\Widget\Detail\ObjectDetail; +use Icinga\Module\Icingadb\Widget\Detail\HostDetail; use Icinga\Module\Icingadb\Widget\Detail\QuickActions; use Icinga\Module\Icingadb\Widget\DowntimeList; use Icinga\Module\Icingadb\Widget\HostList; @@ -18,7 +18,6 @@ use Icinga\Module\Icingadb\Widget\ItemList\CommentList; use Icinga\Module\Icingadb\Widget\ItemList\HistoryList; use Icinga\Module\Icingadb\Widget\ServiceList; use Icinga\Module\Icingadb\Widget\ShowMore; -use ipl\Web\Url; class HostController extends Controller { @@ -57,7 +56,7 @@ class HostController extends Controller $this->addControl((new HostList([$this->host]))->setViewMode('minimal')); $this->addControl(new QuickActions($this->host)); - $this->addContent(new ObjectDetail($this->host)); + $this->addContent(new HostDetail($this->host)); $this->setAutorefreshInterval(10); } diff --git a/application/controllers/ServiceController.php b/application/controllers/ServiceController.php index 623b4b8c..812705ac 100644 --- a/application/controllers/ServiceController.php +++ b/application/controllers/ServiceController.php @@ -9,15 +9,14 @@ use Icinga\Module\Icingadb\Common\ServiceLinks; use Icinga\Module\Icingadb\Model\History; use Icinga\Module\Icingadb\Model\Service; use Icinga\Module\Icingadb\Web\Controller; -use Icinga\Module\Icingadb\Widget\Detail\ObjectDetail; use Icinga\Module\Icingadb\Widget\Detail\QuickActions; +use Icinga\Module\Icingadb\Widget\Detail\ServiceDetail; use Icinga\Module\Icingadb\Widget\DowntimeList; use Icinga\Module\Icingadb\Widget\ItemList\CommentList; use Icinga\Module\Icingadb\Widget\ItemList\HistoryList; use Icinga\Module\Icingadb\Widget\ServiceList; use Icinga\Module\Icingadb\Widget\ShowMore; use ipl\Sql\Sql; -use ipl\Web\Url; class ServiceController extends Controller { @@ -61,7 +60,7 @@ class ServiceController extends Controller $this->addControl((new ServiceList([$this->service]))->setViewMode('minimal')); $this->addControl(new QuickActions($this->service)); - $this->addContent(new ObjectDetail($this->service)); + $this->addContent(new ServiceDetail($this->service)); $this->setAutorefreshInterval(10); } diff --git a/library/Icingadb/Widget/Detail/HostDetail.php b/library/Icingadb/Widget/Detail/HostDetail.php new file mode 100644 index 00000000..b5f3e236 --- /dev/null +++ b/library/Icingadb/Widget/Detail/HostDetail.php @@ -0,0 +1,24 @@ +add([ + $this->createPluginOutput(), + $this->createEvents(), + $this->createActions(), + $this->createNotes(), + $this->createGroups(), + $this->createComments(), + $this->createDowntimes(), + $this->createNotifications(), + $this->createCheckStatistics(), + $this->createPerformanceData(), + $this->createCustomVars(), + $this->createFeatureToggles() + ]); + } +} diff --git a/library/Icingadb/Widget/Detail/ObjectDetail.php b/library/Icingadb/Widget/Detail/ObjectDetail.php index 675483d6..a31dff4e 100644 --- a/library/Icingadb/Widget/Detail/ObjectDetail.php +++ b/library/Icingadb/Widget/Detail/ObjectDetail.php @@ -6,11 +6,9 @@ use Icinga\Application\Config; use Icinga\Application\Icinga; use Icinga\Module\Icingadb\Common\Auth; use Icinga\Module\Icingadb\Common\HostLinks; -use Icinga\Module\Icingadb\Common\HostStates; use Icinga\Module\Icingadb\Common\Icons; use Icinga\Module\Icingadb\Common\Links; use Icinga\Module\Icingadb\Common\ServiceLinks; -use Icinga\Module\Icingadb\Common\ServiceStates; use Icinga\Module\Icingadb\Compat\CompatBackend; use Icinga\Module\Icingadb\Compat\CompatHost; use Icinga\Module\Icingadb\Compat\CompatObject; @@ -357,22 +355,4 @@ class ObjectDetail extends BaseHtmlElement return [$users, $usergroups]; } - - protected function assemble() - { - $this->add([ - $this->createPluginOutput(), - $this->createEvents(), - $this->createActions(), - $this->createNotes(), - $this->createGroups(), - $this->createComments(), - $this->createDowntimes(), - $this->createNotifications(), - $this->createCheckStatistics(), - $this->createPerformanceData(), - $this->createCustomVars(), - $this->createFeatureToggles() - ]); - } } diff --git a/library/Icingadb/Widget/Detail/ServiceDetail.php b/library/Icingadb/Widget/Detail/ServiceDetail.php new file mode 100644 index 00000000..241b2b8e --- /dev/null +++ b/library/Icingadb/Widget/Detail/ServiceDetail.php @@ -0,0 +1,24 @@ +add([ + $this->createPluginOutput(), + $this->createEvents(), + $this->createActions(), + $this->createNotes(), + $this->createGroups(), + $this->createComments(), + $this->createDowntimes(), + $this->createNotifications(), + $this->createCheckStatistics(), + $this->createPerformanceData(), + $this->createCustomVars(), + $this->createFeatureToggles() + ]); + } +}