aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/State.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2018-02-05 11:15:31 +0500
committerAbyss777 <abyss@fox5.ru>2018-02-05 11:15:31 +0500
commit463c548c865ed1c565718c680acba8cc74067ca4 (patch)
tree51aad16b87ee9f4b5176f1f0d533981ce3263572 /web/app/view/State.js
parent8aed98ce2ae65b19da627e418e02f3627c70bd9d (diff)
downloadetbsa-traccar-web-463c548c865ed1c565718c680acba8cc74067ca4.tar.gz
etbsa-traccar-web-463c548c865ed1c565718c680acba8cc74067ca4.tar.bz2
etbsa-traccar-web-463c548c865ed1c565718c680acba8cc74067ca4.zip
Format image and audio attributes as link
Diffstat (limited to 'web/app/view/State.js')
-rw-r--r--web/app/view/State.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/web/app/view/State.js b/web/app/view/State.js
index 95529a4..ed9951b 100644
--- a/web/app/view/State.js
+++ b/web/app/view/State.js
@@ -61,11 +61,21 @@ Ext.define('Traccar.view.State', {
dataIndex: 'value',
cellWrap: true,
renderer: function (value, metaData, record) {
+ var position, device;
if (record.get('attribute') === 'alarm') {
metaData.tdCls = 'view-color-red';
} else if (record.get('name') === Strings.positionAddress && !value) {
return '<a href="#" onclick="Ext.fireEvent(\'stategeocode\')" >' +
Strings.sharedShowAddress + '</a>';
+ } else if (record.get('name') === Strings.positionImage || record.get('name') === Strings.positionAudio) {
+ position = this.getController().position;
+ if (position) {
+ device = Ext.getStore('Devices').getById(position.get('deviceId'));
+ if (device) {
+ return '<a target="_blank" href="/api/media/' + device.get('uniqueId') + '/' + value + '" >' +
+ value + '</a>';
+ }
+ }
}
return value;
}