Skip to content

Commit

Permalink
Revert "Require host_name' instead of host' to show or list particu…
Browse files Browse the repository at this point in the history
…lar objects"

This reverts commit b93d18a.
  • Loading branch information
Johannes Meyer committed Apr 20, 2015
1 parent 894457a commit f11ea04
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion doc/accessibility/link-labels.html
Expand Up @@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<a href="/monitoring/host/show?host_name=localhost"
<a href="/monitoring/host/show?host=localhost"
title="Show detailed information about the host localhost"
aria-label="Show detailed information about the host localhost">localhost</a>
</body>
Expand Down
Expand Up @@ -26,7 +26,7 @@ class Monitoring_HostController extends MonitoredObjectController
*/
public function init()
{
$host = new Host($this->backend, $this->params->get('host_name'));
$host = new Host($this->backend, $this->params->get('host'));

$this->applyRestriction('monitoring/hosts/filter', $host);

Expand Down
Expand Up @@ -25,7 +25,7 @@ class Monitoring_ServiceController extends MonitoredObjectController
*/
public function init()
{
$service = new Service($this->backend, $this->params->get('host_name'), $this->params->get('service'));
$service = new Service($this->backend, $this->params->get('host'), $this->params->get('service'));

$this->applyRestriction('monitoring/services/filter', $service);

Expand Down
6 changes: 3 additions & 3 deletions modules/monitoring/application/controllers/ShowController.php
Expand Up @@ -189,12 +189,12 @@ protected function createTabs()
if ($object->getType() === $object::TYPE_HOST) {
$isService = false;
$params = array(
'host_name' => $object->getName()
'host' => $object->getName()
);
} else {
$isService = true;
$params = array(
'host_name' => $object->getHost()->getName(),
'host' => $object->getHost()->getName(),
'service' => $object->getName()
);
}
Expand All @@ -208,7 +208,7 @@ protected function createTabs()
),
'label' => $this->translate('Host'),
'icon' => 'host',
'url' => 'monitoring/host/show',
'url' => 'monitoring/show/host',
'urlParams' => $params,
)
);
Expand Down
4 changes: 2 additions & 2 deletions modules/monitoring/application/views/helpers/Link.php
Expand Up @@ -33,7 +33,7 @@ public function host($host, $linkText)
return $this->view->qlink(
$linkText,
'monitoring/host/show',
array('host_name' => $host),
array('host' => $host),
array('title' => sprintf($this->view->translate('Show detailed information for host %s'), $host))
);
}
Expand All @@ -55,7 +55,7 @@ public function service($service, $serviceLinkText, $host, $hostLinkText)
$this->view->qlink(
$serviceLinkText,
'monitoring/service/show',
array('host_name' => $host, 'service' => $service),
array('host' => $host, 'service' => $service),
array('title' => sprintf(
$this->view->translate('Show detailed information for service %s on host %s'),
$service,
Expand Down
Expand Up @@ -65,7 +65,7 @@ protected function fixLinks($html)
parse_str($m[1], $params);
if (isset($params['host'])) {
$tag->setAttribute('href', $this->view->baseUrl(
'/monitoring/host/show?host_name=' . urlencode($params['host']
'/monitoring/host/show?host=' . urlencode($params['host']
)));
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions modules/monitoring/application/views/scripts/list/hosts.phtml
Expand Up @@ -34,7 +34,7 @@ if (count($hosts) === 0) {
<?php foreach($hosts as $host):

$hostStateName = Host::getStateText($host->host_state);
$hostLink = $this->href('monitoring/host/show', array('host_name' => $host->host_name));
$hostLink = $this->href('monitoring/host/show', array('host' => $host->host_name));

$icons = array();
if (! $host->host_handled && $host->host_state > 0){
Expand Down Expand Up @@ -104,7 +104,7 @@ if (count($hosts) === 0) {
),
'monitoring/show/services',
array(
'host_name' => $host->host_name,
'host' => $host->host_name,
'service_problem' => 1,
'service_handled' => 0
),
Expand Down
Expand Up @@ -68,7 +68,7 @@ foreach ($serviceDescriptions as $service_description): ?>
<?= $this->qlink(
$host_name,
'monitoring/show/services?' . $serviceFilter,
array('host_name' => $host_name),
array('host' => $host_name),
array('title' => sprintf($this->translate('List all reported services on host %s'), $host_name))
); ?>
</th>
Expand All @@ -80,9 +80,9 @@ foreach ($serviceDescriptions as $service_description): ?>
</span>
<?= $this->qlink(
'',
'monitoring/service/show',
'monitoring/show/service',
array(
'host_name' => $service->host_name,
'host' => $service->host_name,
'service' => $service->service_description
),
array(
Expand Down
Expand Up @@ -34,14 +34,14 @@ if (count($services) === 0) {
$serviceLink = $this->href(
'monitoring/service/show',
array(
'host_name' => $service->host_name,
'service' => $service->service_description
'host' => $service->host_name,
'service' => $service->service_description
)
);
$hostLink = $this->href(
'monitoring/host/show',
'monitoring/show/host',
array(
'host_name' => $service->host_name,
'host' => $service->host_name,
)
);
$serviceStateName = Service::getStateText($service->service_state);
Expand Down
Expand Up @@ -3,7 +3,7 @@
use Icinga\Web\Url;
use Icinga\Module\Monitoring\Object\Service;

$selfUrl = Url::fromPath('monitoring/show/services', array('host_name' => $object->host_name));
$selfUrl = Url::fromPath('monitoring/show/services', array('host' => $object->host_name));
$currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl();
?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>>
<?php if ($object->stats->services_total): ?>
Expand Down
Expand Up @@ -148,8 +148,8 @@ $output = $this->tickets ? preg_replace_callback(
$event->service_display_name,
'monitoring/show/service',
array(
'host_name' => $event->host_name,
'service' => $event->service_description
'host' => $event->host_name,
'service' => $event->service_description
),
array('title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
Expand Down
Expand Up @@ -556,10 +556,10 @@ public function __isset($name)
*/
public static function fromParams(UrlParams $params)
{
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'));
if ($params->has('service') && $params->has('host')) {
return new Service(MonitoringBackend::instance(), $params->get('host'), $params->get('service'));
} elseif ($params->has('host')) {
return new Host(MonitoringBackend::instance(), $params->get('host'));
}
return null;
}
Expand Down
Expand Up @@ -167,12 +167,12 @@ protected function createTabs()
if ($object->getType() === $object::TYPE_HOST) {
$isService = false;
$params = array(
'host_name' => $object->getName()
'host' => $object->getName()
);
} else {
$isService = true;
$params = array(
'host_name' => $object->getHost()->getName(),
'host' => $object->getHost()->getName(),
'service' => $object->getName()
);
}
Expand Down

0 comments on commit f11ea04

Please sign in to comment.