mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-02-02 16:39:25 -05:00
Fix that handled nodes are not handled
This commit is contained in:
parent
4df9f52535
commit
3a0b40a91f
2 changed files with 10 additions and 4 deletions
|
|
@ -99,13 +99,16 @@ class BpNode extends Node
|
|||
return $this->counters;
|
||||
}
|
||||
|
||||
public function hasProblems()
|
||||
public function hasProblems(bool $ignoreHandledStates = false)
|
||||
{
|
||||
if ($this->isProblem()) {
|
||||
if ($this->isProblem() && ($ignoreHandledStates || ! $this->isHandled())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$okStates = array('OK', 'UP', 'PENDING', 'MISSING');
|
||||
$okStates = ['OK', 'UP', 'PENDING', 'MISSING'];
|
||||
if (! $ignoreHandledStates) {
|
||||
array_push($okStates, 'CRITICAL-HANDLED', 'WARNING-HANDLED', 'UNKNOWN-HANDLED');
|
||||
}
|
||||
|
||||
foreach ($this->getStateSummary() as $state => $cnt) {
|
||||
if ($cnt !== 0 && ! in_array($state, $okStates)) {
|
||||
|
|
@ -149,7 +152,7 @@ class BpNode extends Node
|
|||
if (isset($this->stateOverrides[$child->getName()])) {
|
||||
$problem = $this->getChildState($child) > 0;
|
||||
} else {
|
||||
$problem = $child->isProblem() || ($child instanceof BpNode && $child->hasProblems());
|
||||
$problem = $child->isProblem() || ($child instanceof BpNode && $child->hasProblems(true));
|
||||
}
|
||||
|
||||
if ($problem) {
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ class BpDashboardTile extends BaseHtmlElement
|
|||
|
||||
foreach ($bp->getChildren() as $node) {
|
||||
$state = strtolower($node->getStateName());
|
||||
if ($node->isHandled()) {
|
||||
$state .= ' handled';
|
||||
}
|
||||
|
||||
$tiles->add(Html::tag(
|
||||
'a',
|
||||
|
|
|
|||
Loading…
Reference in a new issue