Revert "Require service_description' instead of service' to show a particular service"

This reverts commit 09ab6019423e858d222a570c65f247bfcb09e62f.
This commit is contained in:
Johannes Meyer 2015-04-20 16:09:14 +02:00
parent 9bbb23ae7d
commit 96fb0370a4
8 changed files with 17 additions and 24 deletions

View File

@ -25,11 +25,7 @@ class Monitoring_ServiceController extends MonitoredObjectController
*/ */
public function init() public function init()
{ {
$service = new Service( $service = new Service($this->backend, $this->params->get('host_name'), $this->params->get('service'));
$this->backend,
$this->params->get('host_name'),
$this->params->get('service_description')
);
$this->applyRestriction('monitoring/services/filter', $service); $this->applyRestriction('monitoring/services/filter', $service);

View File

@ -194,8 +194,8 @@ class Monitoring_ShowController extends Controller
} else { } else {
$isService = true; $isService = true;
$params = array( $params = array(
'host_name' => $object->getHost()->getName(), 'host_name' => $object->getHost()->getName(),
'service_description' => $object->getName() 'service' => $object->getName()
); );
} }
$tabs = $this->getTabs(); $tabs = $this->getTabs();
@ -223,7 +223,7 @@ class Monitoring_ShowController extends Controller
), ),
'label' => $this->translate('Service'), 'label' => $this->translate('Service'),
'icon' => 'service', 'icon' => 'service',
'url' => 'monitoring/service/show', 'url' => 'monitoring/show/service',
'urlParams' => $params, 'urlParams' => $params,
) )
); );

View File

@ -55,7 +55,7 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract
$this->view->qlink( $this->view->qlink(
$serviceLinkText, $serviceLinkText,
'monitoring/service/show', 'monitoring/service/show',
array('host_name' => $host, 'service_description' => $service), array('host_name' => $host, 'service' => $service),
array('title' => sprintf( array('title' => sprintf(
$this->view->translate('Show detailed information for service %s on host %s'), $this->view->translate('Show detailed information for service %s on host %s'),
$service, $service,

View File

@ -82,8 +82,8 @@ foreach ($serviceDescriptions as $service_description): ?>
'', '',
'monitoring/service/show', 'monitoring/service/show',
array( array(
'host_name' => $service->host_name, 'host_name' => $service->host_name,
'service_description' => $service->service_description 'service' => $service->service_description
), ),
array( array(
'aria-describedby' => $service->host_name . '_' . $service->service_description . '_desc', 'aria-describedby' => $service->host_name . '_' . $service->service_description . '_desc',

View File

@ -34,8 +34,8 @@ if (count($services) === 0) {
$serviceLink = $this->href( $serviceLink = $this->href(
'monitoring/service/show', 'monitoring/service/show',
array( array(
'host_name' => $service->host_name, 'host_name' => $service->host_name,
'service_description' => $service->service_description 'service' => $service->service_description
) )
); );
$hostLink = $this->href( $hostLink = $this->href(

View File

@ -146,10 +146,10 @@ $output = $this->tickets ? preg_replace_callback(
$this->translate('%s on %s', 'Service running on host'), $this->translate('%s on %s', 'Service running on host'),
$hostContext ? $this->qlink( $hostContext ? $this->qlink(
$event->service_display_name, $event->service_display_name,
'monitoring/service/show', 'monitoring/show/service',
array( array(
'host_name' => $event->host_name, 'host_name' => $event->host_name,
'service_description' => $event->service_description 'service' => $event->service_description
), ),
array('title' => sprintf( array('title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'), $this->translate('Show detailed information for service %s on host %s'),

View File

@ -556,14 +556,11 @@ abstract class MonitoredObject implements Filterable
*/ */
public static function fromParams(UrlParams $params) public static function fromParams(UrlParams $params)
{ {
if ($params->has('service_description') && $params->has('host_name')) { if ($params->has('service') && $params->has('host_name')) {
return new Service( return new Service(MonitoringBackend::instance(), $params->get('host_name'), $params->get('service'));
MonitoringBackend::instance(),
$params->get('host_name'),
$params->get('service_description')
);
} elseif ($params->has('host_name')) { } elseif ($params->has('host_name')) {
return new Host(MonitoringBackend::instance(), $params->get('host_name')); return new Host(MonitoringBackend::instance(), $params->get('host_name'));
} }
return null;
} }
} }

View File

@ -172,8 +172,8 @@ abstract class MonitoredObjectController extends Controller
} else { } else {
$isService = true; $isService = true;
$params = array( $params = array(
'host_name' => $object->getHost()->getName(), 'host_name' => $object->getHost()->getName(),
'service_description' => $object->getName() 'service' => $object->getName()
); );
} }
$tabs->add( $tabs->add(