mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
ControlsAndContent, js: trigger immediate refresh
...on missing WindowId. This fixes an issue for instances with multiple DB resources
This commit is contained in:
parent
3632eea164
commit
eedb6edff0
@ -7,6 +7,7 @@ use dipl\Web\Widget\Content;
|
|||||||
use dipl\Web\Widget\Controls;
|
use dipl\Web\Widget\Controls;
|
||||||
use dipl\Web\Widget\Tabs;
|
use dipl\Web\Widget\Tabs;
|
||||||
use dipl\Web\Url;
|
use dipl\Web\Url;
|
||||||
|
use Icinga\Web\Window;
|
||||||
|
|
||||||
trait ControlsAndContentHelper
|
trait ControlsAndContentHelper
|
||||||
{
|
{
|
||||||
@ -33,7 +34,16 @@ trait ControlsAndContentHelper
|
|||||||
public function controls()
|
public function controls()
|
||||||
{
|
{
|
||||||
if ($this->controls === null) {
|
if ($this->controls === null) {
|
||||||
|
/** @var Window $window */
|
||||||
|
$window = $this->Window();
|
||||||
|
$id = $window->getId();
|
||||||
|
if ($id === null || $id === Window::UNDEFINED) {
|
||||||
|
$id = '_UNDEFINED_';
|
||||||
|
}
|
||||||
$this->view->controls = $this->controls = new Controls();
|
$this->view->controls = $this->controls = new Controls();
|
||||||
|
$this->controls->addAttributes([
|
||||||
|
'data-director-window-id' => $id,
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->controls;
|
return $this->controls;
|
||||||
|
@ -671,7 +671,18 @@
|
|||||||
|
|
||||||
rendered: function(ev) {
|
rendered: function(ev) {
|
||||||
var iid;
|
var iid;
|
||||||
|
var icinga = this.module.icinga;
|
||||||
var $container = $(ev.currentTarget);
|
var $container = $(ev.currentTarget);
|
||||||
|
if ($container.children('div.controls').first().data('directorWindowId') === '_UNDEFINED_') {
|
||||||
|
var $url = $container.data('icingaUrl');
|
||||||
|
if (typeof $url !== 'undefined') {
|
||||||
|
icinga.loader.loadUrl($url, $container).autorefresh = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$container.children('div.controls').children().hide();
|
||||||
|
$container.children('div.content').hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.restoreContainerFieldsets($container);
|
this.restoreContainerFieldsets($container);
|
||||||
this.backupAllExtensibleSetDefaultValues($container);
|
this.backupAllExtensibleSetDefaultValues($container);
|
||||||
this.highlightFormErrors($container);
|
this.highlightFormErrors($container);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user