icingaweb2/modules/monitoring/application/views/scripts/show/components/downtime.phtml

97 lines
4.0 KiB
PHTML
Raw Normal View History

<?php if (!empty($this->downtimes)): ?>
2013-07-22 16:03:36 +02:00
<?php
$list = array();
foreach ($this->downtimes as $downtime) {
$row = array();
if ($downtime->downtime_is_in_effect === '1') {
$row[] = 'Running<br />since '. $this->timeSince($downtime->downtime_actual_start_time);
} else {
if ($downtime->downtime_is_fixed) {
$row[] = 'Scheduled<br />for '. $downtime->downtime_scheduled_start_time;
} else {
$row[] = 'Waiting';
}
}
$row[] = sprintf(
'Triggered by %s: <em>%s</em>',
$downtime->downtime_author_name,
$downtime->downtime_comment_data
);
$row[] = '<button type="button" data-target="command" class="btn btn-warning"'
. ' data-command-id="29" data-command-info="'. $downtime->downtime_internal_downtime_id. '"'
. '>{{REMOVE_ICON}} Remove'
2013-07-22 16:03:36 +02:00
. '</button>';
$list[] = '<td>'. implode('</td><td>', $row). '</td>';
}
?>
2013-10-07 16:46:20 +02:00
<?php endif; ?>
<div>
<div class="panel-heading">
<div class="panel-hostname">
<div class="pull-right">
<?php
$scheduleDowntimeData = array(
'host' => $this->object->host_name,
'service' => $this->object->service_description
);
$scheduleDowntimeHref = $this->href('monitoring/command/scheduleDowntime', $scheduleDowntimeData);
?>
<a href="<?= $scheduleDowntimeHref; ?>" class="btn-common btn-small button" title="Schedule downtime">
<i class="icinga-icon-in-downtime"></i>
</a>
</div>
Downtimes
</div>
2013-07-22 16:03:36 +02:00
</div>
<hr class="separator" />
<div class="panel-body">
<table class="table table-condensed table-detail">
<tbody>
<?php if (empty($this->object->downtimes)): ?>
<tr>
<td>No Downtimes</td>
</tr>
2013-10-15 12:48:33 +02:00
<?php else: ?>
<?php foreach ($this->object->downtimes as $downtime): ?>
<tr>
<td>
<div class="pull-right">
<form action="<?= $this->href('monitoring/command/removeDowntime'); ?>" data-icinga-component="app/ajaxPostSubmitForm">
<button type="submit" class="button btn-common btn-small" name="btn_submit" value="1">
<i class="icinga-icon-remove"></i>
</button>
<input type="hidden" name="host" value="<?= $downtime->host_name; ?>" />
<input type="hidden" name="service" value="<?= $downtime->service_description; ?>" />
<input type="hidden" name="downtimeid" value="<?= $downtime->downtime_internal_downtime_id; ?>" />
<input type="hidden" name="CSRFToken" value="" />
</form>
</div>
<?php if ($downtime->downtime_is_in_effect === '1'): ?>
Running since <?= $this->timeSince($downtime->downtime_actual_start_time); ?>
<?php else: ?>
<?php if ($downtime->downtime_is_fixed): ?>
Scheduled for <?= $downtime->downtime_scheduled_start_time; ?>
<?php else: ?>
Waiting
<?php endif; ?>
<?php endif; ?>
Triggered by <?= $downtime->downtime_author_name; ?>
<div class="small-row">
<?= $downtime->downtime_comment_data; ?>
</div>
</td>
</tr>
<?php endforeach; ?>
2013-10-15 12:48:33 +02:00
<?php endif; ?>
</tbody>
2013-07-22 16:03:36 +02:00
</table>
</div>
</div>