diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-12-21 22:42:32 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-21 22:42:32 +1300 |
commit | 77e45e57c92cb03688a2494b81dfe66969c6edbd (patch) | |
tree | 23e06bc7733ddddef65949efe553d38104322dce /web | |
parent | 0a465cee9200e0ae297aa9fe7eb9ac78be4636ad (diff) | |
parent | c7d69869cd13f9d0434703e5eef60a29aba8de90 (diff) | |
download | trackermap-web-77e45e57c92cb03688a2494b81dfe66969c6edbd.tar.gz trackermap-web-77e45e57c92cb03688a2494b81dfe66969c6edbd.tar.bz2 trackermap-web-77e45e57c92cb03688a2494b81dfe66969c6edbd.zip |
Merge pull request #362 from AddisMap/feature/traccar-2702-watch-ext
UI for Feature traccar 2702 watch ext
Diffstat (limited to 'web')
-rw-r--r-- | web/app/view/CommandDialog.js | 27 | ||||
-rw-r--r-- | web/app/view/CommandDialogController.js | 20 | ||||
-rw-r--r-- | web/l10n/en.json | 2 |
3 files changed, 49 insertions, 0 deletions
diff --git a/web/app/view/CommandDialog.js b/web/app/view/CommandDialog.js index af36f558..24e0e191 100644 --- a/web/app/view/CommandDialog.js +++ b/web/app/view/CommandDialog.js @@ -90,6 +90,33 @@ Ext.define('Traccar.view.CommandDialog', { hidden: true }] }, { + xtype: 'fieldcontainer', + reference: 'paramSetTimezone', + name: 'attributes', + hidden: true, + + items: [{ + xtype: 'numberfield', + fieldLabel: Strings.commandTimezone, + name: 'timezone', + minValue: -12, + step: 0.5, + maxValue: +14 + }] + }, { + xtype: 'fieldcontainer', + reference: 'paramSetIndicator', + name: 'attributes', + hidden: true, + + items: [{ + xtype: 'numberfield', + fieldLabel: Strings.commandData, + name: 'data', + minValue: 0, + maxValue: 99 + }] + }, { xtype: 'textfield', reference: 'paramCustom', fieldLabel: Strings.commandCustom, diff --git a/web/app/view/CommandDialogController.js b/web/app/view/CommandDialogController.js index 9442e4f4..6e809fa1 100644 --- a/web/app/view/CommandDialogController.js +++ b/web/app/view/CommandDialogController.js @@ -28,6 +28,10 @@ Ext.define('Traccar.view.CommandDialogController', { selected.getValue() !== 'sendSms' && selected.getValue() !== 'sendUssd'); this.lookupReference('paramSmsMessage').setHidden( selected.getValue() !== 'sendSms'); + this.lookupReference('paramSetTimezone').setHidden( + selected.getValue() !== 'setTimezone'); + this.lookupReference('paramSetIndicator').setHidden( + selected.getValue() !== 'setIndicator'); this.lookupReference('paramCustom').setHidden( selected.getValue() !== 'custom'); }, @@ -78,6 +82,22 @@ Ext.define('Traccar.view.CommandDialogController', { }); } + if (record.get('type') === 'setTimezone') { + attributes = this.lookupReference('paramSetTimezone'); + value = attributes.down('numberfield[name="timezone"]').getValue(); + record.set('attributes', { + timezone: value * 3600 + }); + } + + if (record.get('type') === 'setIndicator') { + attributes = this.lookupReference('paramSetIndicator'); + value = attributes.down('numberfield[name="data"]').getValue(); + record.set('attributes', { + data: 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 4b883c7a..39376bea 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -144,6 +144,7 @@ "commandSosNumber": "Set SOS Number", "commandSilenceTime": "Set Silence Time", "commandSetPhonebook": "Set Phonebook", + "commandSetIndicator": "Set Indicator", "commandVoiceMessage": "Voice Message", "commandOutputControl": "Output Control", "commandAlarmSpeed": "Overspeed Alarm", @@ -152,6 +153,7 @@ "commandData": "Data", "commandPhone": "Phone Number", "commandMessage": "Message", + "commandTimezone": "Timezone Offset", "eventAll": "All Events", "eventDeviceOnline": "Device is online", "eventDeviceUnknown": "Device status is unknown", |