From 9f76d7e605078fd444fb6d34eea3fc4d14373083 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 20 Apr 2023 11:46:36 +0200 Subject: [PATCH] BranchActivity: show related host for services fixes #2736 --- doc/82-Changelog.md | 1 + library/Director/Db/Branch/BranchActivity.php | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/82-Changelog.md b/doc/82-Changelog.md index d0b2e79f..5c1f0984 100644 --- a/doc/82-Changelog.md +++ b/doc/82-Changelog.md @@ -14,6 +14,7 @@ This version hasn't been released yet * FEATURE: Data Fields are now sorted in a case-insensitive way (#2358) * FEATURE: Deployment Log now breaks lines (#2677) * FEATURE: Sort Template trees by name (#2691) +* FEATURE: Branch and Sync diff/preview now shows related host for services (#2736) * FIX: do not fail for (some) Service Dependencies (#2669, #1142) ### Icinga Configuration diff --git a/library/Director/Db/Branch/BranchActivity.php b/library/Director/Db/Branch/BranchActivity.php index 3812e753..e95ac7d9 100644 --- a/library/Director/Db/Branch/BranchActivity.php +++ b/library/Director/Db/Branch/BranchActivity.php @@ -294,7 +294,13 @@ class BranchActivity */ public function getObjectName() { - return $this->getProperty('object_name', 'unknown object name'); + if ($this->objectTable === BranchSupport::TABLE_ICINGA_SERVICE && $host = $this->getProperty('host')) { + $suffix = " ($host)"; + } else { + $suffix = ''; + } + + return $this->getProperty('object_name', 'unknown object name') . $suffix; } /**