2014-03-13 15:54:27 +01:00
|
|
|
<?php
|
|
|
|
use Icinga\Web\Url;
|
|
|
|
|
|
|
|
$fileNotReadable = array();
|
|
|
|
foreach (array('backends', 'instances') as $element) {
|
|
|
|
if (is_object($this->{$element}) &&
|
|
|
|
get_class($this->{$element}) === 'Icinga\Exception\NotReadableError') {
|
|
|
|
$fileNotReadable[$element] = $this->{$element}->getMessage();
|
|
|
|
} else {
|
|
|
|
$fileNotReadable[$element] = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
2014-03-05 17:40:08 +01:00
|
|
|
<div class="controls">
|
|
|
|
<?= $this->tabs->render($this); ?>
|
2013-08-20 15:45:04 +02:00
|
|
|
</div>
|
|
|
|
|
2014-03-11 17:13:42 +01:00
|
|
|
<div class="content" data-base-target="_next">
|
2014-03-13 15:54:27 +01:00
|
|
|
<?php if ($fileNotReadable['backends'] === false): ?>
|
|
|
|
<h1>Monitoring Backends</h1>
|
2013-08-20 15:45:04 +02:00
|
|
|
|
2014-03-13 15:54:27 +01:00
|
|
|
<?php if (isset($this->messageBox)): ?>
|
|
|
|
<?= $this->messageBox->render() ?>
|
|
|
|
<?php endif ?>
|
2013-08-20 15:45:04 +02:00
|
|
|
|
2014-03-13 15:54:27 +01:00
|
|
|
<p>
|
|
|
|
<a href="<?= Url::fromPath('/monitoring/config/createbackend')->getAbsoluteUrl();?>">
|
|
|
|
<?= $this->icon('create.png'); ?> Create New Monitoring Backend
|
|
|
|
</a>
|
|
|
|
</p>
|
2013-08-20 15:45:04 +02:00
|
|
|
|
2014-03-13 15:54:27 +01:00
|
|
|
<table class="action">
|
|
|
|
<thead>
|
2014-03-11 17:13:42 +01:00
|
|
|
<th>Monitoring Backend</th>
|
|
|
|
<th style="width: 5em">Remove</th>
|
2014-03-13 15:54:27 +01:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2014-03-11 17:13:42 +01:00
|
|
|
<?php foreach ($this->backends as $backendName => $config): ?>
|
|
|
|
<?php
|
|
|
|
$removeUrl = Url::fromPath('/monitoring/config/removebackend', array('backend' => $backendName));
|
|
|
|
$editUrl = Url::fromPath('/monitoring/config/editbackend', array('backend' => $backendName));
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<a href="<?= $editUrl; ?>"><?= $this->icon('edit.png'); ?> <?= $this->escape($backendName); ?></a>
|
|
|
|
<small>(Type: <?= $this->escape($config['type'] === 'ido' ? 'IDO' : ucfirst($config['type'])); ?>)</small>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="<?= $removeUrl; ?>"><?= $this->icon('remove.png'); ?></a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
2014-03-13 15:54:27 +01:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<?php else: ?>
|
|
|
|
<p class="fileNotReadable">
|
|
|
|
<?= $this->escape($fileNotReadable['backends']) ?>
|
|
|
|
</p>
|
|
|
|
<?php endif ?>
|
2013-08-20 15:45:04 +02:00
|
|
|
|
2014-03-13 15:54:27 +01:00
|
|
|
<?php if ($fileNotReadable['instances'] === false): ?>
|
|
|
|
<h1>Monitoring Instances</h1>
|
2013-08-20 15:45:04 +02:00
|
|
|
|
2014-03-13 15:54:27 +01:00
|
|
|
<p>
|
|
|
|
<a href="<?= Url::fromPath('/monitoring/config/createinstance')->getAbsoluteUrl();?>">
|
|
|
|
<?= $this->icon('create.png'); ?> Create New Instance
|
|
|
|
</a>
|
|
|
|
</p>
|
2013-08-20 15:45:04 +02:00
|
|
|
|
2014-03-13 15:54:27 +01:00
|
|
|
<table class="action">
|
|
|
|
<thead>
|
|
|
|
<th>Instance</th>
|
|
|
|
<th style="width: 5em">Remove</th>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<?php foreach ($this->instances as $instanceName => $config): ?>
|
|
|
|
<?php
|
|
|
|
$removeUrl = Url::fromPath('/monitoring/config/removeinstance', array('instance' => $instanceName));
|
|
|
|
$editUrl = Url::fromPath('/monitoring/config/editinstance', array('instance' => $instanceName));
|
|
|
|
?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<a href="<?= $editUrl; ?>"><?= $this->icon('edit.png'); ?> <?= $this->escape($instanceName); ?></a>
|
|
|
|
<small>(Type: <?= isset($config['host']) ? 'Remote' : 'Local'; ?>)</small>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<a href="<?= $removeUrl; ?>"><?= $this->icon('remove.png'); ?></a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<?php else: ?>
|
|
|
|
<p class="fileNotReadable">
|
|
|
|
<?= $this->escape($fileNotReadable['instances']) ?>
|
|
|
|
</p>
|
|
|
|
<?php endif ?>
|
2014-03-05 17:40:08 +01:00
|
|
|
</div>
|