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/view/DevicesController.js | |
parent | cc26f01471506935d6f438a102fbf9478dcebb1b (diff) | |
parent | f82970ac21ec2f050a09493fa7bc46c7178b57c3 (diff) | |
download | traccar-server-63aa4472c7d851a0b414dd3c295ccce2bc8c827f.tar.gz traccar-server-63aa4472c7d851a0b414dd3c295ccce2bc8c827f.tar.bz2 traccar-server-63aa4472c7d851a0b414dd3c295ccce2bc8c827f.zip |
Merge pull request #2030 from Abyss777/master
Link and unlink geofences in web client
Diffstat (limited to 'web/app/view/DevicesController.js')
-rw-r--r-- | web/app/view/DevicesController.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js index 6b79a6804..cf31dd7bb 100644 --- a/web/app/view/DevicesController.js +++ b/web/app/view/DevicesController.js @@ -20,7 +20,8 @@ Ext.define('Traccar.view.DevicesController', { requires: [ 'Traccar.view.CommandDialog', - 'Traccar.view.DeviceDialog' + 'Traccar.view.DeviceDialog', + 'Traccar.view.DeviceGeofences' ], config: { @@ -84,6 +85,22 @@ Ext.define('Traccar.view.DevicesController', { }); }, + onGeofencesClick: function () { + var admin = Traccar.app.getUser().get('admin'); + var device = this.getView().getSelectionModel().getSelection()[0]; + Ext.create('Traccar.view.BaseWindow', { + title: Strings.sharedGeofences, + items: { + xtype: 'deviceGeofencesView', + baseObjectName: 'deviceId', + linkObjectName: 'geofenceId', + storeName: (admin) ? 'AllGeofences' : 'Geofences', + urlApi: '/api/devices/geofences', + baseObject: device.getData().id + } + }).show(); + }, + onCommandClick: function () { var device, deviceId, command, dialog, comboStore; device = this.getView().getSelectionModel().getSelection()[0]; @@ -108,6 +125,7 @@ Ext.define('Traccar.view.DevicesController', { var empty = selected.getCount() === 0; this.lookupReference('toolbarEditButton').setDisabled(empty); this.lookupReference('toolbarRemoveButton').setDisabled(empty); + this.lookupReference('toolbarGeofencesButton').setDisabled(empty); this.lookupReference('deviceCommandButton').setDisabled(empty || (selected.getLastSelected().get('status') !== 'online')); if (!empty) { this.fireEvent('selectDevice', selected.getLastSelected(), true); |