mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
Assemble object details in concrete classes for hosts/services
This commit is contained in:
parent
81a9fd490e
commit
e32323e1d1
5 changed files with 52 additions and 26 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
24
library/Icingadb/Widget/Detail/HostDetail.php
Normal file
24
library/Icingadb/Widget/Detail/HostDetail.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Module\Icingadb\Widget\Detail;
|
||||
|
||||
class HostDetail extends ObjectDetail
|
||||
{
|
||||
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()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -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()
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
24
library/Icingadb/Widget/Detail/ServiceDetail.php
Normal file
24
library/Icingadb/Widget/Detail/ServiceDetail.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Module\Icingadb\Widget\Detail;
|
||||
|
||||
class ServiceDetail extends ObjectDetail
|
||||
{
|
||||
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()
|
||||
]);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue