[icinga-checkins] icinga.org: icingaweb2/bugfix/show-host-aliases-in-detail-area-11348: Host /show: display host alias if it differs from host_name and display_name

git at icinga.org git at icinga.org
Tue May 31 10:58:55 CEST 2016


Module: icingaweb2
Branch: bugfix/show-host-aliases-in-detail-area-11348
Commit: f39357d74afbc8db34bfa9a6122082e2a2d2c31a
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=f39357d74afbc8db34bfa9a6122082e2a2d2c31a

Author: Alexander A. Klimov <alexander.klimov at netways.de>
Date:   Tue May 31 10:57:04 2016 +0200

Host/show: display host alias if it differs from host_name and display_name

refs #11348

---

 .../application/views/scripts/partials/object/host-header.phtml   |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/monitoring/application/views/scripts/partials/object/host-header.phtml b/modules/monitoring/application/views/scripts/partials/object/host-header.phtml
index 8bc7b6c..da41067 100644
--- a/modules/monitoring/application/views/scripts/partials/object/host-header.phtml
+++ b/modules/monitoring/application/views/scripts/partials/object/host-header.phtml
@@ -19,6 +19,11 @@ use Icinga\Module\Monitoring\Object\Host;
         <?php if ($object->host_display_name !== $object->host_name): ?>
             <span class="selectable host-meta">(<?= $this->escape($object->host_name) ?>)</span>
         <?php endif ?>
+        <?php if ($object->host_alias !== $object->host_display_name && $object->host_alias !== $object->host_name): ?>
+            <div class="selectable host-meta"><?=
+                $this->escape(sprintf($this->translate('Alias: %s', 'host'), $object->host_alias))
+            ?></div>
+        <?php endif ?>
             <?= $this->render('partials/host/statusicons.phtml') ?>
         <?php if ($object->host_address6 && $object->host_address6 !== $object->host_name): ?>
             <div class="selectable host-meta" title="<?= $this->translate('IPv6 address') ?>">



More information about the icinga-checkins mailing list