From 980ddbc8a97d82b287c757edc181f1d33fc0c47e Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 6 Mar 2014 13:47:26 +0000 Subject: [PATCH] Start with command form cleanup --- .../controllers/CommandController.php | 10 +++++++ .../views/scripts/command/renderform.phtml | 30 +++++++------------ public/css/icinga/main-content.less | 8 +++++ 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/modules/monitoring/application/controllers/CommandController.php b/modules/monitoring/application/controllers/CommandController.php index 756d4c3f8..47372f193 100644 --- a/modules/monitoring/application/controllers/CommandController.php +++ b/modules/monitoring/application/controllers/CommandController.php @@ -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()); diff --git a/modules/monitoring/application/views/scripts/command/renderform.phtml b/modules/monitoring/application/views/scripts/command/renderform.phtml index c049b78ac..cd15854ac 100644 --- a/modules/monitoring/application/views/scripts/command/renderform.phtml +++ b/modules/monitoring/application/views/scripts/command/renderform.phtml @@ -1,35 +1,25 @@ - +
+tabs ?> +
+
objects) && !empty($this->objects) && isset($this->objects[0]->host_name)): ?> - - Affected Objects +
- - + + objects as $object): ?> - +
- - Host Name - - - Service Name - img('img/icons/host.png') ?> Hostimg('img/icons/service.png') ?> Service
host_name; ?>service_description) ? $object->service_description : ''); ?>service_description) ? $object->service_description : '') ?>
- - -form): ?> -
- form; ?> -
+ +form ?>
- - diff --git a/public/css/icinga/main-content.less b/public/css/icinga/main-content.less index 9d1f24840..8cfd89e93 100644 --- a/public/css/icinga/main-content.less +++ b/public/css/icinga/main-content.less @@ -129,3 +129,11 @@ table.perfdata th { text-align: left; padding-right: 0.5em; } + +table.objectlist { + min-width: 28em; + th { + text-align: left; + } +} +