Start with command form cleanup

This commit is contained in:
Thomas Gelf 2014-03-06 13:47:26 +00:00
parent 1b503fd187
commit 980ddbc8a9
3 changed files with 28 additions and 20 deletions

View File

@ -36,6 +36,7 @@ use Icinga\Module\Monitoring\DataView\ServiceStatus;
use Icinga\Module\Monitoring\Form\Command\DisableNotificationWithExpireForm;
use Icinga\Module\Monitoring\Form\Command\SingleArgumentCommandForm;
use Icinga\Web\Form;
use Icinga\Web\Url;
use Icinga\Web\Controller\ActionController;
use Icinga\Protocol\Commandpipe\CommandPipe;
use Icinga\Exception\ConfigurationError;
@ -94,6 +95,14 @@ class Monitoring_CommandController extends ActionController
return $this->form !== null && ($this->form instanceof Form);
}
protected function addTitleTab($action)
{
$this->getTabs()->add($action, array(
'title' => ucfirst($action),
'url' => Url::fromRequest()
))->activate($action);
}
/**
* Post dispatch method
*
@ -927,6 +936,7 @@ class Monitoring_CommandController extends ActionController
*/
public function acknowledgeproblemAction()
{
$this->addTitleTab('Acknowledge Problem');
$this->setSupportedParameters(array('host', 'service'));
$form = new AcknowledgeForm();
$form->setRequest($this->getRequest());

View File

@ -1,35 +1,25 @@
<div class="controls">
<?= $this->tabs ?>
</div>
<div class="content">
<?php if (isset($this->objects) && !empty($this->objects) && isset($this->objects[0]->host_name)): ?>
<table class="table table-bordered table-striped table-condensed">
<legend>Affected Objects</legend>
<table class="objectlist">
<thead>
<tr>
<th>
<i class="icinga-icon-host"></i>
Host Name
</th>
<th>
<i class="icinga-icon-service"></i>
Service Name
</th>
<th><?= $this->img('img/icons/host.png') ?> Host</th>
<th><?= $this->img('img/icons/service.png') ?> Service</th>
</tr>
</thead>
<tbody>
<?php foreach ($this->objects as $object): ?>
<tr>
<td><?= $object->host_name; ?></td>
<td><?= (isset($object->service_description) ? $object->service_description : ''); ?></td>
<td><?= (isset($object->service_description) ? $object->service_description : '') ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php if ($this->form): ?>
<div>
<?= $this->form; ?>
<div class="clearfix"></div>
<?php endif ?>
<?= $this->form ?>
</div>
<?php endif; ?>

View File

@ -129,3 +129,11 @@ table.perfdata th {
text-align: left;
padding-right: 0.5em;
}
table.objectlist {
min-width: 28em;
th {
text-align: left;
}
}