2015-06-22 11:21:41 -04:00
|
|
|
<?php
|
|
|
|
|
|
2026-02-23 16:28:48 -05:00
|
|
|
// SPDX-FileCopyrightText: 2018 Icinga GmbH <https://icinga.com>
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
2017-08-30 07:31:13 -04:00
|
|
|
/** @var \Icinga\Application\Modules\Module $this */
|
|
|
|
|
|
2017-09-01 11:00:20 -04:00
|
|
|
/** @var \Icinga\Application\Modules\MenuItemContainer $section */
|
2022-02-17 05:04:50 -05:00
|
|
|
|
|
|
|
|
use Icinga\Module\Graphite\ProvidedHook\Icingadb\IcingadbSupport;
|
|
|
|
|
|
2017-09-19 04:36:36 -04:00
|
|
|
$section = $this->menuSection(N_('Graphite'), ['icon' => 'chart-area']);
|
2022-02-17 05:04:50 -05:00
|
|
|
|
|
|
|
|
if ($this::exists('icingadb') && IcingadbSupport::useIcingaDbAsBackend()) {
|
2022-02-23 05:34:29 -05:00
|
|
|
$section->add(N_('Hosts'), ['url' => 'graphite/hosts']);
|
|
|
|
|
$section->add(N_('Services'), ['url' => 'graphite/services']);
|
2022-02-17 05:04:50 -05:00
|
|
|
} else {
|
2022-02-23 05:34:29 -05:00
|
|
|
$section->add(N_('Hosts'), ['url' => 'graphite/list/hosts']);
|
|
|
|
|
$section->add(N_('Services'), ['url' => 'graphite/list/services']);
|
2022-02-17 05:04:50 -05:00
|
|
|
}
|
2015-06-22 11:21:41 -04:00
|
|
|
|
2017-08-30 08:55:36 -04:00
|
|
|
$this->provideConfigTab('backend', array(
|
|
|
|
|
'title' => $this->translate('Configure the Graphite Web backend'),
|
|
|
|
|
'label' => $this->translate('Backend'),
|
2017-09-26 05:20:49 -04:00
|
|
|
'url' => 'config/backend'
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
$this->provideConfigTab('advanced', array(
|
|
|
|
|
'title' => $this->translate('Advanced configuration'),
|
|
|
|
|
'label' => $this->translate('Advanced'),
|
|
|
|
|
'url' => 'config/advanced'
|
2017-08-30 08:55:36 -04:00
|
|
|
));
|
|
|
|
|
|
2018-03-28 12:01:48 -04:00
|
|
|
$this->providePermission('graphite/debug', $this->translate('Allow debugging directly via the web UI'));
|