Improve host-service distinction for hosts, services, comments and

downtimes
This commit is contained in:
Jennifer Mourek 2019-05-27 11:44:02 +02:00 committed by Eric Lippmann
parent a94e8fb211
commit 9c3da17f2e
5 changed files with 136 additions and 59 deletions

View File

@ -61,33 +61,56 @@ if (! $this->compact): ?>
<td>
<div class="state-header">
<?= $this->iconImage()->service($service) ?>
<?php if ($this->showHost): ?><?= $this->qlink(
$service->host_display_name
. ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''),
$hostLink,
null,
array(
'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$service->host_display_name
)
)
) ?>&#58;
<?php endif ?><?= $this->qlink(
$service->service_display_name,
$serviceLink,
null,
array(
'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$service->service_display_name,
$service->host_display_name
),
'class' => 'rowaction'
)
) ?>
<span class="state-icons"><?= $this->serviceFlags($service) ?></span>
<span class="service-on">
<?= $this->iconImage()->service($service) ?>
<?php
if ($this->showHost) {
echo sprintf(
$this->translate('%s on %s', 'service on host'),
$this->qlink(
$service->service_display_name,
$serviceLink,
null,
array(
'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$service->service_display_name,
$service->host_display_name
),
'class' => 'rowaction'
)
),
$this->qlink(
$service->host_display_name
. ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''),
$hostLink,
null,
[
'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$service->host_display_name
)
]
)
);
} else {
echo $this->qlink(
$service->service_display_name,
$serviceLink,
null,
array(
'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$service->service_display_name,
$service->host_display_name
),
'class' => 'rowaction'
)
);
}
?>
</span>
<span class="state-icons"><?= $this->serviceFlags($service) ?></span>
</div>
<div class="overview-plugin-output-container">
<div class="overview-performance-data">

View File

@ -1,23 +1,42 @@
<div class="comment-author">
<?php if ($comment->objecttype === 'service') {
echo $this->icon('service', $this->translate('Service'));
echo $this->qlink(
$comment->host_display_name . ': ' . $comment->service_display_name,
'monitoring/service/show',
array(
'host' => $comment->host_name,
'service' => $comment->service_description
echo '<span class="service-on">';
echo sprintf(
$this->translate('%s on %s', 'service on host'),
$this->qlink(
$comment->service_display_name,
'monitoring/service/show',
[
'host' => $comment->host_name,
'service' => $comment->service_description
],
null,
[
'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$comment->service_display_name,
$comment->host_display_name
),
'class' => 'rowaction'
]
),
array(
'title' => sprintf(
$this->translate('Show detailed information for this comment about service %s on host %s'),
$comment->service_display_name,
$comment->host_display_name
)
$this->qlink(
$comment->host_display_name,
$this->href(
'monitoring/host/show',
['host' => $comment->host_name]
),
null,
[
'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$comment->host_display_name
)
]
)
);
echo '</span>';
} else {
echo $this->icon('host', $this->translate('Host'));
echo $this->qlink(
$comment->host_display_name,
'monitoring/host/show',

View File

@ -9,24 +9,45 @@
</td>
<td>
<div class="comment-author">
<?php if ($isService): ?>
<?= $this->icon('service', $this->translate('Service')); ?> <?= $this->qlink(
$downtime->host_display_name . ': ' . $downtime->service_display_name,
'monitoring/service/show',
array(
'host' => $downtime->host_name,
'service' => $downtime->service_description
<?php if ($isService) {
echo '<span class="service-on">';
echo sprintf(
$this->translate('%s on %s', 'service on host'),
$this->qlink(
$downtime->service_display_name,
'monitoring/service/show',
[
'host' => $downtime->host_name,
'service' => $downtime->service_description
],
null,
[
'title' => sprintf(
$this->translate('Show detailed information for service %s on host %s'),
$downtime->service_display_name,
$downtime->host_display_name
),
'class' => 'rowaction'
]
),
array(
'title' => sprintf(
$this->translate('Show detailed information for this downtime scheduled for service %s on host %s'),
$downtime->service_display_name,
$downtime->host_display_name
)
$this->qlink(
$downtime->host_display_name,
$this->href(
'monitoring/host/show',
['host' => $downtime->host_name]
),
null,
[
'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$downtime->host_display_name
)
]
)
); ?>
<?php else: ?>
<?= $this->icon('host', $this->translate('host')); ?> <?= $this->qlink(
);
echo '</span>';
} else {
echo $this->qlink(
$downtime->host_display_name,
'monitoring/host/show',
array('host' => $downtime->host_name, 'downtime_id' => $downtime->id),
@ -36,8 +57,8 @@
$downtime->host_display_name
)
)
); ?>
<?php endif ?>
);
} ?>
<span class="comment-time">
<?= $this->escape(sprintf(
$downtime->is_flexible

View File

@ -175,6 +175,16 @@
}
}
.service-on {
color: @text-color-light;
> a {
color: @text-color;
letter-spacing: normal;
font-weight: bold;
}
}
// State table in the host and service multi-selection and detail views
.host-detail-state,
.service-detail-state {

View File

@ -205,6 +205,10 @@
// Wraps links, icons and meta in overviews
.state-header {
.clearfix();
> a {
font-weight: bold;
}
}
// State icons, e.g. acknowledged in overviews