aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-02-05 20:11:39 +1300
committerGitHub <noreply@github.com>2018-02-05 20:11:39 +1300
commite9ca74e4decb8ab6d518cf0e4ef5e9949d446237 (patch)
treeae63783c51311301c8c0ca1614459b9cdace32c0 /web
parent368c49c20c06893459389847e781dc80af850bbc (diff)
parent463c548c865ed1c565718c680acba8cc74067ca4 (diff)
downloadtrackermap-web-e9ca74e4decb8ab6d518cf0e4ef5e9949d446237.tar.gz
trackermap-web-e9ca74e4decb8ab6d518cf0e4ef5e9949d446237.tar.bz2
trackermap-web-e9ca74e4decb8ab6d518cf0e4ef5e9949d446237.zip
Merge pull request #645 from Abyss777/state_media
Format image and audio attributes as link in State panel
Diffstat (limited to 'web')
-rw-r--r--web/app/view/State.js10
-rw-r--r--web/l10n/en.json2
2 files changed, 12 insertions, 0 deletions
diff --git a/web/app/view/State.js b/web/app/view/State.js
index 95529a48..ed9951b5 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;
}
diff --git a/web/l10n/en.json b/web/l10n/en.json
index e23d5a61..1ebccbd3 100644
--- a/web/l10n/en.json
+++ b/web/l10n/en.json
@@ -219,6 +219,8 @@
"positionObdSpeed": "OBD Speed",
"positionObdOdometer": "OBD Odometer",
"positionDriverUniqueId": "Driver Unique Id",
+ "positionImage": "Image",
+ "positionAudio": "Audio",
"serverTitle": "Server Settings",
"serverZoom": "Zoom",
"serverRegistration": "Registration",