aboutsummaryrefslogtreecommitdiff
path: root/web/app/controller
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-06-01 16:50:47 +1200
committerGitHub <noreply@github.com>2017-06-01 16:50:47 +1200
commitfe99c894c581722ab6aa2b422ed768eb9da19cfb (patch)
tree21f5e7cc17e982e2c5b52682dfac29943e39199d /web/app/controller
parent0e598a6232e9cd7188916e06077862d6630a255b (diff)
parent35e8f4b4974515733737c5cc1dd439ca47860007 (diff)
downloadtrackermap-web-fe99c894c581722ab6aa2b422ed768eb9da19cfb.tar.gz
trackermap-web-fe99c894c581722ab6aa2b422ed768eb9da19cfb.tar.bz2
trackermap-web-fe99c894c581722ab6aa2b422ed768eb9da19cfb.zip
Merge pull request #498 from Abyss777/events_panel
Implement Events panel
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 b69fb0fa..8d604b62 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');
}
}
},