Skip to content

Commit

Permalink
ui: Do not show okay states as handled if the object is unreachable
Browse files Browse the repository at this point in the history
fixes #993
  • Loading branch information
nilmerg committed Mar 21, 2024
1 parent a034449 commit 54ec954
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion library/Icingadb/Widget/ItemList/HostDetailHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ protected function assembleVisual(BaseHtmlElement $visual): void
}

$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);
}
Expand Down
4 changes: 3 additions & 1 deletion library/Icingadb/Widget/ItemList/ServiceDetailHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ protected function assembleVisual(BaseHtmlElement $visual): void
}

$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);
}
Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Widget/ItemList/StateListItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected function assembleVisual(BaseHtmlElement $visual): void
{
$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');
}

Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Widget/ItemTable/StateRowItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function assembleVisual(BaseHtmlElement $visual)
$stateBall = new StateBall($this->item->state->getStateText(), StateBall::SIZE_LARGE);
$stateBall->add($this->item->state->getIcon());

if ($this->item->state->is_handled) {
if ($this->item->state->is_problem && ($this->item->state->is_handled || ! $this->item->state->is_reachable)) {

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 7.2 on ubuntu-latest

Cannot access property $is_problem on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 7.2 on ubuntu-latest

Cannot access property $is_reachable on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 7.3 on ubuntu-latest

Cannot access property $is_problem on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 7.3 on ubuntu-latest

Cannot access property $is_reachable on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 7.4 on ubuntu-latest

Cannot access property $is_problem on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 7.4 on ubuntu-latest

Cannot access property $is_reachable on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.0 on ubuntu-latest

Cannot access property $is_problem on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.0 on ubuntu-latest

Cannot access property $is_reachable on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.1 on ubuntu-latest

Cannot access property $is_problem on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.1 on ubuntu-latest

Cannot access property $is_reachable on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.2 on ubuntu-latest

Cannot access property $is_problem on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.2 on ubuntu-latest

Cannot access property $is_reachable on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.3 on ubuntu-latest

Cannot access property $is_problem on mixed.

Check failure on line 36 in library/Icingadb/Widget/ItemTable/StateRowItem.php

View workflow job for this annotation

GitHub Actions / Static analysis for php 8.3 on ubuntu-latest

Cannot access property $is_reachable on mixed.
$stateBall->getAttributes()->add('class', 'handled');
}

Expand Down

0 comments on commit 54ec954

Please sign in to comment.