-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfiguration.php
32 lines (24 loc) · 1.17 KB
/
configuration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
use Icinga\Authentication\Auth;
use Icinga\Module\Grafana\ProvidedHook\Icingadb\IcingadbSupport;
$auth = Auth::getInstance();
$this->providePermission('grafana/graphconfig', $this->translate('Allow to configure graphs.'));
$this->providePermission('grafana/graph', $this->translate('Allow to view graphs in dashboards.'));
$this->providePermission('grafana/debug', $this->translate('Allow to see debug information for graphs.'));
$this->providePermission('grafana/showall', $this->translate('Allow access to see all graphs of a host.'));
$this->provideConfigTab('config', [
'title' => 'Configuration',
'label' => 'Configuration',
'url' => 'config'
]);
if ($auth->hasPermission('grafana/graphconfig')) {
$section = $this->menuSection('Grafana Graphs')->setUrl('grafana/graph')->setPriority(999)->setIcon('chart-area');
$section->add(N_('Graphs Configuration'))->setUrl('grafana/graph')->setPriority(30);
$section->add(N_('Module Configuration'))->setUrl('grafana/config')->setPriority(40);
$this->provideConfigTab('graph', [
'title' => 'Graphs',
'label' => 'Graphs',
'url' => 'graph'
]);
}
$this->provideJsFile('behavior/iframe.js');