aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-08-19 23:34:24 +0300
committerGitHub <noreply@github.com>2016-08-19 23:34:24 +0300
commit6b6d28695600fee509ee37a7225dd6518879ac9c (patch)
tree0b40718962f549b6ab963cf93e9de7cf3c105b13 /web
parent3826a93f1009942e22ec80c1e13be71e8e917b01 (diff)
parentaaa16c01263847221c7cfec95d722b283dcfd35e (diff)
downloadtrackermap-server-6b6d28695600fee509ee37a7225dd6518879ac9c.tar.gz
trackermap-server-6b6d28695600fee509ee37a7225dd6518879ac9c.tar.bz2
trackermap-server-6b6d28695600fee509ee37a7225dd6518879ac9c.zip
Merge pull request #2231 from Abyss777/wialon_commands
Commands to Wialon protocol
Diffstat (limited to 'web')
-rw-r--r--web/app/view/CommandDialog.js33
-rw-r--r--web/app/view/CommandDialogController.js37
-rw-r--r--web/l10n/en.json5
3 files changed, 74 insertions, 1 deletions
diff --git a/web/app/view/CommandDialog.js b/web/app/view/CommandDialog.js
index 8e9a80dbf..d9c3beeb3 100644
--- a/web/app/view/CommandDialog.js
+++ b/web/app/view/CommandDialog.js
@@ -55,6 +55,39 @@ Ext.define('Traccar.view.CommandDialog', {
valueField: 'factor'
}]
}, {
+ xtype: 'fieldcontainer',
+ reference: 'paramOutputControl',
+ name: 'attributes',
+ hidden: true,
+
+ items: [{
+ xtype: 'numberfield',
+ fieldLabel: Strings.commandIndex,
+ name: 'index',
+ allowBlank: false
+ }, {
+ xtype: 'textfield',
+ fieldLabel: Strings.commandData,
+ name: 'data'
+ }]
+ }, {
+ xtype: 'fieldcontainer',
+ reference: 'paramSendSmsUssd',
+ name: 'attributes',
+ hidden: true,
+
+ items: [{
+ xtype: 'textfield',
+ fieldLabel: Strings.commandPhoneNumber,
+ name: 'phoneNumber'
+ }, {
+ xtype: 'textfield',
+ reference: 'paramSmsMessage',
+ fieldLabel: Strings.commandMessage,
+ name: 'message',
+ hidden: true
+ }]
+ }, {
xtype: 'textfield',
reference: 'paramCustom',
fieldLabel: Strings.commandCustom,
diff --git a/web/app/view/CommandDialogController.js b/web/app/view/CommandDialogController.js
index 9da5bd42e..120854df1 100644
--- a/web/app/view/CommandDialogController.js
+++ b/web/app/view/CommandDialogController.js
@@ -21,12 +21,18 @@ Ext.define('Traccar.view.CommandDialogController', {
onSelect: function (selected) {
this.lookupReference('paramPositionPeriodic').setHidden(
selected.getValue() !== 'positionPeriodic');
+ this.lookupReference('paramOutputControl').setHidden(
+ selected.getValue() !== 'outputControl');
+ this.lookupReference('paramSendSmsUssd').setHidden(
+ selected.getValue() !== 'sendSms' && selected.getValue() !== 'sendUssd');
+ this.lookupReference('paramSmsMessage').setHidden(
+ selected.getValue() !== 'sendSms');
this.lookupReference('paramCustom').setHidden(
selected.getValue() !== 'custom');
},
onSendClick: function (button) {
- var attributes, value, record, form;
+ var attributes, value, record, form, index, phoneNumber;
form = button.up('window').down('form');
form.updateRecord();
@@ -42,6 +48,35 @@ Ext.define('Traccar.view.CommandDialogController', {
});
}
+ if (record.get('type') === 'outputControl') {
+ attributes = this.lookupReference('paramOutputControl');
+ index = attributes.down('numberfield[name="index"]').getValue();
+ value = attributes.down('textfield[name="data"]').getValue();
+
+ record.set('attributes', {
+ index: index,
+ data: value
+ });
+ }
+
+ if (record.get('type') === 'sendUssd') {
+ attributes = this.lookupReference('paramSendSmsUssd');
+ phoneNumber = attributes.down('textfield[name="phoneNumber"]').getValue();
+ record.set('attributes', {
+ phoneNumber: phoneNumber
+ });
+ }
+
+ if (record.get('type') === 'sendSms') {
+ attributes = this.lookupReference('paramSendSmsUssd');
+ phoneNumber = attributes.down('textfield[name="phoneNumber"]').getValue();
+ value = attributes.down('textfield[name="message"]').getValue();
+ record.set('attributes', {
+ phoneNumber: phoneNumber,
+ message: value
+ });
+ }
+
if (record.get('type') === 'custom') {
value = this.lookupReference('paramCustom').getValue();
record.set('attributes', {
diff --git a/web/l10n/en.json b/web/l10n/en.json
index af4f2363e..5daa7e2ab 100644
--- a/web/l10n/en.json
+++ b/web/l10n/en.json
@@ -106,6 +106,7 @@
"commandRequestPhoto": "Request Photo",
"commandRebootDevice": "Reboot Device",
"commandSendSms": "Send SMS",
+ "commandSendUssd": "Send USSD",
"commandSosNumber": "Set SOS Number",
"commandSilenceTime": "Set Silence Time",
"commandSetPhonebook": "Set Phonebook",
@@ -113,6 +114,10 @@
"commandOutputControl": "Output Control",
"commandAlarmSpeed": "Overspeed Alarm",
"commandDeviceIdentification": "Device Identification",
+ "commandIndex": "Index",
+ "commandData": "Data",
+ "commandPhoneNumber": "Phone Number",
+ "commandMessage": "Message",
"eventDeviceOnline": "Device is online",
"eventDeviceOffline": "Device is offline",
"eventDeviceMoving": "Device is moving",