mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-20 23:00:16 -05:00
BusinessProcess: avoid duplicates when stored
This commit is contained in:
parent
a7f5c6c61c
commit
d243271462
4 changed files with 8 additions and 5 deletions
|
|
@ -246,16 +246,18 @@ class BpNode extends Node
|
|||
));
|
||||
}
|
||||
|
||||
public function toLegacyConfigString()
|
||||
public function toLegacyConfigString(& $rendered = array())
|
||||
{
|
||||
$cfg = '';
|
||||
$children = array();
|
||||
|
||||
foreach ($this->getChildren() as $name => $child) {
|
||||
$children[] = (string) $child;
|
||||
if (array_key_exists($name, $rendered)) { continue; }
|
||||
if ($child instanceof BpNode) {
|
||||
$cfg .= $child->toLegacyConfigString() . "\n";
|
||||
$cfg .= $child->toLegacyConfigString($rendered) . "\n";
|
||||
}
|
||||
$rendered[$name] = true;
|
||||
}
|
||||
$eq = '=';
|
||||
$op = $this->operator;
|
||||
|
|
|
|||
|
|
@ -408,8 +408,9 @@ class BusinessProcess
|
|||
date('Y-m-d H:i:s')
|
||||
);
|
||||
|
||||
$rendered = array();
|
||||
foreach ($this->getChildren() as $child) {
|
||||
$conf .= $child->toLegacyConfigString();
|
||||
$conf .= $child->toLegacyConfigString($rendered);
|
||||
}
|
||||
return $conf . "\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class HostNode extends Node
|
|||
));
|
||||
} else {
|
||||
return $view->qlink($this->getHostname(), 'monitoring/host/show', array(
|
||||
'host' => $this->getHostname,
|
||||
'host' => $this->getHostname(),
|
||||
'processName' => $this->bp->getName()
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ abstract class Node
|
|||
return ' ';
|
||||
}
|
||||
|
||||
public function toLegacyConfigString() { return '';}
|
||||
public function toLegacyConfigString(& $rendered = array()) { return '';}
|
||||
//abstract public function toLegacyConfigString();
|
||||
|
||||
public function __toString()
|
||||
|
|
|
|||
Loading…
Reference in a new issue