Skip to content

Commit

Permalink
Merge pull request #558 from it-novum/ITC-1110
Browse files Browse the repository at this point in the history
[*] add main container and shared container info in host browser devi…
  • Loading branch information
oliver-mueller authored May 3, 2017
2 parents ddaca2f + e778560 commit f064256
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
17 changes: 16 additions & 1 deletion app/Controller/HostsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2455,20 +2455,35 @@ function browser($id = null) {

$servicestatus = $this->Servicestatus->byUuid(Hash::extract($services, '{n}.Service.uuid'));
$username = $this->Auth->user('full_name');

$mainContainer = $this->Tree->treePath($host['Host']['container_id'], ['delimiter'=> '/']);
//get the already shared containers
if (is_array($host['Container']) && !empty($host['Container'])) {
foreach ($host['Container'] as $container){
if($container != $host['Host']['container_id']){
$sharedContainers[] = $this->Tree->treePath($container, ['delimiter'=> '/']);
}
}
} else {
$sharedContainers = [];
}


$this->set(compact([
'host',
'hoststatus',
'servicestatus',
'services',
'username',
'path',
'commandarguments',
'acknowledged',
'docuExists',
'ContactsInherited',
'parenthosts',
'allowEdit',
'ticketSystem',
'mainContainer',
'sharedContainers',
])
);

Expand Down
6 changes: 6 additions & 0 deletions app/View/Hosts/browser.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,12 @@

</div>
<div id="tab2" class="tab-pane fade">
<strong><?php echo __('Container') ?>:</strong>
<?php echo h($mainContainer); ?>
<br/>
<strong><?php echo __('Shared containers') ?>:</strong>
<?php echo empty($sharedContainers) ? '-' : h(implode( ', ', $sharedContainers));?>
<br/>
<strong><?php echo __('Check period') ?>
:</strong> <?php echo h($host['CheckPeriod']['name']); ?><br/>
<strong><?php echo __('Check interval') ?>:</strong>
Expand Down

0 comments on commit f064256

Please sign in to comment.