index: re-organize menu and overview link
This commit is contained in:
parent
0574217568
commit
84a788f36c
|
@ -6,13 +6,6 @@ use Icinga\Module\Director\Web\Controller\ActionController;
|
|||
|
||||
class IndexController extends ActionController
|
||||
{
|
||||
protected $globalTypes = array(
|
||||
'ApiUser',
|
||||
'Zone',
|
||||
'Endpoint',
|
||||
'TimePeriod',
|
||||
);
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
$this->setAutorefreshInterval(10);
|
||||
|
@ -29,24 +22,10 @@ class IndexController extends ActionController
|
|||
return;
|
||||
}
|
||||
|
||||
$this->addGlobalTypeTabs();
|
||||
$this->view->stats = $this->db()->getObjectSummary();
|
||||
$this->view->undeployedActivities = $this->db()->countActivitiesSinceLastDeployedConfig();
|
||||
if ((int) $this->view->stats['apiuser']->cnt_total === 0) {
|
||||
$this->view->form = $this->loadForm('kickstart')->setDb($this->db)->handleRequest();
|
||||
}
|
||||
}
|
||||
|
||||
protected function addGlobalTypeTabs()
|
||||
{
|
||||
$tabs = $this->getTabs();
|
||||
|
||||
foreach ($this->globalTypes as $tabType) {
|
||||
$ltabType = strtolower($tabType);
|
||||
$tabs->add($ltabType, array(
|
||||
'label' => $this->translate(ucfirst($ltabType) . 's'),
|
||||
'url' => sprintf('director/%ss', $ltabType)
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,14 +23,13 @@ $this->provideConfigTab('config', array(
|
|||
|
||||
$section = $this->menuSection(
|
||||
$this->translate('Icinga Director')
|
||||
)->setIcon(
|
||||
)->setUrl('director')->setPriority(60)->setIcon(
|
||||
'cubes'
|
||||
)->setRenderer(array(
|
||||
'SummaryNavigationItemRenderer',
|
||||
'state' => 'critical'
|
||||
));
|
||||
|
||||
$section->add($this->translate('Overview'))->setUrl('director')->setPriority(20);
|
||||
$section->add($this->translate('Hosts'))->setUrl('director/hosts')->setPriority(30);
|
||||
$section->add($this->translate('Services'))->setUrl('director/services')->setPriority(40);
|
||||
$section->add($this->translate('Commands'))->setUrl('director/commands')->setPriority(50);
|
||||
|
|
|
@ -24,10 +24,6 @@ abstract class ObjectsController extends ActionController
|
|||
|
||||
if (in_array(ucfirst($type), $this->globalTypes)) {
|
||||
$ltype = strtolower($type);
|
||||
$tabs->add('overview', array(
|
||||
'url' => 'director',
|
||||
'label' => $this->translate('Overview')
|
||||
));
|
||||
|
||||
foreach ($this->globalTypes as $tabType) {
|
||||
$ltabType = strtolower($tabType);
|
||||
|
|
Loading…
Reference in New Issue