mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 08:44:10 +02:00
Do not use logarithm base from session if the timeline is not being extended
refs #4190
This commit is contained in:
parent
f7c6cd3c2a
commit
3d658a664c
@ -160,16 +160,22 @@ class ActionController extends Zend_Controller_Action
|
|||||||
* Return a window-aware session by using the given prefix
|
* Return a window-aware session by using the given prefix
|
||||||
*
|
*
|
||||||
* @param string $prefix The prefix to use
|
* @param string $prefix The prefix to use
|
||||||
|
* @param bool $reset Whether to reset any existing session-data
|
||||||
*
|
*
|
||||||
* @return SessionNamespace
|
* @return SessionNamespace
|
||||||
*/
|
*/
|
||||||
public function getWindowSession($prefix)
|
public function getWindowSession($prefix, $reset = false)
|
||||||
{
|
{
|
||||||
$session = Session::getSession();
|
$session = Session::getSession();
|
||||||
$windowId = $this->getWindowId();
|
$windowId = $this->getWindowId();
|
||||||
$namespace = $session->getNamespace($prefix . '_' . $windowId);
|
|
||||||
|
|
||||||
if ($windowId !== 'undefined' && $session->hasNamespace($prefix . '_undefined')) {
|
$identifier = $prefix . '_' . $windowId;
|
||||||
|
if ($reset && $session->hasNamespace($identifier)) {
|
||||||
|
$session->removeNamespace($identifier);
|
||||||
|
}
|
||||||
|
$namespace = $session->getNamespace($identifier);
|
||||||
|
|
||||||
|
if (!$reset && $windowId !== 'undefined' && $session->hasNamespace($prefix . '_undefined')) {
|
||||||
// We do not have any window-id on the very first request. Now we add all values from the
|
// We do not have any window-id on the very first request. Now we add all values from the
|
||||||
// namespace, that has been created in this case, to the new one and remove it afterwards.
|
// namespace, that has been created in this case, to the new one and remove it afterwards.
|
||||||
foreach ($session->getNamespace($prefix . '_undefined') as $name => $value) {
|
foreach ($session->getNamespace($prefix . '_undefined') as $name => $value) {
|
||||||
|
@ -66,7 +66,7 @@ class Monitoring_TimelineController extends ActionController
|
|||||||
$timeline->setMinimumCircleWidth('0.15em');
|
$timeline->setMinimumCircleWidth('0.15em');
|
||||||
$timeline->setDisplayRange($displayRange);
|
$timeline->setDisplayRange($displayRange);
|
||||||
$timeline->setForecastRange($forecastRange);
|
$timeline->setForecastRange($forecastRange);
|
||||||
$timeline->setSession($this->getWindowSession('timeline'));
|
$timeline->setSession($this->getWindowSession('timeline', $this->getRequest()->getParam('extend') != 1));
|
||||||
|
|
||||||
$this->view->timeline = $timeline;
|
$this->view->timeline = $timeline;
|
||||||
$this->view->intervalFormat = $this->getIntervalFormat();
|
$this->view->intervalFormat = $this->getIntervalFormat();
|
||||||
|
@ -270,7 +270,6 @@ class TimeLine implements IteratorAggregate
|
|||||||
{
|
{
|
||||||
if ($this->calculationBase === null) {
|
if ($this->calculationBase === null) {
|
||||||
if ($this->session !== null) {
|
if ($this->session !== null) {
|
||||||
// TODO: Do not use this if the interval has changed or the user did a reload
|
|
||||||
$this->calculationBase = $this->session->get('calculationBase');
|
$this->calculationBase = $this->session->get('calculationBase');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user