aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/device
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-07-25 21:26:07 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-07-25 21:26:07 +1200
commit8063c5e93514475daba2caf6538e261f27681bc3 (patch)
tree6b1e41b87a8285a5bcc8326125033aeeb96ea6b1 /web/app/view/device
parent7cc1910db0f2cf88f75c80d05511e759d7641077 (diff)
downloadtraccar-server-8063c5e93514475daba2caf6538e261f27681bc3.tar.gz
traccar-server-8063c5e93514475daba2caf6538e261f27681bc3.tar.bz2
traccar-server-8063c5e93514475daba2caf6538e261f27681bc3.zip
Add send command dialog
Diffstat (limited to 'web/app/view/device')
-rw-r--r--web/app/view/device/DeviceController.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/web/app/view/device/DeviceController.js b/web/app/view/device/DeviceController.js
index 794e0f03d..f5577f156 100644
--- a/web/app/view/device/DeviceController.js
+++ b/web/app/view/device/DeviceController.js
@@ -20,6 +20,7 @@ Ext.define('Traccar.view.device.DeviceController', {
requires: [
'Traccar.view.device.DeviceDialog',
+ 'Traccar.view.command.CommandDialog',
'Traccar.view.user.UserDialog',
'Traccar.view.admin.ServerDialog',
'Traccar.view.user.User'
@@ -82,9 +83,13 @@ Ext.define('Traccar.view.device.DeviceController', {
onCommandClick: function() {
var device = this.getView().getSelectionModel().getSelection()[0];
- console.log('send command here');
+ var command = Ext.create('Traccar.model.Command');
+ command.set('deviceId', device.get('id'));
+ var dialog = Ext.create('Traccar.view.command.CommandDialog');
+ dialog.down('form').loadRecord(command);
+ dialog.show();
},
-
+
onSelectionChange: function(selected) {
var empty = selected.getCount() === 0;
this.lookupReference('deviceEditButton').setDisabled(empty);