mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-05-28 04:34:08 -04:00
BpConfigBaseForm: Only add backends of enabled modules
This commit is contained in:
parent
55b0ddf8f6
commit
a6dad05445
1 changed files with 12 additions and 3 deletions
|
|
@ -3,6 +3,7 @@
|
|||
namespace Icinga\Module\Businessprocess\Web\Form;
|
||||
|
||||
use Icinga\Application\Config;
|
||||
use Icinga\Application\Icinga;
|
||||
use Icinga\Authentication\Auth;
|
||||
use Icinga\Module\Businessprocess\Storage\LegacyStorage;
|
||||
use Icinga\Module\Businessprocess\BpConfig;
|
||||
|
|
@ -17,9 +18,17 @@ abstract class BpConfigBaseForm extends QuickForm
|
|||
|
||||
protected function listAvailableBackends()
|
||||
{
|
||||
$keys = array_keys(Config::module('monitoring', 'backends')->toArray());
|
||||
$keys = array_combine($keys, $keys);
|
||||
$keys['_icingadb'] = 'Icinga DB';
|
||||
$keys = [];
|
||||
$moduleManager = Icinga::app()->getModuleManager();
|
||||
if ($moduleManager->hasEnabled('monitoring')) {
|
||||
$keys = array_keys(Config::module('monitoring', 'backends')->toArray());
|
||||
$keys = array_combine($keys, $keys);
|
||||
}
|
||||
|
||||
if ($moduleManager->hasEnabled('icingadb')) {
|
||||
$keys['_icingadb'] = 'Icinga DB';
|
||||
}
|
||||
|
||||
return $keys;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue