summaryrefslogtreecommitdiffstats
path: root/library/Icingadb/Widget/ItemList
diff options
context:
space:
mode:
Diffstat (limited to 'library/Icingadb/Widget/ItemList')
-rw-r--r--library/Icingadb/Widget/ItemList/BaseDowntimeListItem.php6
-rw-r--r--library/Icingadb/Widget/ItemList/HostDetailHeader.php4
-rw-r--r--library/Icingadb/Widget/ItemList/ServiceDetailHeader.php4
-rw-r--r--library/Icingadb/Widget/ItemList/StateList.php2
-rw-r--r--library/Icingadb/Widget/ItemList/StateListItem.php2
5 files changed, 13 insertions, 5 deletions
diff --git a/library/Icingadb/Widget/ItemList/BaseDowntimeListItem.php b/library/Icingadb/Widget/ItemList/BaseDowntimeListItem.php
index 7ebc1f6..dedaa72 100644
--- a/library/Icingadb/Widget/ItemList/BaseDowntimeListItem.php
+++ b/library/Icingadb/Widget/ItemList/BaseDowntimeListItem.php
@@ -56,7 +56,11 @@ abstract class BaseDowntimeListItem extends BaseListItem
protected function init(): void
{
- if ($this->item->is_flexible && $this->item->is_in_effect) {
+ if (
+ isset($this->item->start_time, $this->item->end_time)
+ && $this->item->is_flexible
+ && $this->item->is_in_effect
+ ) {
$this->startTime = $this->item->start_time->getTimestamp();
$this->endTime = $this->item->end_time->getTimestamp();
} else {
diff --git a/library/Icingadb/Widget/ItemList/HostDetailHeader.php b/library/Icingadb/Widget/ItemList/HostDetailHeader.php
index 97176da..b7afb23 100644
--- a/library/Icingadb/Widget/ItemList/HostDetailHeader.php
+++ b/library/Icingadb/Widget/ItemList/HostDetailHeader.php
@@ -50,7 +50,9 @@ class HostDetailHeader extends HostListItemMinimal
}
$stateChange->setIcon($this->state->getIcon());
- $stateChange->setHandled($this->state->is_handled || ! $this->state->is_reachable);
+ $stateChange->setHandled(
+ $this->state->is_problem && ($this->state->is_handled || ! $this->state->is_reachable)
+ );
$visual->addHtml($stateChange);
}
diff --git a/library/Icingadb/Widget/ItemList/ServiceDetailHeader.php b/library/Icingadb/Widget/ItemList/ServiceDetailHeader.php
index 2f0dbbd..8c5094d 100644
--- a/library/Icingadb/Widget/ItemList/ServiceDetailHeader.php
+++ b/library/Icingadb/Widget/ItemList/ServiceDetailHeader.php
@@ -50,7 +50,9 @@ class ServiceDetailHeader extends ServiceListItemMinimal
}
$stateChange->setIcon($this->state->getIcon());
- $stateChange->setHandled($this->state->is_handled || ! $this->state->is_reachable);
+ $stateChange->setHandled(
+ $this->state->is_problem && ($this->state->is_handled || ! $this->state->is_reachable)
+ );
$visual->addHtml($stateChange);
}
diff --git a/library/Icingadb/Widget/ItemList/StateList.php b/library/Icingadb/Widget/ItemList/StateList.php
index 1e6dcb9..9671c97 100644
--- a/library/Icingadb/Widget/ItemList/StateList.php
+++ b/library/Icingadb/Widget/ItemList/StateList.php
@@ -53,7 +53,7 @@ abstract class StateList extends BaseItemList
if ($this->data instanceof VolatileStateResults && $this->data->isRedisUnavailable()) {
$this->prependWrapper((new HtmlDocument())->addHtml(new Notice(
- t('Icinga Redis is currently unavailable. The shown information might be outdated.')
+ t('Redis is currently unavailable. The shown information might be outdated.')
)));
}
}
diff --git a/library/Icingadb/Widget/ItemList/StateListItem.php b/library/Icingadb/Widget/ItemList/StateListItem.php
index d0b3363..cd8ff16 100644
--- a/library/Icingadb/Widget/ItemList/StateListItem.php
+++ b/library/Icingadb/Widget/ItemList/StateListItem.php
@@ -99,7 +99,7 @@ abstract class StateListItem extends BaseListItem
{
$stateBall = new StateBall($this->state->getStateText(), $this->getStateBallSize());
$stateBall->add($this->state->getIcon());
- if ($this->state->is_handled || ! $this->state->is_reachable) {
+ if ($this->state->is_problem && ($this->state->is_handled || ! $this->state->is_reachable)) {
$stateBall->getAttributes()->add('class', 'handled');
}