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

67 lines
2.6 KiB
PHTML

<?php use Icinga\Web\Url; ?>
<div class="controls">
<?= $this->tabs->render($this); ?>
</div>
<div class="content">
<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="configTable">
<?php foreach ($this->backends as $backendName => $config): ?>
<tr>
<td class="configTable">
<?php
$removeUrl = Url::fromPath('/monitoring/config/removebackend', array('backend' => $backendName));
$editUrl = Url::fromPath('/monitoring/config/editbackend', array('backend' => $backendName));
?>
<b><?= $this->escape($backendName); ?></b>
<small>(Type: <?= $this->escape($config['type'] === 'ido' ? 'IDO' : ucfirst($config['type'])); ?>)</small>
<div>
<a href="<?= $removeUrl; ?>"><?= $this->icon('remove.png'); ?> Remove</a>&emsp;
<a href="<?= $editUrl; ?>"><?= $this->icon('edit.png'); ?> Edit</a>
</div>
</td>
</tr>
<?php endforeach; ?>
</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="configTable">
<?php foreach ($this->instances as $instanceName => $config): ?>
<tr>
<td class="configTable">
<?php
$removeUrl = Url::fromPath('/monitoring/config/removeinstance', array('instance' => $instanceName));
$editUrl = Url::fromPath('/monitoring/config/editinstance', array('instance' => $instanceName));
?>
<div>
<b><?= $this->escape($instanceName); ?></b>
<small>(Type: <?= isset($config['host']) ? 'Remote' : 'Local'; ?>)</small>
<div>
<a href="<?= $removeUrl; ?>"><?= $this->icon('remove.png'); ?> Remove</a>&emsp;
<a href="<?= $editUrl; ?>"><?= $this->icon('edit.png'); ?> Edit</a>
</div>
</div>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>