aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-05-30 15:04:51 +0500
committerAbyss777 <abyss@fox5.ru>2016-05-31 09:37:04 +0500
commit279948e95f21ffed7f890e5253693a307953d255 (patch)
tree8f2f39a569ddafd55e87fc791c9db47135ac10f5 /web/app
parent80119f59a0d4b89396f5d7d57ba2d80257a8da79 (diff)
downloadtrackermap-server-279948e95f21ffed7f890e5253693a307953d255.tar.gz
trackermap-server-279948e95f21ffed7f890e5253693a307953d255.tar.bz2
trackermap-server-279948e95f21ffed7f890e5253693a307953d255.zip
Disable command button if device is not online.
Diffstat (limited to 'web/app')
-rw-r--r--web/app/store/Devices.js6
-rw-r--r--web/app/view/Devices.js1
-rw-r--r--web/app/view/DevicesController.js2
3 files changed, 8 insertions, 1 deletions
diff --git a/web/app/store/Devices.js b/web/app/store/Devices.js
index 8ba513792..5084ff554 100644
--- a/web/app/store/Devices.js
+++ b/web/app/store/Devices.js
@@ -24,5 +24,11 @@ Ext.define('Traccar.store.Devices', {
writer: {
writeAllFields: true
}
+ },
+ listeners : {
+ update: function () {
+ devicesPanel = Ext.getCmp('devicesPanel');
+ devicesPanel.fireEvent('selectionchange',devicesPanel.getSelectionModel());
+ }
}
});
diff --git a/web/app/view/Devices.js b/web/app/view/Devices.js
index f06c2658b..31eead2f7 100644
--- a/web/app/view/Devices.js
+++ b/web/app/view/Devices.js
@@ -17,6 +17,7 @@
Ext.define('Traccar.view.Devices', {
extend: 'Ext.grid.Panel',
xtype: 'devicesView',
+ id: 'devicesPanel',
requires: [
'Traccar.view.DevicesController',
diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js
index 9dee0ff7c..8c1bba00f 100644
--- a/web/app/view/DevicesController.js
+++ b/web/app/view/DevicesController.js
@@ -103,7 +103,7 @@ Ext.define('Traccar.view.DevicesController', {
var empty = selected.getCount() === 0;
this.lookupReference('toolbarEditButton').setDisabled(empty);
this.lookupReference('toolbarRemoveButton').setDisabled(empty);
- this.lookupReference('deviceCommandButton').setDisabled(empty);
+ this.lookupReference('deviceCommandButton').setDisabled(empty || (selected.getLastSelected().get('status') !== 'online'));
if (!empty) {
this.fireEvent('selectDevice', selected.getLastSelected(), true);
}