aboutsummaryrefslogtreecommitdiff
path: root/web/app/controller
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/controller')
-rw-r--r--web/app/controller/Root.js20
1 files changed, 2 insertions, 18 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index b69fb0f..8d604b6 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -215,32 +215,16 @@ Ext.define('Traccar.controller.Root', {
},
updateEvents: function (array) {
- var i, store, device, alarmKey, text, geofence;
+ var i, store, device;
store = Ext.getStore('Events');
for (i = 0; i < array.length; i++) {
store.add(array[i]);
- if (array[i].type === 'commandResult') {
- text = Strings.eventCommandResult + ': ' + array[i].attributes.result;
- } else if (array[i].type === 'alarm') {
- alarmKey = 'alarm' + array[i].attributes.alarm.charAt(0).toUpperCase() + array[i].attributes.alarm.slice(1);
- text = Strings[alarmKey] || alarmKey;
- } else if (array[i].type === 'textMessage') {
- text = Strings.eventTextMessage + ': ' + array[i].attributes.message;
- } else {
- text = Traccar.app.getEventString(array[i].type);
- }
- if (array[i].geofenceId !== 0) {
- geofence = Ext.getStore('Geofences').getById(array[i].geofenceId);
- if (geofence) {
- text += ' \"' + geofence.get('name') + '"';
- }
- }
device = Ext.getStore('Devices').getById(array[i].deviceId);
if (device) {
if (this.soundPressed()) {
this.beep();
}
- Ext.toast(text, device.get('name'), 'br');
+ Ext.toast(array[i].text, device.get('name'), 'br');
}
}
},