aboutsummaryrefslogtreecommitdiff
path: root/web/app/controller/Root.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/controller/Root.js')
-rw-r--r--web/app/controller/Root.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js
index 991a2572c..56a076edd 100644
--- a/web/app/controller/Root.js
+++ b/web/app/controller/Root.js
@@ -75,6 +75,7 @@ Ext.define('Traccar.controller.Root', {
loadApp: function () {
Ext.getStore('Groups').load();
Ext.getStore('Devices').load();
+ Ext.getStore('Geofences').load();
Ext.get('attribution').remove();
if (this.isPhone) {
Ext.create('widget.mainMobile');
@@ -94,7 +95,7 @@ Ext.define('Traccar.controller.Root', {
};
socket.onmessage = function (event) {
- var i, j, store, data, array, entity, device, typeKey, text;
+ var i, j, store, data, array, entity, device, typeKey, text, geofence;
data = Ext.decode(event.data);
@@ -147,6 +148,12 @@ Ext.define('Traccar.controller.Root', {
text = typeKey;
}
}
+ if (array[i].geofenceId !== 0) {
+ geofence = Ext.getStore('Geofences').getById(array[i].geofenceId);
+ if (typeof geofence != "undefined") {
+ text += ' \"' + geofence.getData().name + '"';
+ }
+ }
device = Ext.getStore('Devices').getById(array[i].deviceId);
if (typeof device != "undefined") {
Ext.toast(text, device.getData().name);