Revert "Require `service_description' instead of `service' to show a particular service"
This reverts commit 09ab601942
.
This commit is contained in:
parent
9bbb23ae7d
commit
96fb0370a4
|
@ -25,11 +25,7 @@ class Monitoring_ServiceController extends MonitoredObjectController
|
|||
*/
|
||||
public function init()
|
||||
{
|
||||
$service = new Service(
|
||||
$this->backend,
|
||||
$this->params->get('host_name'),
|
||||
$this->params->get('service_description')
|
||||
);
|
||||
$service = new Service($this->backend, $this->params->get('host_name'), $this->params->get('service'));
|
||||
|
||||
$this->applyRestriction('monitoring/services/filter', $service);
|
||||
|
||||
|
|
|
@ -194,8 +194,8 @@ class Monitoring_ShowController extends Controller
|
|||
} else {
|
||||
$isService = true;
|
||||
$params = array(
|
||||
'host_name' => $object->getHost()->getName(),
|
||||
'service_description' => $object->getName()
|
||||
'host_name' => $object->getHost()->getName(),
|
||||
'service' => $object->getName()
|
||||
);
|
||||
}
|
||||
$tabs = $this->getTabs();
|
||||
|
@ -223,7 +223,7 @@ class Monitoring_ShowController extends Controller
|
|||
),
|
||||
'label' => $this->translate('Service'),
|
||||
'icon' => 'service',
|
||||
'url' => 'monitoring/service/show',
|
||||
'url' => 'monitoring/show/service',
|
||||
'urlParams' => $params,
|
||||
)
|
||||
);
|
||||
|
|
|
@ -55,7 +55,7 @@ class Zend_View_Helper_Link extends Zend_View_Helper_Abstract
|
|||
$this->view->qlink(
|
||||
$serviceLinkText,
|
||||
'monitoring/service/show',
|
||||
array('host_name' => $host, 'service_description' => $service),
|
||||
array('host_name' => $host, 'service' => $service),
|
||||
array('title' => sprintf(
|
||||
$this->view->translate('Show detailed information for service %s on host %s'),
|
||||
$service,
|
||||
|
|
|
@ -82,8 +82,8 @@ foreach ($serviceDescriptions as $service_description): ?>
|
|||
'',
|
||||
'monitoring/service/show',
|
||||
array(
|
||||
'host_name' => $service->host_name,
|
||||
'service_description' => $service->service_description
|
||||
'host_name' => $service->host_name,
|
||||
'service' => $service->service_description
|
||||
),
|
||||
array(
|
||||
'aria-describedby' => $service->host_name . '_' . $service->service_description . '_desc',
|
||||
|
|
|
@ -34,8 +34,8 @@ if (count($services) === 0) {
|
|||
$serviceLink = $this->href(
|
||||
'monitoring/service/show',
|
||||
array(
|
||||
'host_name' => $service->host_name,
|
||||
'service_description' => $service->service_description
|
||||
'host_name' => $service->host_name,
|
||||
'service' => $service->service_description
|
||||
)
|
||||
);
|
||||
$hostLink = $this->href(
|
||||
|
|
|
@ -146,10 +146,10 @@ $output = $this->tickets ? preg_replace_callback(
|
|||
$this->translate('%s on %s', 'Service running on host'),
|
||||
$hostContext ? $this->qlink(
|
||||
$event->service_display_name,
|
||||
'monitoring/service/show',
|
||||
'monitoring/show/service',
|
||||
array(
|
||||
'host_name' => $event->host_name,
|
||||
'service_description' => $event->service_description
|
||||
'host_name' => $event->host_name,
|
||||
'service' => $event->service_description
|
||||
),
|
||||
array('title' => sprintf(
|
||||
$this->translate('Show detailed information for service %s on host %s'),
|
||||
|
|
|
@ -556,14 +556,11 @@ abstract class MonitoredObject implements Filterable
|
|||
*/
|
||||
public static function fromParams(UrlParams $params)
|
||||
{
|
||||
if ($params->has('service_description') && $params->has('host_name')) {
|
||||
return new Service(
|
||||
MonitoringBackend::instance(),
|
||||
$params->get('host_name'),
|
||||
$params->get('service_description')
|
||||
);
|
||||
if ($params->has('service') && $params->has('host_name')) {
|
||||
return new Service(MonitoringBackend::instance(), $params->get('host_name'), $params->get('service'));
|
||||
} elseif ($params->has('host_name')) {
|
||||
return new Host(MonitoringBackend::instance(), $params->get('host_name'));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -172,8 +172,8 @@ abstract class MonitoredObjectController extends Controller
|
|||
} else {
|
||||
$isService = true;
|
||||
$params = array(
|
||||
'host_name' => $object->getHost()->getName(),
|
||||
'service_description' => $object->getName()
|
||||
'host_name' => $object->getHost()->getName(),
|
||||
'service' => $object->getName()
|
||||
);
|
||||
}
|
||||
$tabs->add(
|
||||
|
|
Loading…
Reference in New Issue