From 23b05e3ba46a01b0aef63774004d0f1dd4359c03 Mon Sep 17 00:00:00 2001 From: Arjun Roychowdhury Date: Fri, 13 Nov 2015 13:53:36 -0500 Subject: #82 - alarm indication Former-commit-id: 8ff19d73113773b4969e89e529ed3829766cde6b --- www/js/MontageCtrl.js | 17 ++++++++++++----- www/js/app.js | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'www/js') diff --git a/www/js/MontageCtrl.js b/www/js/MontageCtrl.js index 40b3a69c..7ff9cbd7 100644 --- a/www/js/MontageCtrl.js +++ b/www/js/MontageCtrl.js @@ -211,21 +211,28 @@ angular.module('zmApp.controllers').controller('zmApp.MontageCtrl', ['$scope', ' { console.log ("**** TRAPPED EVENT: "+alarmMonitors[i]); - for (var j=0; i<$scope.monitors.length; i++) + for (var j=0; i<$scope.monitors.length; j++) { if ($scope.monitors[j].Monitor.Id == alarmMonitors[i]) { $scope.monitors[j].Monitor.isAlarmed="true"; + scheduleRemoveFlash(j); } } } - - - - + }); + + function scheduleRemoveFlash(id) + { + ZMDataModel.zmDebug ("Scheduled a 10 sec timer for dis-alarming monitor ID="+id); + $timeout( function() { + $scope.monitors[id].Monitor.isAlarmed = 'false'; + ZMDataModel.zmDebug ("dis-alarming monitor ID="+id); + },zm.alarmFlashTimer); + } //---------------------------------------------------------------- // Alarm notification handling diff --git a/www/js/app.js b/www/js/app.js index 94551555..8cb5e869 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -34,6 +34,7 @@ angular.module('zmApp', [ .constant('zm', { minAppVersion: '1.28.107', // if ZM is less than this, the app won't work minEventServerVersion: '0.4', + alarmFlashTimer:20000, // time to flash alarm gcmSenderId:'710936220256', httpTimeout: 15000, largeHttpTimeout: 60000, -- cgit v1.2.3