diff --git a/pandora_console/include/class/Map.class.php b/pandora_console/include/class/Map.class.php index 31ae86bb87..cf10366b1c 100644 --- a/pandora_console/include/class/Map.class.php +++ b/pandora_console/include/class/Map.class.php @@ -30,6 +30,7 @@ abstract class Map { protected $subtype = null; protected $id_group = null; protected $generation_method = null; + protected $source_period = MAP_REFRESH_TIME; protected $width = null; protected $height = null; @@ -82,6 +83,8 @@ abstract class Map { $this->width = (int)$dbValues['width']; $this->height = (int)$dbValues['height']; + + $this->source_period = (int)$dbValues['source_period']; } private function loadDB() { diff --git a/pandora_console/include/javascript/map/MapController.js b/pandora_console/include/javascript/map/MapController.js index ee46c6a23b..82a15b6cfd 100644 --- a/pandora_console/include/javascript/map/MapController.js +++ b/pandora_console/include/javascript/map/MapController.js @@ -22,8 +22,9 @@ var CONTROL_KEY = 17; /*-----------------------------------------------*/ /*------------------Constructor------------------*/ /*-----------------------------------------------*/ -var MapController = function(target) { +var MapController = function(target, refresh_time) { this._target = target; + this._refresh_time = refresh_time * 1000; // 1000 for the javascript this._id = $(target).data('id'); } @@ -2012,7 +2013,7 @@ MapController.prototype.events = function() { } }); - setTimeout(function() { self.refresh_map();}, MAP_REFRESH_TIME); + setTimeout(function() { self.refresh_map();}, self._refresh_time); } /** @@ -2026,7 +2027,7 @@ MapController.prototype.refresh_map = function() { self.refresh_nodes(); self.refresh_arrows(); - setTimeout(function() { self.refresh_map();}, MAP_REFRESH_TIME); + setTimeout(function() { self.refresh_map();}, self._refresh_time); } /** diff --git a/pandora_console/include/javascript/map/NetworkmapController.js b/pandora_console/include/javascript/map/NetworkmapController.js index 832f3f0772..827fdb50c9 100644 --- a/pandora_console/include/javascript/map/NetworkmapController.js +++ b/pandora_console/include/javascript/map/NetworkmapController.js @@ -15,8 +15,8 @@ /*-----------------------------------------------*/ /*------------------Constructor------------------*/ /*-----------------------------------------------*/ -var NetworkmapController = function(target) { - MapController.call(this, target); +var NetworkmapController = function(target, refresh_time) { + MapController.call(this, target, refresh_time); } /*-----------------------------------------------*/