diff options
| author | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-11-12 17:02:18 -0500 |
|---|---|---|
| committer | Arjun Roychowdhury <pliablepixels@gmail.com> | 2015-11-12 17:02:18 -0500 |
| commit | 4e5e7d28a94106dab8ecf8ff08acfdf5589fe4c6 (patch) | |
| tree | f84ddadb7267f430dd918f17e0dbb3b5d1b0f6a1 /www/js/EventServer.js | |
| parent | 63f4c7e94db1243084f3d7cef023c7a1124f03b5 (diff) | |
#82 - initial commits towards showing monitor specific alarm notitications in montage
Former-commit-id: 278d0c8fb24ef38e607caf66f1f6279b2e36f70b
Diffstat (limited to 'www/js/EventServer.js')
| -rw-r--r-- | www/js/EventServer.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/www/js/EventServer.js b/www/js/EventServer.js index 8b43fa1d..a9b44a8f 100644 --- a/www/js/EventServer.js +++ b/www/js/EventServer.js @@ -83,10 +83,6 @@ angular.module('zmApp.controllers') - - - - //-------------------------------------------------------------------------- // Called once at app start. Does a lazy definition of websockets open //-------------------------------------------------------------------------- @@ -171,6 +167,8 @@ angular.module('zmApp.controllers') if (str.status == 'Success' && str.event == 'alarm') // new events { + + new Audio('sounds/blop.mp3').play(); var localNotText = "Latest Alarms: "; $rootScope.isAlarm = 1; @@ -186,10 +184,12 @@ angular.module('zmApp.controllers') var eventsToDisplay = []; + var listOfMonitors=[]; for (var iter = 0; iter < str.events.length; iter++) { // lets stack the display so they don't overwrite eventsToDisplay.push(str.events[iter].Name + ": latest new alarm (" + str.events[iter].EventId + ")"); localNotText = localNotText + str.events[iter].Name + ","; + listOfMonitors.push(str.events[iter].MonitorId); } @@ -197,6 +197,9 @@ angular.module('zmApp.controllers') // if we are in background, do a local notification, else do an in app display if (!ZMDataModel.isBackground()) { + + //emit alarm details - this is when received over websockets + $rootScope.$emit('alarm',{message:listOfMonitors}); ZMDataModel.zmDebug("App is in foreground, displaying banner"); if (eventsToDisplay.length > 0) { |
