/
show.phtml
226 lines (195 loc) · 6.7 KB
/
show.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<?php
use Icinga\Module\Monitoring\Forms\Command\Object\DeleteCommentCommandForm;
?>
<div class="controls">
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>
<h1>
<?= $this->qlink(
sprintf($this->translate('%d Hosts Selected'), count($objects)),
$listAllLink
); ?>
</h1>
<?= $this->render('partials/host/objects-header.phtml'); ?>
</div>
<div class="content no-padding-top">
<h3>
<?= $this->icon('reschedule') ?>
<?= $this->translate('Commands') ?>
</h3>
<?= sprintf(t('Issue commands to all %d selected hosts:'), count($objects)) ?>
<?php if (($hostCount = count($objects)) === 0): ?>
<?= $this->translate('No hosts matching the filter'); ?>
<?php else: ?>
<p>
<div>
<?= $checkNowForm; ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Reschedule the next check'),
$rescheduleAllLink,
null,
array('icon' => 'reschedule')
); ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Schedule a downtime'),
$downtimeAllLink,
null,
array('icon' => 'plug')
); ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Submit a passive check result'),
$processCheckResultAllLink,
null,
array('icon' => 'reply')
); ?>
</div>
<div>
<?= $this->qlink(
$this->translate('Add a comment'),
$addCommentLink,
null,
array('icon' => 'comment')
); ?>
</div>
</p>
<?php if (($unhandledCount = count($unhandledObjects)) > 0): ?>
<div>
<h3>
<?= $this->icon('attention-alt') ?>
<?= $this->translatePlural(
'Unhandled Problem',
'Unhandled Problems',
$unhandledCount
) ?>
</h3>
<p>
<?= sprintf(
t('There are %s unhandled problems. Issue commands to the problematic hosts:'),
'<span class="badge badge-critical">' . $unhandledCount . '</span>'
) ?>
<div><?= $this->qlink(
sprintf(
$this->translatePlural(
'Schedule a downtime for %u host',
'Schedule a downtime for %u hosts',
$unhandledCount
),
$unhandledCount
),
$downtimeUnhandledLink,
null,
array('icon' => 'plug')
); ?></div>
<div><?= $this->qlink(
sprintf(
$this->translatePlural(
'Acknowledge %u unhandled host',
'Acknowledge %u unhandled hosts',
$unhandledCount
),
$unhandledCount
),
$acknowledgeUnhandledLink,
null,
array('icon' => 'ok')
); ?></div>
</p>
</div>
<?php endif ?>
<?php if (($acknowledgedCount = count($acknowledgedObjects)) > 0): ?>
<div>
<h3><?= $this->icon('ok', $this->translate('Acknowledgements')) ?> <?= $this->translate('Acknowledgements') ?></h3>
<p><?= sprintf(
$this->translatePlural(
'%u Acknowledged Host Problem',
'%u Acknowledged Host Problems',
$acknowledgedCount
),
$acknowledgedCount
); ?></p>
<?= $removeAckForm ?>
</div>
<?php endif ?>
<?php if (($inDowntimeCount = count($objectsInDowntime)) > 0): ?>
<h3><?= $this->translate('Downtimes') ?></h3>
<p><?= sprintf(
$this->translatePlural(
'%u Host currently in downtime.',
'%u Hosts currently in downtime.',
$inDowntimeCount
),
$inDowntimeCount
) ?> <?= $this->qlink(
$this->translate('List all'),
$inDowntimeLink,
null,
array('data-base-target' => '_next')
); ?>
</p>
<?php endif ?>
<?php if (($commentCount = count($objects->getComments())) > 0): ?>
<h3> <?= $this->translate('Comments') ?></h3>
<p>
<?= sprintf(
$this->translatePlural(
'There is %u host comment.',
'There are %u host comments.',
$commentCount
),
$commentCount
) ?>
<?= $this->qlink(
$this->translate('List all'),
$commentsLink,
null,
array('data-base-target' => '_next')
); ?>
</p>
<table>
<?php foreach ($objects as $service): ?>
<?php $service->fetchComments(); ?>
<?php foreach ($service->comments as $comment): ?>
<tr>
<td style="vertical-align: top;" data-base-target="_self">
<?php
$delCommentForm = new DeleteCommentCommandForm();
$delCommentForm->populate(
array('comment_id' => $comment->id, 'redirect' => html_entity_decode($this->url))
);
$delCommentForm->setAction(
$this->url(
'monitoring/host/delete-comment',
array('host' => $service->getName())
)
);
echo $delCommentForm;
?>
(<?= ucfirst($comment->type) ?>):
</td>
<td style="padding-left: .5em;">
<?= nl2br($comment->comment) ?>
</td>
</tr>
<?php endforeach ?>
<?php endforeach ?>
</table>
<!--
<p>
<div><?= $this->qlink(
$this->translate('Remove all'),
$deleteCommentLink,
null,
array('icon' => 'trash')
); ?></div>
</p>
-->
<?php endif ?>
<?php endif ?>
</div>