-
Notifications
You must be signed in to change notification settings - Fork 275
/
services.phtml
105 lines (102 loc) · 3.75 KB
/
services.phtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
$services->peekAhead($this->compact);
if (! $this->compact): ?>
<div class="controls separated">
<?= $this->tabs ?>
<div class="dontprint">
<?= $this->render('list/components/selectioninfo.phtml') ?>
<h1 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>>
<?= $this->render('list/components/servicesummary.phtml') ?>
</h1>
</div>
<?= $this->sortBox ?>
<?= $this->limiter ?>
<?= $this->paginator ?>
<?= $this->filterEditor ?>
</div>
<?php endif ?>
<div class="content">
<table data-base-target="_next"
class="action multiselect <?php if ($this->compact): ?> compact<?php endif ?>" style="table-layout: auto;"
data-icinga-multiselect-url="<?= $this->href("monitoring/services/show") ?>"
data-icinga-multiselect-controllers="<?= $this->href("monitoring/services") ?>"
data-icinga-multiselect-data="service,host">
<tbody>
<?php foreach ($services as $service):
$serviceLink = $this->href(
'monitoring/service/show',
array(
'host' => $service->host_name,
'service' => $service->service_description
)
);
$hostLink = $this->href(
'monitoring/host/show',
array(
'host' => $service->host_name,
)
);
$serviceStateName = Service::getStateText($service->service_state);
?>
<tr class="state <?= $serviceStateName ?><?= $service->service_handled ? ' handled' : '' ?>">
<td class="state">
<p>
<span class="state-label"><?= Service::getStateText($service->service_state, true) ?></span>
<?php if ((int) $service->service_state !== 99): ?>
<br>
<?= $this->timeSince($service->service_last_state_change, $this->compact) ?>
<?php if ((int) $service->service_state > 0 && (int) $service->service_state_type === 0): ?>
<br>
<span class="text-small">Soft <?= $service->service_attempt ?></span>
<?php endif ?>
<?php endif ?>
</p>
</td>
<td>
<?= $this->iconImage()->service($service) ?>
<span class="objectflags"><?= implode(' ', $this->serviceFlags($service)) ?></span>
<?php if ($this->showHost): ?><?= $this->qlink(
$service->host_display_name . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''),
$hostLink,
null,
array('title' => sprintf($this->translate('Show detailed information for host %s'), $service->host_display_name))
) ?>:
<?php endif ?><?= $this->qlink(
$service->service_display_name,
$serviceLink,
null,
array(
'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$service->service_display_name,
$service->host_display_name
),
'class' => 'rowaction'
)
) ?><br />
<div class="sparkline-box"><?= $this->perfdata($service->service_perfdata, true, 5) ?> </div>
<p class="pluginoutput"><?= $this->pluginOutput($this->ellipsis($service->service_output, 10000), true) ?></p>
</td>
<?php foreach($this->addColumns as $col): ?>
<td><?= $this->escape($service->$col) ?></td>
<?php endforeach ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php if (! $services->hasResult()): ?>
<?= $this->translate('No services found matching the filter'); ?>
<?php elseif ($services->hasMore()): ?>
<?= $this->qlink(
$this->translate('Show More'),
$this->url()->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right show-more'
)
); ?>
<?php endif ?>
</div>