Add proper titles to the service grid

refs #8458
This commit is contained in:
Johannes Meyer 2015-02-23 17:24:46 +01:00
parent a64f546a71
commit c4aa02c3f0

View File

@ -37,18 +37,23 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
); ?></th> ); ?></th>
<th colspan="<?= count($serviceStates); ?>"> <th colspan="<?= count($serviceStates); ?>">
<div> <div>
<?php foreach (array_keys($serviceStates) as $service_description): ?> <?php
$serviceDescriptions = array_keys($serviceStates);
$serviceFilter = '(service_description=' . implode('|service_description=', $serviceDescriptions) . ')';
foreach ($serviceDescriptions as $service_description): ?>
<span> <span>
<a href="<?= $this->href( <?= $this->qlink(
'monitoring/list/services', '<abbr>' . (strlen($service_description) > 18 ? substr($service_description, 0, 18) . '...' : $service_description) . '</abbr>',
'monitoring/list/services?' . $hostFilter,
array( array(
'service_description' => $service_description 'service_description' => $service_description
) ),
) . '&' . $hostFilter; ?>"> array(
<abbr title="<?= $service_description; ?>"> 'title' => sprintf($this->translate('List all services with the name "%s" on all reported hosts'), $service_description)
<?= strlen($service_description) > 18 ? substr($service_description, 0, 18) . '...' : $service_description; ?> ),
</abbr> false
</a> ); ?>
</span> </span>
<?php endforeach ?> <?php endforeach ?>
</div> </div>
@ -60,18 +65,40 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . '
<?php endif ?> <?php endif ?>
<tr> <tr>
<th> <th>
<a href="<?= $this->href('monitoring/show/services', array('host' => $host_name)); ?>"><?= $host_name; ?></a> <?= $this->qlink(
$host_name,
'monitoring/show/services?' . $serviceFilter,
array('host' => $host_name),
array('title' => sprintf($this->translate('List all reported services on host %s'), $host_name))
); ?>
</th> </th>
<?php foreach (array_values($serviceStates) as $service): ?> <?php foreach (array_values($serviceStates) as $service): ?>
<?php if ($service !== null): ?> <?php if ($service !== null): ?>
<td> <td>
<a href="<?= $this->href('monitoring/show/service', array( <span class="sr-only" id="<?= $service->host_name . '_' . $service->service_description . '_desc'; ?>">
'host' => $service->host_name, <?= $this->escape($service->service_output); ?>
'service' => $service->service_description </span>
)); ?>" title="<?= $this->escape($service->service_output); ?>" class="state_<?= Service::getStateText($service->service_state); ?> <?= $service->service_handled ? 'handled' : ''; ?>"></a> <?= $this->qlink(
'',
'monitoring/show/service',
array(
'host' => $service->host_name,
'service' => $service->service_description
),
array(
'aria-describedby' => $service->host_name . '_' . $service->service_description . '_desc',
'class' => 'state_' . Service::getStateText($service->service_state). ($service->service_handled ? ' handled' : ''),
'title' => $this->escape($service->service_output),
'aria-label' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$service->service_description,
$service->host_name
)
)
); ?>
</td> </td>
<?php else: ?> <?php else: ?>
<td>&middot;</td> <td><span aria-hidden="true">&middot;</span></td>
<?php endif ?> <?php endif ?>
<?php endforeach ?> <?php endforeach ?>
</tr> </tr>