diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2022-01-28 10:37:03 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2022-01-28 10:37:03 -0800 |
commit | fe4e7d56aa4a6920282724336ec0ccd5f83b4570 (patch) | |
tree | ca4560f9a649812319b2f511a0ca30f77fb3d70e /web/app/view | |
parent | 9e1c0b44189136ec6abf05720c698027a689fa08 (diff) | |
download | trackermap-web-fe4e7d56aa4a6920282724336ec0ccd5f83b4570.tar.gz trackermap-web-fe4e7d56aa4a6920282724336ec0ccd5f83b4570.tar.bz2 trackermap-web-fe4e7d56aa4a6920282724336ec0ccd5f83b4570.zip |
Fix image URL
Diffstat (limited to 'web/app/view')
-rw-r--r-- | web/app/view/State.js | 15 | ||||
-rw-r--r-- | web/app/view/StateController.js | 3 |
2 files changed, 10 insertions, 8 deletions
diff --git a/web/app/view/State.js b/web/app/view/State.js index ed9951b5..c0a430d9 100644 --- a/web/app/view/State.js +++ b/web/app/view/State.js @@ -1,5 +1,5 @@ /* - * Copyright 2015 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2022 Anton Tananaev (anton@traccar.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -61,19 +61,20 @@ Ext.define('Traccar.view.State', { dataIndex: 'value', cellWrap: true, renderer: function (value, metaData, record) { - var position, device; - if (record.get('attribute') === 'alarm') { + var position, device, attribute; + attribute = record.get('attribute'); + if (attribute === 'alarm') { metaData.tdCls = 'view-color-red'; - } else if (record.get('name') === Strings.positionAddress && !value) { + } else if (attribute === 'address' && !value) { return '<a href="#" onclick="Ext.fireEvent(\'stategeocode\')" >' + Strings.sharedShowAddress + '</a>'; - } else if (record.get('name') === Strings.positionImage || record.get('name') === Strings.positionAudio) { + } else if (attribute === 'image' || attribute === 'video' || attribute === 'audio') { 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 '<a target="_blank" href="/api/media/' + + device.get('uniqueId') + '/' + value + '" >' + value + '</a>'; } } } diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js index 1ab1aa2f..f04d7185 100644 --- a/web/app/view/StateController.js +++ b/web/app/view/StateController.js @@ -1,5 +1,5 @@ /* - * Copyright 2015 - 2017 Anton Tananaev (anton@traccar.org) + * Copyright 2015 - 2022 Anton Tananaev (anton@traccar.org) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -128,6 +128,7 @@ Ext.define('Traccar.view.StateController', { store.add(Ext.create('Traccar.model.Attribute', { priority: this.keys[key].priority, name: this.keys[key].name, + attribute: key, value: Traccar.AttributeFormatter.getFormatter(key)(this.position.get(key)) })); } |