mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-24 21:12:53 -05:00
parent
b8df6a8823
commit
2fc48f2124
3 changed files with 17 additions and 10 deletions
|
|
@ -57,7 +57,7 @@ use Icinga\Module\Businessprocess\BusinessProcess;
|
|||
<?php endif ?>
|
||||
</ul>
|
||||
<?php endif ?>
|
||||
<div class="bp">
|
||||
<div id="<?= $this->bp->getHtmlId() ?>" class="bp">
|
||||
<?= $this->bp->renderHtml($this) ?>
|
||||
<?php if (! $this->bpconfig->isLocked()): ?>
|
||||
<?php if ($this->bp instanceof BusinessProcess): /* do not render when showing subtree */ ?>
|
||||
|
|
|
|||
|
|
@ -171,6 +171,11 @@ class BusinessProcess
|
|||
return $this->name;
|
||||
}
|
||||
|
||||
public function getHtmlId()
|
||||
{
|
||||
return 'businessprocess-' . preg_replace('/[\r\n\t\s]/', '_', $this->getName());
|
||||
}
|
||||
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
|
|
|
|||
|
|
@ -134,20 +134,20 @@
|
|||
},
|
||||
|
||||
fixOpenedBps: function(event) {
|
||||
var $container = $(event.currentTarget);
|
||||
var container_id = $container.attr('id');
|
||||
var $bpDiv = $(event.currentTarget).find('div.bp');
|
||||
var bpName = $bpDiv.attr('id');
|
||||
|
||||
if (typeof this.idCache[container_id] === 'undefined') {
|
||||
if (typeof this.idCache[bpName] === 'undefined') {
|
||||
return;
|
||||
}
|
||||
var $procs = $('table.process', $container);
|
||||
$.each(this.idCache[$container.attr('id')], function(idx, id) {
|
||||
var $procs = $bpDiv.find('table.process');
|
||||
|
||||
$.each(this.idCache[bpName], function(idx, id) {
|
||||
var $el = $('#' + id);
|
||||
$procs = $procs.not($el);
|
||||
|
||||
$el.parents('table.process').each(function (idx, el) {
|
||||
$procs = $procs.not($(el));
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -160,9 +160,11 @@
|
|||
* Only get the deepest nodes to keep requests as small as possible
|
||||
*/
|
||||
rememberOpenedBps: function (event) {
|
||||
var $container = $(event.currentTarget);
|
||||
var ids = [];
|
||||
$('table.process', $container)
|
||||
var $bpDiv = $(event.currentTarget).find('div.bp');
|
||||
var $bpName = $bpDiv.attr('id');
|
||||
|
||||
$bpDiv.find('table.process')
|
||||
.not('table.process.collapsed')
|
||||
.not('table.process.collapsed table.process')
|
||||
.each(function (key, el) {
|
||||
|
|
@ -172,7 +174,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
this.idCache[$container.attr('id')] = ids;
|
||||
this.idCache[$bpName] = ids;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue