Skip to content

Commit 3f2dba6

Browse files
author
ibering
committed
ITC-3170 - SLA Module: SLA Host Status Overview for host groups (show tab)
1 parent 68177bc commit 3f2dba6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/Controller/HostgroupsController.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,14 @@ public function loadHostgroupWithHostsById($id = null) {
382382
if (Plugin::isLoaded('SLAModule')) {
383383
/** @var $HostsTable HostsTable */
384384
$HostsTable = TableRegistry::getTableLocator()->get('Hosts');
385-
$hasSLAHosts = $HostsTable->hasSLAHosts($id);
385+
$MY_RIGHTS = $this->MY_RIGHTS;
386+
if ($this->hasRootPrivileges) {
387+
$MY_RIGHTS = [];
388+
}
389+
$hostIds = $HostgroupsTable->getHostIdsByHostgroupId($hostgroup->get('id'), $MY_RIGHTS);
390+
if (!empty($hostIds)) {
391+
$hasSLAHosts = $HostsTable->hasSLAHosts($hostIds) > 0;
392+
}
386393
}
387394

388395
$User = new User($this->getUser());

webroot/js/scripts/ng.app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ var openITCOCKPIT = angular.module('openITCOCKPIT', ['gridster', 'ui.router', 'n
682682
},
683683
selectedTab: {
684684
value: null,
685-
array: true
685+
array: false
686686
}
687687
},
688688
controller: "HostgroupsExtendedController"

0 commit comments

Comments
 (0)