diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-06-20 22:56:18 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-06-20 22:56:18 +1200 |
commit | 63aa4472c7d851a0b414dd3c295ccce2bc8c827f (patch) | |
tree | fca526a145f48ba07128649dd77348dbab257721 /web/app/controller/Root.js | |
parent | cc26f01471506935d6f438a102fbf9478dcebb1b (diff) | |
parent | f82970ac21ec2f050a09493fa7bc46c7178b57c3 (diff) | |
download | trackermap-server-63aa4472c7d851a0b414dd3c295ccce2bc8c827f.tar.gz trackermap-server-63aa4472c7d851a0b414dd3c295ccce2bc8c827f.tar.bz2 trackermap-server-63aa4472c7d851a0b414dd3c295ccce2bc8c827f.zip |
Merge pull request #2030 from Abyss777/master
Link and unlink geofences in web client
Diffstat (limited to 'web/app/controller/Root.js')
-rw-r--r-- | web/app/controller/Root.js | 9 |
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); |