mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-29 02:09:33 -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 = '';
|
$cfg = '';
|
||||||
$children = array();
|
$children = array();
|
||||||
|
|
||||||
foreach ($this->getChildren() as $name => $child) {
|
foreach ($this->getChildren() as $name => $child) {
|
||||||
$children[] = (string) $child;
|
$children[] = (string) $child;
|
||||||
|
if (array_key_exists($name, $rendered)) { continue; }
|
||||||
if ($child instanceof BpNode) {
|
if ($child instanceof BpNode) {
|
||||||
$cfg .= $child->toLegacyConfigString() . "\n";
|
$cfg .= $child->toLegacyConfigString($rendered) . "\n";
|
||||||
}
|
}
|
||||||
|
$rendered[$name] = true;
|
||||||
}
|
}
|
||||||
$eq = '=';
|
$eq = '=';
|
||||||
$op = $this->operator;
|
$op = $this->operator;
|
||||||
|
|
|
||||||
|
|
@ -408,8 +408,9 @@ class BusinessProcess
|
||||||
date('Y-m-d H:i:s')
|
date('Y-m-d H:i:s')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$rendered = array();
|
||||||
foreach ($this->getChildren() as $child) {
|
foreach ($this->getChildren() as $child) {
|
||||||
$conf .= $child->toLegacyConfigString();
|
$conf .= $child->toLegacyConfigString($rendered);
|
||||||
}
|
}
|
||||||
return $conf . "\n";
|
return $conf . "\n";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ class HostNode extends Node
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
return $view->qlink($this->getHostname(), 'monitoring/host/show', array(
|
return $view->qlink($this->getHostname(), 'monitoring/host/show', array(
|
||||||
'host' => $this->getHostname,
|
'host' => $this->getHostname(),
|
||||||
'processName' => $this->bp->getName()
|
'processName' => $this->bp->getName()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ abstract class Node
|
||||||
return ' ';
|
return ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function toLegacyConfigString() { return '';}
|
public function toLegacyConfigString(& $rendered = array()) { return '';}
|
||||||
//abstract public function toLegacyConfigString();
|
//abstract public function toLegacyConfigString();
|
||||||
|
|
||||||
public function __toString()
|
public function __toString()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue