diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-19 16:56:08 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-19 16:56:08 +1200 |
commit | f5d4d3bf8a4d12f4739407f8f25bba3c572df649 (patch) | |
tree | 71c3807a69c69b9e8659d873ee4400cd835b699c /web/app/view/edit | |
parent | 31187bc2a3ae41ab553a6472b7592895e3641fe8 (diff) | |
parent | 8caf621e9adbeb99093076335679813a8a6e8ffe (diff) | |
download | etbsa-traccar-web-f5d4d3bf8a4d12f4739407f8f25bba3c572df649.tar.gz etbsa-traccar-web-f5d4d3bf8a4d12f4739407f8f25bba3c572df649.tar.bz2 etbsa-traccar-web-f5d4d3bf8a4d12f4739407f8f25bba3c572df649.zip |
Merge pull request #490 from Abyss777/position_attributes
Implement known position attributes
Diffstat (limited to 'web/app/view/edit')
-rw-r--r-- | web/app/view/edit/Attributes.js | 4 | ||||
-rw-r--r-- | web/app/view/edit/ComputedAttributes.js | 15 |
2 files changed, 15 insertions, 4 deletions
diff --git a/web/app/view/edit/Attributes.js b/web/app/view/edit/Attributes.js index 7788d8c..b080e56 100644 --- a/web/app/view/edit/Attributes.js +++ b/web/app/view/edit/Attributes.js @@ -57,9 +57,9 @@ Ext.define('Traccar.view.edit.Attributes', { if (this.attributesStore) { attribute = Ext.getStore(this.attributesStore).getById(record.get('name')); } - if (attribute && attribute.get('convert') === 'speed') { + if (attribute && attribute.get('dataType') === 'speed') { return Ext.getStore('SpeedUnits').formatValue(value, Traccar.app.getPreference('speedUnit', 'kn')); - } else if (attribute && attribute.get('convert') === 'distance') { + } else if (attribute && attribute.get('dataType') === 'distance') { return Ext.getStore('DistanceUnits').formatValue(value, Traccar.app.getPreference('distanceUnit', 'km')); } else { return value; diff --git a/web/app/view/edit/ComputedAttributes.js b/web/app/view/edit/ComputedAttributes.js index 87d3b8d..b4699e8 100644 --- a/web/app/view/edit/ComputedAttributes.js +++ b/web/app/view/edit/ComputedAttributes.js @@ -46,13 +46,24 @@ Ext.define('Traccar.view.edit.ComputedAttributes', { dataIndex: 'description' }, { text: Strings.sharedAttribute, - dataIndex: 'attribute' + dataIndex: 'attribute', + renderer: function (value) { + return Ext.getStore('PositionAttributes').getAttributeName(value); + } }, { text: Strings.sharedExpression, dataIndex: 'expression' }, { text: Strings.sharedType, - dataIndex: 'type' + dataIndex: 'type', + renderer: function (value) { + var type = Ext.getStore('AttributeValueTypes').getById(value); + if (type) { + return type.get('name'); + } else { + return value; + } + } }] } }); |