diff options
author | Abyss777 <abyss@fox5.ru> | 2017-05-18 10:01:49 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-05-18 16:18:26 +0500 |
commit | 788a499b346724d753798597fb18f8aef17e1588 (patch) | |
tree | 07a29a92434aba956697360d6ef867ca1a328060 /web/app/view/edit | |
parent | 31187bc2a3ae41ab553a6472b7592895e3641fe8 (diff) | |
download | trackermap-web-788a499b346724d753798597fb18f8aef17e1588.tar.gz trackermap-web-788a499b346724d753798597fb18f8aef17e1588.tar.bz2 trackermap-web-788a499b346724d753798597fb18f8aef17e1588.zip |
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 | 20 |
2 files changed, 20 insertions, 4 deletions
diff --git a/web/app/view/edit/Attributes.js b/web/app/view/edit/Attributes.js index 7788d8c8..b080e569 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 87d3b8da..741a1048 100644 --- a/web/app/view/edit/ComputedAttributes.js +++ b/web/app/view/edit/ComputedAttributes.js @@ -46,13 +46,29 @@ Ext.define('Traccar.view.edit.ComputedAttributes', { dataIndex: 'description' }, { text: Strings.sharedAttribute, - dataIndex: 'attribute' + dataIndex: 'attribute', + renderer: function (value) { + var attribute = Ext.getStore('PositionAttributes').getById(value); + if (attribute) { + return attribute.get('name'); + } else { + return 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; + } + } }] } }); |