aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/DevicesController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-06-18 07:59:43 +0500
committerAbyss777 <abyss@fox5.ru>2016-06-18 07:59:43 +0500
commit4109447d0adc778b246543b77672c280d58da8bf (patch)
tree08ee98636cec128587bbf5f25654c5e3534dfcd9 /web/app/view/DevicesController.js
parentb3b0cd9d6f2d26cef2e64ef38e23203f1f3fa51a (diff)
downloadtrackermap-server-4109447d0adc778b246543b77672c280d58da8bf.tar.gz
trackermap-server-4109447d0adc778b246543b77672c280d58da8bf.tar.bz2
trackermap-server-4109447d0adc778b246543b77672c280d58da8bf.zip
- Update Geofences API and Manager a bit
- Show geofence name in event toasts - Link/Unlink geofences to users, devices and groups
Diffstat (limited to 'web/app/view/DevicesController.js')
-rw-r--r--web/app/view/DevicesController.js16
1 files changed, 15 insertions, 1 deletions
diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js
index 6b79a6804..d33368181 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,18 @@ Ext.define('Traccar.view.DevicesController', {
});
},
+ onGeofencesClick: function () {
+ device = this.getView().getSelectionModel().getSelection()[0];
+ var admin = Traccar.app.getUser().get('admin');
+ Ext.create('Traccar.view.BaseWindow', {
+ title: Strings.settingsGeofences,
+ items: {
+ xtype: 'deviceGeofencesView',
+ device: device
+ }
+ }).show();
+ },
+
onCommandClick: function () {
var device, deviceId, command, dialog, comboStore;
device = this.getView().getSelectionModel().getSelection()[0];
@@ -108,6 +121,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);