aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/device/DeviceController.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/device/DeviceController.js')
-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);