Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/Icingadb/Common/Icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Icons

const IS_ACKNOWLEDGED = 'check';

const IS_FLAPPING = 'bolt';
const IS_FLAPPING = 'random';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you change the icon? If this was not discussed, please remove this change.

Copy link
Contributor

@sukhwinder33445 sukhwinder33445 Nov 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the reason is that the footer used it, then it was wrong to use random before. The state-ball visuals have always used bolt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was discussed with @lippserd. I think the reason was to have the state-ball and footer visual the same.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be a breaking change. There must be a reason why we used bolt before. @flourish86, can you please clarify which icon should be used here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting and great that this is pointed out.

It doesn't make sense to have two different icons for flapping. We added the flapping "bolt" to the state ball after the footer icon and probably haven't though of to adjust the latter.

Looking at it after taking a step back, the footer icon doesn't deliver any value anymore, so my suggestion would be to drop it completely and continue to use the bolt icon for the state ball.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The footer should also have the icon (it is part of .state-icons in detailed view mode, which can show more icons at the same time as the state-ball), but the same as state-ball, so we’ll use the bolt icon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

he footer icon doesn't deliver any value anymore

It still delivers value, as the host can be in downtime and in flapping state at the same time, but the state-ball will only show downtime icon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The footer should also have the icon (it is part of .state-icons in detailed view mode, which can show more icons at the same time as the state-ball), but the same as state-ball, so we’ll use the bolt icon.

Yes, I know the icons in the footer. But removing only the flapping icon would not harm the others, would it?

It still delivers value, as the host can be in downtime and in flapping state at the same time, but the state-ball will only show downtime icon.

Ok, I’d consider this quite an edge case and I’d argue, that if it actually is in downtime most people will not care about the object flapping.

I'm fine with keeping it, though.

Besides that, the icons have to be the same. So one of those has to be changed. I’d opt for the one in the footer, since the bolt works better with larger sizes in the state ball. And the event visuals for flapping also use the bolt icon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with keeping it, though.

Okay 😄. @jrauh01, please use bolt in both cases.


const IS_PERSISTENT = 'thumbtack';

Expand Down
47 changes: 42 additions & 5 deletions library/Icingadb/View/BaseHostAndServiceRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,56 @@ public function assembleFooter($item, HtmlDocument $footer, string $layout): voi
);
}

if ($item->state->is_acknowledged) {
$title = $isService
? sprintf(
$this->translate('Service "%s" on "%s" is acknowledged'),
$item->display_name,
$item->host->display_name
)
: sprintf($this->translate('Host "%s" is acknowledged'), $item->display_name);

$statusIcons->addHtml(new Icon(Icons::IS_ACKNOWLEDGED, ['title' => $title]));
}

if ($item->state->in_downtime) {
if ($isService) {
$message = $item->state->is_handled
? 'Service "%s" on "%s" is handled by Downtime'
: 'Service "%s" on "%s" is in Downtime';

$title = sprintf($this->translate($message), $item->display_name, $item->host->display_name);
} else {
$message = $item->state->is_handled ? 'Host "%s" is handled by Downtime' : 'Host "%s" is in Downtime';

$title = sprintf($this->translate($message), $item->display_name);
}

$statusIcons->addHtml(new Icon(Icons::IN_DOWNTIME, ['title' => $title]));
}

if ($item->state->is_flapping) {
$title = $isService
? sprintf(
$this->translate('Service "%s" on "%s" is in flapping state'),
$item->display_name,
$item->host->display_name
)
: sprintf(
$this->translate('Host "%s" is in flapping state'),
$item->display_name
);
: sprintf($this->translate('Host "%s" is in flapping state'), $item->display_name);

$statusIcons->addHtml(new Icon(Icons::IS_FLAPPING, ['title' => $title]));
}

if (! $item->state->is_reachable) {
$title = $isService
? sprintf(
$this->translate('Service "%s" on "%s" is unreachable'),
$item->display_name,
$item->host->display_name
)
: sprintf($this->translate('Host "%s" is unreachable'), $item->display_name);

$statusIcons->addHtml(new Icon('random', ['title' => $title]));
$statusIcons->add(new Icon(Icons::HOST_DOWN, ['title' => $title]));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use addHtml.

}

if (! $item->notifications_enabled) {
Expand Down
Loading