parent
abcac2917c
commit
1bcac55778
|
@ -1,19 +1,29 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
|
use Icinga\Module\Monitoring\Object\Service;
|
||||||
|
|
||||||
$selfUrl = 'monitoring/list/services';
|
$selfUrl = 'monitoring/list/services';
|
||||||
$currentUrl = Url::fromRequest()->getRelativeUrl();
|
$currentUrl = Url::fromRequest()->getRelativeUrl();
|
||||||
?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>>
|
?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>>
|
||||||
<?= $this->qlink(sprintf($this->translate('%s services:'), $this->stats->services_total), $selfUrl) ?>
|
<?= sprintf($this->translate('%s services:'), $this->stats->services_total); ?>
|
||||||
<span class="badges">
|
<span class="badges">
|
||||||
<?php if ($this->stats->services_ok): ?>
|
<?php if ($this->stats->services_ok): ?>
|
||||||
<span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('service_state' => 0))->getRelativeUrl() ? ' active' : '' ?>"><?= $this->qlink(
|
<span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('service_state' => 0))->getRelativeUrl() ? ' active' : ''; ?>">
|
||||||
$this->stats->services_ok,
|
<?= $this->qlink(
|
||||||
$selfUrl,
|
$this->stats->services_ok,
|
||||||
array('service_state' => 0),
|
$selfUrl,
|
||||||
array('title' => sprintf($this->translate('Services with state %s'), $this->translate('OK')))
|
array('service_state' => 0),
|
||||||
) ?></span>
|
array('title' => sprintf(
|
||||||
|
$this->translatePlural(
|
||||||
|
'List %u service that is currently in state OK',
|
||||||
|
'List %u services which are currently in state OK',
|
||||||
|
$this->stats->services_ok
|
||||||
|
),
|
||||||
|
$this->stats->services_ok
|
||||||
|
))
|
||||||
|
); ?>
|
||||||
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php
|
<?php
|
||||||
foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $state) {
|
foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $state) {
|
||||||
|
@ -42,7 +52,15 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
|
||||||
$this->stats->$unhandled,
|
$this->stats->$unhandled,
|
||||||
$selfUrl,
|
$selfUrl,
|
||||||
$paramsUnhandled,
|
$paramsUnhandled,
|
||||||
array('title' => sprintf($this->translate('Unhandled services with state %s'), $this->translate(strtoupper($state))))
|
array('title' => sprintf(
|
||||||
|
$this->translatePlural(
|
||||||
|
'List %u service that is currently in state %s',
|
||||||
|
'List %u services which are currently in state %s',
|
||||||
|
$this->stats->$unhandled
|
||||||
|
),
|
||||||
|
$this->stats->$unhandled,
|
||||||
|
Service::getStateText($stateId, true)
|
||||||
|
))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if ($this->stats->$handled) {
|
if ($this->stats->$handled) {
|
||||||
|
@ -59,7 +77,15 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
|
||||||
$this->stats->$handled,
|
$this->stats->$handled,
|
||||||
$selfUrl,
|
$selfUrl,
|
||||||
$paramsHandled,
|
$paramsHandled,
|
||||||
array('title' => sprintf($this->translate('Handled services with state %s'), $this->translate(strtoupper($state))))
|
array('title' => sprintf(
|
||||||
|
$this->translatePlural(
|
||||||
|
'List %u service that is currently in state %s (Acknowledged)',
|
||||||
|
'List %u services which are currently in state %s (Acknowledged)',
|
||||||
|
$this->stats->$handled
|
||||||
|
),
|
||||||
|
$this->stats->$handled,
|
||||||
|
Service::getStateText($stateId, true)
|
||||||
|
))
|
||||||
);
|
);
|
||||||
if ($this->stats->$unhandled) {
|
if ($this->stats->$unhandled) {
|
||||||
echo "</span>\n";
|
echo "</span>\n";
|
||||||
|
@ -70,12 +96,21 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<?php if ($this->stats->services_pending): ?>
|
<?php if ($this->stats->services_pending): ?>
|
||||||
<span class="state pending<?= $currentUrl === Url::fromPath($selfUrl, array('service_state' => 99))->getRelativeUrl() ? ' active' : '' ?>"><?= $this->qlink(
|
<span class="state pending<?= $currentUrl === Url::fromPath($selfUrl, array('service_state' => 99))->getRelativeUrl() ? ' active' : ''; ?>">
|
||||||
$this->stats->services_pending,
|
<?= $this->qlink(
|
||||||
$selfUrl,
|
$this->stats->services_pending,
|
||||||
array('service_state' => 99),
|
$selfUrl,
|
||||||
array('title' => sprintf($this->translate('Services with state %s'), $this->translate('PENDING')))
|
array('service_state' => 99),
|
||||||
) ?></span>
|
array('title' => sprintf(
|
||||||
|
$this->translatePlural(
|
||||||
|
'List %u service that is currently in state PENDING',
|
||||||
|
'List %u services which are currently in state PENDING',
|
||||||
|
$this->stats->services_pending
|
||||||
|
),
|
||||||
|
$this->stats->services_pending
|
||||||
|
))
|
||||||
|
); ?>
|
||||||
|
</span>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue