aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/DevicesController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-03-07 15:32:22 +0500
committerAbyss777 <abyss@fox5.ru>2017-03-07 15:39:21 +0500
commit7db1c1cdcf617e146e927c4aadde239959a9d3de (patch)
tree6caf2497b4d217557e8f00887ec6442e2bfd0c73 /web/app/view/DevicesController.js
parent50a2616002602c379f408d5ecc404a59d317b0ca (diff)
downloadtrackermap-web-7db1c1cdcf617e146e927c4aadde239959a9d3de.tar.gz
trackermap-web-7db1c1cdcf617e146e927c4aadde239959a9d3de.tar.bz2
trackermap-web-7db1c1cdcf617e146e927c4aadde239959a9d3de.zip
Implement SMS commands
Diffstat (limited to 'web/app/view/DevicesController.js')
-rw-r--r--web/app/view/DevicesController.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js
index ad0dd363..d65055e7 100644
--- a/web/app/view/DevicesController.js
+++ b/web/app/view/DevicesController.js
@@ -74,28 +74,30 @@ Ext.define('Traccar.view.DevicesController', {
},
onCommandClick: function () {
- var device, deviceId, command, dialog, comboStore;
+ var device, deviceId, command, dialog, comboStore, online;
device = this.getView().getSelectionModel().getSelection()[0];
+ online = device.get('status') === 'online';
deviceId = device.get('id');
command = Ext.create('Traccar.model.Command');
command.set('deviceId', deviceId);
+ command.set('textChannel', !online);
dialog = Ext.create('Traccar.view.CommandDialog');
comboStore = dialog.down('form').down('combobox').getStore();
comboStore.getProxy().setExtraParam('deviceId', deviceId);
dialog.down('form').loadRecord(command);
+ dialog.lookupReference('textChannelCheckBox').setDisabled(!online);
dialog.show();
},
updateButtons: function (selected) {
- var readonly, deviceReadonly, empty, online;
+ var readonly, deviceReadonly, empty;
deviceReadonly = Traccar.app.getPreference('deviceReadonly', false) && !Traccar.app.getUser().get('admin');
readonly = Traccar.app.getPreference('readonly', false) && !Traccar.app.getUser().get('admin');
empty = selected.getCount() === 0;
- online = selected.getLastSelected().get('status') === 'online';
this.lookupReference('toolbarEditButton').setDisabled(empty || readonly || deviceReadonly);
this.lookupReference('toolbarRemoveButton').setDisabled(empty || readonly || deviceReadonly);
this.lookupReference('toolbarGeofencesButton').setDisabled(empty || readonly);
- this.lookupReference('deviceCommandButton').setDisabled(empty || readonly || !online);
+ this.lookupReference('deviceCommandButton').setDisabled(empty || readonly);
},
onSelectionChange: function (selected) {