icingaweb2/modules/monitoring/application/views/scripts/config/index.phtml

75 lines
2.7 KiB
PHTML

<?php use Icinga\Web\Url; ?>
<div class="controls">
<?= $this->tabs->render($this); ?>
</div>
<div class="content" data-base-target="_next">
<h1>Monitoring Backends</h1>
<?php if (isset($this->messageBox)): ?>
<?= $this->messageBox->render() ?>
<?php endif ?>
<p>
<a href="<?= Url::fromPath('/monitoring/config/createbackend')->getAbsoluteUrl();?>">
<?= $this->icon('create.png'); ?> Create New Monitoring Backend
</a>
</p>
<table class="action">
<thead>
<th>Monitoring Backend</th>
<th style="width: 5em">Remove</th>
</thead>
<tbody>
<?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; ?>
</tbody>
</table>
<h1>Monitoring Instances</h1>
<p>
<a href="<?= Url::fromPath('/monitoring/config/createinstance')->getAbsoluteUrl();?>">
<?= $this->icon('create.png'); ?> Create New Instance
</a>
</p>
<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>
</div>