icingaweb2-module-graphite/configuration.php
Eric Lippmann 05d6f5890a License source files as GPL-3.0-or-later
Add SPDX license headers and mark source files as GPL-3.0-or-later to
preserve the option to relicense under later GPL versions.
2026-03-11 21:48:49 +01:00

34 lines
1.2 KiB
PHP

<?php
// SPDX-FileCopyrightText: 2018 Icinga GmbH <https://icinga.com>
// SPDX-License-Identifier: GPL-3.0-or-later
/** @var \Icinga\Application\Modules\Module $this */
/** @var \Icinga\Application\Modules\MenuItemContainer $section */
use Icinga\Module\Graphite\ProvidedHook\Icingadb\IcingadbSupport;
$section = $this->menuSection(N_('Graphite'), ['icon' => 'chart-area']);
if ($this::exists('icingadb') && IcingadbSupport::useIcingaDbAsBackend()) {
$section->add(N_('Hosts'), ['url' => 'graphite/hosts']);
$section->add(N_('Services'), ['url' => 'graphite/services']);
} else {
$section->add(N_('Hosts'), ['url' => 'graphite/list/hosts']);
$section->add(N_('Services'), ['url' => 'graphite/list/services']);
}
$this->provideConfigTab('backend', array(
'title' => $this->translate('Configure the Graphite Web backend'),
'label' => $this->translate('Backend'),
'url' => 'config/backend'
));
$this->provideConfigTab('advanced', array(
'title' => $this->translate('Advanced configuration'),
'label' => $this->translate('Advanced'),
'url' => 'config/advanced'
));
$this->providePermission('graphite/debug', $this->translate('Allow debugging directly via the web UI'));