mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-20 12:24:29 +02:00
parent
96c7b22c16
commit
abcac2917c
@ -4,79 +4,133 @@ use Icinga\Web\Url;
|
|||||||
|
|
||||||
$selfUrl = 'monitoring/list/hosts';
|
$selfUrl = 'monitoring/list/hosts';
|
||||||
$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 hosts:'), $this->stats->hosts_total), $selfUrl); ?>
|
<?= sprintf($this->translate('%s hosts:'), $this->stats->hosts_total); ?>
|
||||||
<span class="badges">
|
<span class="badges">
|
||||||
<?php if($this->stats->hosts_up): ?>
|
<?php if ($this->stats->hosts_up): ?>
|
||||||
<span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 0))->getRelativeUrl() ? ' active' : '' ?>">
|
<span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 0))->getRelativeUrl() ? ' active' : ''; ?>">
|
||||||
<?= $this->qlink(
|
<?= $this->qlink(
|
||||||
$this->stats->hosts_up,
|
$this->stats->hosts_up,
|
||||||
$selfUrl,
|
$selfUrl,
|
||||||
array('host_state' => 0),
|
array('host_state' => 0),
|
||||||
array('title' => $this->translate('Hosts with state UP'))
|
array('title' => sprintf(
|
||||||
) ?>
|
$this->translatePlural(
|
||||||
|
'List %u host that is currently in state UP',
|
||||||
|
'List %u hosts which are currently in state UP',
|
||||||
|
$this->stats->hosts_up
|
||||||
|
),
|
||||||
|
$this->stats->hosts_up
|
||||||
|
))
|
||||||
|
); ?>
|
||||||
</span>
|
</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if($this->stats->hosts_down_unhandled): ?>
|
<?php if ($this->stats->hosts_down_unhandled): ?>
|
||||||
<span class="state critical<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 1, 'host_unhandled' => 1))->getRelativeUrl() ? ' active' : '' ?>">
|
<span class="state critical<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 1, 'host_unhandled' => 1))->getRelativeUrl() ? ' active' : ''; ?>">
|
||||||
<?= $this->qlink(
|
<?= $this->qlink(
|
||||||
$this->stats->hosts_down_unhandled,
|
$this->stats->hosts_down_unhandled,
|
||||||
$selfUrl,
|
$selfUrl,
|
||||||
array('host_state' => 1, 'host_unhandled' => 1),
|
array(
|
||||||
array('title' => $this->translate('Unhandled hosts with state DOWN'))
|
'host_state' => 1,
|
||||||
) ?>
|
'host_unhandled' => 1
|
||||||
|
),
|
||||||
|
array('title' => sprintf(
|
||||||
|
$this->translatePlural(
|
||||||
|
'List %u host that is currently in state DOWN',
|
||||||
|
'List %u hosts which are currently in state DOWN',
|
||||||
|
$this->stats->hosts_down_unhandled
|
||||||
|
),
|
||||||
|
$this->stats->hosts_down_unhandled
|
||||||
|
))
|
||||||
|
); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if($this->stats->hosts_down_handled > 0): ?>
|
<?php if ($this->stats->hosts_down_handled): ?>
|
||||||
<span class="state handled critical<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 1, 'host_unhandled' =>0))->getRelativeUrl() ? ' active' : '' ?>">
|
<span class="state handled critical<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 1, 'host_unhandled' =>0))->getRelativeUrl() ? ' active' : ''; ?>">
|
||||||
<?= $this->qlink(
|
<?= $this->qlink(
|
||||||
$this->stats->hosts_down_handled,
|
$this->stats->hosts_down_handled,
|
||||||
$selfUrl,
|
$selfUrl,
|
||||||
array('host_state' => 1, 'host_unhandled' => 0),
|
array(
|
||||||
array('title' => $this->translate('Handled hosts with state DOWN'))
|
'host_state' => 1,
|
||||||
) ?>
|
'host_unhandled' => 0
|
||||||
</span>
|
),
|
||||||
<?php endif; ?>
|
array('title' => sprintf(
|
||||||
|
$this->translatePlural(
|
||||||
|
'List %u host that is currently in state DOWN (Acknowledged)',
|
||||||
|
'List %u hosts which are currently in state DOWN (Acknowledged)',
|
||||||
|
$this->stats->hosts_down_handled
|
||||||
|
),
|
||||||
|
$this->stats->hosts_down_handled
|
||||||
|
))
|
||||||
|
); ?>
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if($this->stats->hosts_down): ?>
|
<?php if($this->stats->hosts_down): ?>
|
||||||
</span>
|
</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if($this->stats->hosts_unreachable_unhandled): ?>
|
<?php if($this->stats->hosts_unreachable_unhandled): ?>
|
||||||
<span class="state unknown<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 2, 'host_unhandled' => 1))->getRelativeUrl() ? ' active' : '' ?>">
|
<span class="state unknown<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 2, 'host_unhandled' => 1))->getRelativeUrl() ? ' active' : ''; ?>">
|
||||||
<?= $this->qlink(
|
<?= $this->qlink(
|
||||||
$this->stats->hosts_unreachable_unhandled,
|
$this->stats->hosts_unreachable_unhandled,
|
||||||
$selfUrl,
|
$selfUrl,
|
||||||
array('host_state' => 2, 'host_unhandled' => 1),
|
array(
|
||||||
array('title' => $this->translate('Unhandled hosts with state UNREACHABLE'))
|
'host_state' => 2,
|
||||||
) ?>
|
'host_unhandled' => 1
|
||||||
|
),
|
||||||
|
array('title' => sprintf(
|
||||||
|
$this->translatePlural(
|
||||||
|
'List %u host that is currently in state UNREACHABLE',
|
||||||
|
'List %u hosts which are currently in state UNREACHABLE',
|
||||||
|
$this->stats->hosts_unreachable_unhandled
|
||||||
|
),
|
||||||
|
$this->stats->hosts_unreachable_unhandled
|
||||||
|
))
|
||||||
|
); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if($this->stats->hosts_unreachable_handled > 0): ?>
|
<?php if($this->stats->hosts_unreachable_handled > 0): ?>
|
||||||
<span class="state handled unknown<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 2, 'host_unhandled' => 0))->getRelativeUrl() ? ' active' : '' ?>">
|
<span class="state handled unknown<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 2, 'host_unhandled' => 0))->getRelativeUrl() ? ' active' : '' ?>">
|
||||||
<?= $this->qlink(
|
<?= $this->qlink(
|
||||||
$this->stats->hosts_unreachable_handled,
|
$this->stats->hosts_unreachable_handled,
|
||||||
$selfUrl,
|
$selfUrl,
|
||||||
array('host_state' => 2, 'host_unhandled' => 0),
|
array(
|
||||||
array('title' => $this->translate('Handled hosts with state UNREACHABLE'))
|
'host_state' => 2,
|
||||||
) ?>
|
'host_unhandled' => 0
|
||||||
</span>
|
),
|
||||||
<?php endif; ?>
|
array('title' => sprintf(
|
||||||
|
$this->translatePlural(
|
||||||
|
'List %u host that is currently in state UNREACHABLE (Acknowledged)',
|
||||||
|
'List %u hosts which are currently in state UNREACHABLE (Acknowledged)',
|
||||||
|
$this->stats->hosts_unreachable_handled
|
||||||
|
),
|
||||||
|
$this->stats->hosts_unreachable_handled
|
||||||
|
))
|
||||||
|
); ?>
|
||||||
|
</span>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if($this->stats->hosts_unreachable): ?>
|
<?php if($this->stats->hosts_unreachable): ?>
|
||||||
</span>
|
</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if($this->stats->hosts_pending): ?>
|
<?php if($this->stats->hosts_pending): ?>
|
||||||
<span class="state pending<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 99))->getRelativeUrl() ? ' active' : '' ?>">
|
<span class="state pending<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 99))->getRelativeUrl() ? ' active' : ''; ?>">
|
||||||
<?= $this->qlink(
|
<?= $this->qlink(
|
||||||
$this->stats->hosts_pending,
|
$this->stats->hosts_pending,
|
||||||
$selfUrl,
|
$selfUrl,
|
||||||
array('host_state' => 99),
|
array('host_state' => 99),
|
||||||
array('title' => $this->translate('Hosts with state PENDING'))
|
array('title' => sprintf(
|
||||||
) ?>
|
$this->translatePlural(
|
||||||
|
'List %u host that is currently in state PENDING',
|
||||||
|
'List %u hosts which are currently in state PENDING',
|
||||||
|
$this->stats->hosts_pending
|
||||||
|
),
|
||||||
|
$this->stats->hosts_pending
|
||||||
|
))
|
||||||
|
); ?>
|
||||||
</span>
|
</span>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
Loading…
x
Reference in New Issue
Block a user