From 35e8f4b4974515733737c5cc1dd439ca47860007 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 31 May 2017 16:55:00 +0500 Subject: Implement Events panel --- web/app/controller/Root.js | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'web/app/controller/Root.js') 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'); } } }, -- cgit v1.2.3