aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-05-17 15:53:04 +0500
committerAbyss777 <abyss@fox5.ru>2016-05-17 15:53:04 +0500
commit92c3085546df5f3160c18c536c6183d15ef4b781 (patch)
tree7c88286874a3459d540096aa3b737ebbdcd8a129 /web/app/view
parent4d8e8208c9fdfcad697df25119645eccc880dfea (diff)
downloadtrackermap-server-92c3085546df5f3160c18c536c6183d15ef4b781.tar.gz
trackermap-server-92c3085546df5f3160c18c536c6183d15ef4b781.tar.bz2
trackermap-server-92c3085546df5f3160c18c536c6183d15ef4b781.zip
Custom command support for web-interface
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/CommandDialog.js7
-rw-r--r--web/app/view/CommandDialogController.js9
2 files changed, 16 insertions, 0 deletions
diff --git a/web/app/view/CommandDialog.js b/web/app/view/CommandDialog.js
index d23b50d4c..031815273 100644
--- a/web/app/view/CommandDialog.js
+++ b/web/app/view/CommandDialog.js
@@ -54,6 +54,13 @@ Ext.define('Traccar.view.CommandDialog', {
displayField: 'name',
valueField: 'factor'
}]
+ }, {
+ xtype: 'textfield',
+ reference: 'paramCustom',
+ fieldLabel: Strings.commandCustom,
+ name: 'customCommand',
+ hidden: true,
+ allowBlank: false
}]
},
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',