Skip to content

Commit 0f70dfa

Browse files
committed
Add tooltips for state pictograms
1 parent 601753a commit 0f70dfa

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

library/Icingadb/Model/State.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,31 +151,30 @@ public function getIcon(): ?Icon
151151
$icon = null;
152152
switch (true) {
153153
case $this->is_acknowledged:
154-
$icon = new Icon(Icons::IS_ACKNOWLEDGED);
154+
$icon = new Icon(Icons::IS_ACKNOWLEDGED, [
155+
'title' => sprintf('%s (%s)', strtoupper($this->getStateTextTranslated()), t('is acknowledged'))
156+
]);
155157

156158
break;
157159
case $this->in_downtime:
158-
$icon = new Icon(
159-
Icons::IN_DOWNTIME,
160-
['title' => sprintf(
160+
$icon = new Icon(Icons::IN_DOWNTIME, [
161+
'title' => sprintf(
161162
'%s (%s)',
162163
strtoupper($this->getStateTextTranslated()),
163164
$this->is_handled ? t('handled by Downtime') : t('in Downtime')
164-
)]
165-
);
165+
)
166+
]);
166167

167168
break;
168169
case $this->is_flapping:
169-
$icon = new Icon(Icons::IS_FLAPPING);
170+
$icon = new Icon(Icons::IS_FLAPPING, [
171+
'title' => sprintf('%s (%s)', strtoupper($this->getStateTextTranslated()), t('is flapping'))
172+
]);
170173

171174
break;
172175
case ! $this->is_reachable:
173176
$icon = new Icon(Icons::HOST_DOWN, [
174-
'title' => sprintf(
175-
'%s (%s)',
176-
strtoupper($this->getStateTextTranslated()),
177-
t('is unreachable')
178-
)
177+
'title' => sprintf('%s (%s)', strtoupper($this->getStateTextTranslated()), t('is unreachable'))
179178
]);
180179

181180
break;

0 commit comments

Comments
 (0)