mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-09-25 10:57:41 +02:00
Dashboard: show DB selection only for setups...
...with multiple DBs
This commit is contained in:
parent
e6563b9882
commit
06b6356de1
@ -10,13 +10,16 @@ class DashboardController extends ActionController
|
|||||||
{
|
{
|
||||||
protected function checkDirectorPermissions()
|
protected function checkDirectorPermissions()
|
||||||
{
|
{
|
||||||
|
// No special permissions required, override parent method
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function addDbSelection()
|
protected function addDbSelection()
|
||||||
{
|
{
|
||||||
$form = new DbSelectorForm($this->Window(), $this->listAllowedDbResourceNames());
|
if ($this->isMultiDbSetup()) {
|
||||||
$this->content()->add($form);
|
$form = new DbSelectorForm($this->Window(), $this->listAllowedDbResourceNames());
|
||||||
$form->handleRequest($this->getRequest());
|
$this->content()->add($form);
|
||||||
|
$form->handleRequest($this->getRequest());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -66,6 +66,11 @@ trait DirectorDb
|
|||||||
return preg_split('/\s*,\s*/', $string, -1, PREG_SPLIT_NO_EMPTY);
|
return preg_split('/\s*,\s*/', $string, -1, PREG_SPLIT_NO_EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function isMultiDbSetup()
|
||||||
|
{
|
||||||
|
return count($this->listAvailableDbResourceNames()) > 1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user