-
Notifications
You must be signed in to change notification settings - Fork 275
/
notifications.phtml
82 lines (75 loc) · 2.42 KB
/
notifications.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
<?php if (!$this->compact): ?>
<div class="controls">
<?= $this->tabs ?>
<div class="dontprint" style="margin: 1em;">
<?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this) ?>
</div>
<?= $this->widget('limiter') ?>
<?= $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?>
</div>
<?php endif ?>
<?php if (! $this->inline): ?>
<div class="content">
<?php endif; ?>
<?php
if (empty($this->notifications)) {
echo 'No notifications yet</div>';
return;
}
?>
<table data-base-target="_next" class="action">
<tbody>
<?php
if (count($notifications) === 0) {
echo t('No notifications matching the filter');
}
foreach ($notifications as $notification):
if (isset($notification->service)) {
$isService = true;
$href = $this->href('monitoring/show/service', array(
'host' => $notification->host,
'service' => $notification->service
));
$stateName = strtolower($this->util()->getServiceStateName($notification->notification_state));
} else {
$isService = false;
$href = $this->href('monitoring/show/host', array(
'host' => $notification->host
));
$stateName = strtolower($this->util()->getHostStateName($notification->notification_state));
}
?>
<tr class="state <?= $stateName ?>">
<td class="state">
<?= $this->dateTimeRenderer($notification->notification_start_time)->render(
$this->translate('on %s', 'datetime'),
$this->translate('at %s', 'time'),
$this->translate('%s ago', 'timespan')
);
?>
</td>
<td style="font-size: 0.8em">
<?php if ($isService): ?>
<a href="<?= $href ?>"><?= $notification->service ?></a> on <?= $notification->host ?>
<?php else: ?>
<a href="<?= $href ?>"><?= $notification->host ?></a>
<?php endif; ?>
<br />
<?= $this->escape(substr(strip_tags($notification->notification_output), 0, 10000)); ?>
<br />
<?php if (!$this->contact): ?>
<small>
Sent to <a href="<?= $this->href(
'monitoring/show/contact',
array('contact' => $notification->notification_contact)
) ?>"><?= $this->escape($notification->notification_contact) ?></a>
</small>
<?php endif ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php if (!$this->inline): ?>
</div>
<?php endif; ?>