aboutsummaryrefslogtreecommitdiff
path: root/web/app/controller
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-22 06:28:52 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-22 06:28:52 +1300
commit1ffa5a058a4cf84f23663bef2f14608059789f40 (patch)
tree9b1181eea0b9484a07fa48a8cc1f2c528d1e0629 /web/app/controller
parent6b0e967b5156071c3c0ad777af96a1c7e7ebc2de (diff)
downloadtrackermap-web-1ffa5a058a4cf84f23663bef2f14608059789f40.tar.gz
trackermap-web-1ffa5a058a4cf84f23663bef2f14608059789f40.tar.bz2
trackermap-web-1ffa5a058a4cf84f23663bef2f14608059789f40.zip
Add unknown status notification
Diffstat (limited to 'web/app/controller')
-rw-r--r--web/app/controller/Root.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index e30446c9..5600d4e8 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -119,7 +119,7 @@ Ext.define('Traccar.controller.Root', {
};
socket.onmessage = function (event) {
- var i, j, store, data, array, entity, device, typeKey, alarmKey, text, geofence;
+ var i, j, store, data, array, entity, device, alarmKey, text, geofence;
data = Ext.decode(event.data);
@@ -184,20 +184,16 @@ Ext.define('Traccar.controller.Root', {
}
}
} else {
- typeKey = 'event' + array[i].type.charAt(0).toUpperCase() + array[i].type.slice(1);
- text = Strings[typeKey];
- if (!text) {
- text = typeKey;
- }
+ text = Traccar.app.getEventString(array[i].type);
}
if (array[i].geofenceId !== 0) {
geofence = Ext.getStore('Geofences').getById(array[i].geofenceId);
- if (typeof geofence !== 'undefined') {
+ if (geofence) {
text += ' \"' + geofence.get('name') + '"';
}
}
device = Ext.getStore('Devices').getById(array[i].deviceId);
- if (typeof device !== 'undefined') {
+ if (device) {
if (self.mutePressed()) {
self.beep();
}