Frontend changes: download link to validation report

This commit is contained in:
chubtub 2020-11-20 20:56:26 -05:00
parent 9b8721e33a
commit a4d639925e

View File

@ -93,7 +93,10 @@
{ {
// TODO render a link to a device details page, // TODO render a link to a device details page,
// passing the device.id // passing the device.id
data: 'device.name' data: 'device.name',
render: function (data, type, full, meta) {
return createDownloadLink(full);
}
}, },
{ {
data: 'id', data: 'id',
@ -126,6 +129,16 @@
dataTable.order([1, 'desc']).draw(); //order by createTime dataTable.order([1, 'desc']).draw(); //order by createTime
}); });
/**
* This method builds a url to download the device validation report.
*/
function createDownloadLink(full) {
return full.device.name + ' ' +
'<a href="${portal}/validation-reports/download?id=' + full.device.name +
'"><img src="${icons}/ic_file_download_black_24dp.png" title="Download validation report">' +
'</a>';
}
/** /**
* Gets HTML to display (icon tag) for the specified validation type. * Gets HTML to display (icon tag) for the specified validation type.
* If a validation for the requested type is not found, an empty * If a validation for the requested type is not found, an empty