diff options
author | Abyss777 <abyss@fox5.ru> | 2017-05-31 16:55:00 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-05-31 16:55:08 +0500 |
commit | 35e8f4b4974515733737c5cc1dd439ca47860007 (patch) | |
tree | 21f5e7cc17e982e2c5b52682dfac29943e39199d /web/app/controller | |
parent | 0e598a6232e9cd7188916e06077862d6630a255b (diff) | |
download | etbsa-traccar-web-35e8f4b4974515733737c5cc1dd439ca47860007.tar.gz etbsa-traccar-web-35e8f4b4974515733737c5cc1dd439ca47860007.tar.bz2 etbsa-traccar-web-35e8f4b4974515733737c5cc1dd439ca47860007.zip |
Implement Events panel
Diffstat (limited to 'web/app/controller')
-rw-r--r-- | web/app/controller/Root.js | 20 |
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'); } } }, |