mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-04-15 21:59:47 -04:00
Don't show parents children tab if icingadb.schema does not support it
This commit is contained in:
parent
cda2f4bb05
commit
b69fb09c90
2 changed files with 24 additions and 15 deletions
|
|
@ -8,6 +8,7 @@ use ArrayIterator;
|
|||
use Icinga\Exception\NotFoundError;
|
||||
use Icinga\Module\Icingadb\Command\Object\GetObjectCommand;
|
||||
use Icinga\Module\Icingadb\Command\Transport\CommandTransport;
|
||||
use Icinga\Module\Icingadb\Common\Backend;
|
||||
use Icinga\Module\Icingadb\Common\CommandActions;
|
||||
use Icinga\Module\Icingadb\Common\HostLinks;
|
||||
use Icinga\Module\Icingadb\Common\Links;
|
||||
|
|
@ -434,13 +435,17 @@ class HostController extends Controller
|
|||
|
||||
protected function createTabs(): Tabs
|
||||
{
|
||||
$hasDependencyNode = DependencyNode::on($this->getDb())
|
||||
->columns([new Expression('1')])
|
||||
->filter(Filter::all(
|
||||
Filter::equal('host_id', $this->host->id),
|
||||
Filter::unlike('service_id', '*')
|
||||
))
|
||||
->first() !== null;
|
||||
if (! Backend::supportsDependencies()) {
|
||||
$hasDependencyNode = false;
|
||||
} else {
|
||||
$hasDependencyNode = DependencyNode::on($this->getDb())
|
||||
->columns([new Expression('1')])
|
||||
->filter(Filter::all(
|
||||
Filter::equal('host_id', $this->host->id),
|
||||
Filter::unlike('service_id', '*')
|
||||
))
|
||||
->first() !== null;
|
||||
}
|
||||
|
||||
$tabs = $this->getTabs()
|
||||
->add('index', [
|
||||
|
|
|
|||
|
|
@ -407,13 +407,17 @@ class ServiceController extends Controller
|
|||
|
||||
protected function createTabs(): Tabs
|
||||
{
|
||||
$hasDependecyNode = DependencyNode::on($this->getDb())
|
||||
->columns([new Expression('1')])
|
||||
->filter(Filter::all(
|
||||
Filter::equal('service_id', $this->service->id),
|
||||
Filter::equal('host_id', $this->service->host_id)
|
||||
))
|
||||
->first() !== null;
|
||||
if (! Backend::supportsDependencies()) {
|
||||
$hasDependencyNode = false;
|
||||
} else {
|
||||
$hasDependencyNode = DependencyNode::on($this->getDb())
|
||||
->columns([new Expression('1')])
|
||||
->filter(Filter::all(
|
||||
Filter::equal('service_id', $this->service->id),
|
||||
Filter::equal('host_id', $this->service->host_id)
|
||||
))
|
||||
->first() !== null;
|
||||
}
|
||||
|
||||
$tabs = $this->getTabs()
|
||||
->add('index', [
|
||||
|
|
@ -425,7 +429,7 @@ class ServiceController extends Controller
|
|||
'url' => ServiceLinks::history($this->service, $this->service->host)
|
||||
]);
|
||||
|
||||
if ($hasDependecyNode) {
|
||||
if ($hasDependencyNode) {
|
||||
$tabs->add('parents', [
|
||||
'label' => $this->translate('Parents'),
|
||||
'url' => Url::fromPath(
|
||||
|
|
|
|||
Loading…
Reference in a new issue