mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-02-20 00:10:09 -05:00
145 lines
4.2 KiB
PHP
145 lines
4.2 KiB
PHP
<?php
|
|
|
|
/* Icinga DB Web | (c) 2020 Icinga GmbH | GPLv2 */
|
|
|
|
namespace Icinga\Module\Icingadb
|
|
{
|
|
use Icinga\Application\Logger;
|
|
use Icinga\Authentication\Auth;
|
|
|
|
/** @var \Icinga\Application\Modules\Module $this */
|
|
|
|
$this->provideSetupWizard('Icinga\Module\Icingadb\Setup\IcingaDbWizard');
|
|
|
|
if (! $this::exists('ipl')) {
|
|
// TODO: Replace this once we have proper dependency management
|
|
Logger::warning(t('Module "ipl" is not enabled. This module is mandatory for Icinga DB Web'));
|
|
return;
|
|
}
|
|
|
|
if (! $this::exists('monitoring')) {
|
|
/**
|
|
* Search urls
|
|
*/
|
|
$this->provideSearchUrl(
|
|
$this->translate('Tactical Overview'),
|
|
'icingadb/tactical',
|
|
100
|
|
);
|
|
$this->provideSearchUrl(
|
|
$this->translate('Hosts'),
|
|
'icingadb/hosts?sort=host.state.severity&limit=10',
|
|
99
|
|
);
|
|
$this->provideSearchUrl(
|
|
$this->translate('Services'),
|
|
'icingadb/services?sort=service.state.severity&limit=10',
|
|
98
|
|
);
|
|
$this->provideSearchUrl(
|
|
$this->translate('Hostgroups'),
|
|
'icingadb/hostgroups?limit=10',
|
|
97
|
|
);
|
|
$this->provideSearchUrl(
|
|
$this->translate('Servicegroups'),
|
|
'icingadb/servicegroups?limit=10',
|
|
96
|
|
);
|
|
}
|
|
|
|
/** @var \Icinga\Application\Modules\Module $this */
|
|
$section = $this->menuSection('Icinga DB', [
|
|
'icon' => 'database',
|
|
'priority' => 30
|
|
]);
|
|
|
|
$section->add(N_('Hosts'), [
|
|
'priority' => 10,
|
|
'renderer' => 'HostProblemsBadge',
|
|
'url' => 'icingadb/hosts'
|
|
]);
|
|
$section->add(N_('Services'), [
|
|
'priority' => 20,
|
|
'renderer' => 'ServiceProblemsBadge',
|
|
'url' => 'icingadb/services'
|
|
]);
|
|
$section->add(N_('Downtimes'), [
|
|
'url' => 'icingadb/downtimes',
|
|
'priority' => 30
|
|
]);
|
|
$section->add(N_('Comments'), [
|
|
'url' => 'icingadb/comments',
|
|
'priority' => 40
|
|
]);
|
|
$section->add(N_('Notifications'), [
|
|
'url' => 'icingadb/notifications',
|
|
'priority' => 50
|
|
]);
|
|
|
|
$auth = Auth::getInstance();
|
|
if ($auth->hasPermission('*') || ! $auth->hasPermission('no-monitoring/contacts')) {
|
|
$section->add(N_('Users'), [
|
|
'url' => 'icingadb/users',
|
|
'priority' => 60
|
|
]);
|
|
$section->add(N_('User Groups'), [
|
|
'url' => 'icingadb/usergroups',
|
|
'priority' => 70
|
|
]);
|
|
}
|
|
|
|
$section->add(N_('Host Groups'), [
|
|
'url' => 'icingadb/hostgroups',
|
|
'priority' => 80
|
|
]);
|
|
$section->add(N_('Service Groups'), [
|
|
'url' => 'icingadb/servicegroups',
|
|
'priority' => 80
|
|
]);
|
|
$section->add(N_('History'), [
|
|
'url' => 'icingadb/history',
|
|
'priority' => 90
|
|
]);
|
|
$section->add(N_('Health'), [
|
|
'url' => 'icingadb/health',
|
|
'priority' => 100
|
|
]);
|
|
$section->add(N_('Tactical Overview'), [
|
|
'url' => 'icingadb/tactical',
|
|
'priority' => 110
|
|
]);
|
|
|
|
$this->provideConfigTab('database', [
|
|
'label' => t('Database'),
|
|
'title' => t('Configure the database backend'),
|
|
'url' => 'config/database'
|
|
]);
|
|
$this->provideConfigTab('redis', [
|
|
'label' => t('Redis'),
|
|
'title' => t('Configure the Redis connections'),
|
|
'url' => 'config/redis'
|
|
]);
|
|
$this->provideConfigTab('command-transports', [
|
|
'label' => t('Command Transports'),
|
|
'title' => t('Configure command transports'),
|
|
'url' => 'config/command-transports'
|
|
]);
|
|
$this->provideConfigTab('security', [
|
|
'label' => t('Security'),
|
|
'title' => t('Configure security related settings'),
|
|
'url' => 'config/security'
|
|
]);
|
|
|
|
$this->requireCssFile('balls.less', 'ipl');
|
|
|
|
$this->provideCssFile('common.less');
|
|
$this->provideCssFile('lists.less');
|
|
$this->provideCssFile('mixins.less');
|
|
$this->provideCssFile('widgets.less');
|
|
$this->provideCssFile('icinga-icons.less');
|
|
|
|
$this->provideJsFile('action-list.js');
|
|
$this->provideJsFile('migrate.js');
|
|
$this->provideJsFile('loadmore.js');
|
|
}
|