From 92c3085546df5f3160c18c536c6183d15ef4b781 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Tue, 17 May 2016 15:53:04 +0500 Subject: Custom command support for web-interface --- web/app/view/CommandDialogController.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'web/app/view/CommandDialogController.js') diff --git a/web/app/view/CommandDialogController.js b/web/app/view/CommandDialogController.js index 93109a2d6..1b5ca0ce0 100644 --- a/web/app/view/CommandDialogController.js +++ b/web/app/view/CommandDialogController.js @@ -21,6 +21,8 @@ Ext.define('Traccar.view.CommandDialogController', { onSelect: function (selected) { this.lookupReference('paramPositionPeriodic').setHidden( selected.getValue() !== 'positionPeriodic'); + this.lookupReference('paramCustom').setHidden( + selected.getValue() !== 'custom'); }, onSendClick: function (button) { @@ -40,6 +42,13 @@ Ext.define('Traccar.view.CommandDialogController', { }); } + if (record.get('type') === 'custom') { + value = this.lookupReference('paramCustom').getValue(); + record.set('attributes', { + data: value + }); + } + Ext.Ajax.request({ scope: this, url: '/api/commands', -- cgit v1.2.3