icingaweb2/application/views/scripts/config/resource.phtml

68 lines
1.8 KiB
PHTML

<div class="controls">
<?= $tabs; ?>
</div>
<div class="content" data-base-target="_next">
<a href="<?= $this->href('config/createresource'); ?>">
<?= $this->icon('plus'); ?> <?= $this->translate('Create A New Resource'); ?>
</a>
<table class="action alternating" id="resource-edit-table">
<thead>
<th><?= $this->translate('Resource'); ?></th>
<th style="width: 5em"><?= $this->translate('Remove'); ?></th>
</thead>
<tbody>
<?php foreach ($this->resources as $name => $value): ?>
<tr>
<td>
<?php
switch ($value->type) {
case 'db':
$icon = 'database';
break;
case 'ldap':
$icon = 'sitemap';
break;
case 'livestatus':
$icon = 'flash';
break;
case 'ssh':
$icon = 'user';
break;
case 'file':
case 'ini':
$icon = 'doc-text';
break;
default:
$icon = 'edit';
break;
}
?>
<?= $this->qlink(
$name,
'config/editresource',
array('resource' => $name),
array(
'icon' => $icon,
'title' => sprintf($this->translate('Edit resource %s'), $name)
)
); ?>
</td>
<td>
<center>
<?= $this->qlink(
'',
'config/removeresource',
array('resource' => $name),
array(
'icon' => 'trash',
'title' => sprintf($this->translate('Remove resource %s'), $name)
)
); ?>
</center>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>