From 8812d6fd22b1710e019ba53e94723c76b97af6b7 Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Mon, 30 Nov 2015 03:30:57 +0100 Subject: #108 - minAlarmCount is now part of each serverProfile and will persist Former-commit-id: 89ecf51624e78a95474630b48c05d9fa921164c0 --- www/js/DataModel.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 56204c98..0a529365 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -58,6 +58,7 @@ angular.module('zmApp.controllers') 'montageHiddenOrder':'', 'montageArraySize':'0', 'graphSize':200, + 'minAlarmCount':'1', }; @@ -201,6 +202,15 @@ angular.module('zmApp.controllers') if (!isEmpty(loadedData)) { loginData = loadedData; + + // old version hacks for new variables + + if (typeof loginData.minAlarmCount === 'undefined') + { + console.log ("MIN ALARM"); + loginData.minAlarmCount = '1'; + } + zmLog ("DataModel init recovered this loginData as " + JSON.stringify(loginData)); } else @@ -783,7 +793,7 @@ angular.module('zmApp.controllers') if (endTime) myurl = myurl + "/EndTime <=:"+endTime; - myurl = myurl + "/AlarmFrames >=:" + $rootScope.minAlarmCount; + myurl = myurl + "/AlarmFrames >=:" + loginData.minAlarmCount; myurl = myurl + ".json"; @@ -861,7 +871,7 @@ angular.module('zmApp.controllers') if (endTime) myurl = myurl + "/EndTime <=:"+endTime; - myurl = myurl + "/AlarmFrames >=:" + $rootScope.minAlarmCount; + myurl = myurl + "/AlarmFrames >=:" + loginData.minAlarmCount; myurl = myurl + ".json"; -- cgit v1.2.3