mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
js: Allow to reload the window
This commit is contained in:
parent
9e0785b0b4
commit
228e503131
@ -47,6 +47,13 @@ class Response extends Zend_Controller_Response_Http
|
|||||||
*/
|
*/
|
||||||
protected $request;
|
protected $request;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to instruct the client to reload the window
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $reloadWindow;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to instruct client side script code to reload CSS
|
* Whether to instruct client side script code to reload CSS
|
||||||
*
|
*
|
||||||
@ -198,6 +205,30 @@ class Response extends Zend_Controller_Response_Http
|
|||||||
return $this->request;
|
return $this->request;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get whether to instruct the client to reload the window
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function isWindowReloaded()
|
||||||
|
{
|
||||||
|
return $this->reloadWindow;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether to instruct the client to reload the window
|
||||||
|
*
|
||||||
|
* @param bool $reloadWindow
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setReloadWindow($reloadWindow)
|
||||||
|
{
|
||||||
|
$this->reloadWindow = $reloadWindow;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get whether to instruct client side script code to reload CSS
|
* Get whether to instruct client side script code to reload CSS
|
||||||
*
|
*
|
||||||
@ -302,6 +333,9 @@ class Response extends Zend_Controller_Response_Http
|
|||||||
if ($this->getRerenderLayout()) {
|
if ($this->getRerenderLayout()) {
|
||||||
$this->setHeader('X-Icinga-Container', 'layout', true);
|
$this->setHeader('X-Icinga-Container', 'layout', true);
|
||||||
}
|
}
|
||||||
|
if ($this->isWindowReloaded()) {
|
||||||
|
$this->setHeader('X-Icinga-Reload-Window', 'yes', true);
|
||||||
|
}
|
||||||
if ($this->isReloadCss()) {
|
if ($this->isReloadCss()) {
|
||||||
$this->setHeader('X-Icinga-Reload-Css', 'now', true);
|
$this->setHeader('X-Icinga-Reload-Css', 'now', true);
|
||||||
}
|
}
|
||||||
|
@ -930,6 +930,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (req.getResponseHeader('X-Icinga-Reload-Window') === 'yes') {
|
||||||
|
window.location.reload();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (! req.autorefresh && ! req.autosubmit) {
|
if (! req.autorefresh && ! req.autosubmit) {
|
||||||
// TODO: Hook for response/url?
|
// TODO: Hook for response/url?
|
||||||
var url = req.url;
|
var url = req.url;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user