Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tiny statesummary to service multi-view
refs #8565
- Loading branch information
Showing
6 changed files
with
71 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
modules/monitoring/application/views/scripts/partials/host/objects-tinysummary.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
use Icinga\Web\Url; | ||
?> | ||
|
||
<h1 class="tinystatesummary"> | ||
<?= $this->qlink( | ||
sprintf($this->translate('%d Hosts Selected:'), count($objects)), | ||
$listAllLink | ||
); ?> | ||
|
||
<span class="badges"> | ||
<?php if ($hostStates->hosts_up): ?> | ||
|
||
<?php $selfUrl = Url::fromPath('monitoring/list/hosts'); ?> | ||
<span class="state up"><b> | ||
<?= $hostStates->hosts_up ?> | ||
</b></span> | ||
<?php endif ?> | ||
|
||
|
||
<?php | ||
foreach ( | ||
array( | ||
1 => 'down', | ||
2 => 'unreachable', | ||
99 => 'pending' | ||
) as $stateId => $state) { | ||
|
||
$stateName = 'hosts_' . $state; | ||
$unhandledStateName = $stateName . '_unhandled'; | ||
if ($hostStates->$unhandledStateName) { | ||
echo '<span class="state ' . $state . '"><b>' . $hostStates->$unhandledStateName . '</b>'; | ||
} | ||
if ($hostStates->$stateName) { | ||
echo '<span class="state ' . $state . ' handled"><b>' . $hostStates->$stateName . '</b></span>'; | ||
} | ||
if ($hostStates->$unhandledStateName) { | ||
echo '</span>'; | ||
} | ||
$stateName .= '_unhandled'; | ||
}?> | ||
|
||
</span> | ||
</h1> |
1 change: 0 additions & 1 deletion
1
modules/monitoring/application/views/scripts/partials/service/objects-header.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<?php | ||
use Icinga\Module\Monitoring\Object\Service; | ||
use Icinga\Web\Url; | ||
?> | ||
|
||
<?php | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters