diff --git a/static/js/run.js b/static/js/run.js index 35c28bf..825813c 100644 --- a/static/js/run.js +++ b/static/js/run.js @@ -108,7 +108,11 @@ function showReport(results) { summary.appendChild(report.toDom()); - details.innerHTML = JSON.stringify(results, null, 2); + let reportJSON = JSON.stringify(results, null, 2); + details.innerText = reportJSON; + let reportBlob = new Blob([ reportJSON ], { type : 'application/json' }); + document.querySelector('.details__download').href = URL.createObjectURL(reportBlob); + } checkStatus(); diff --git a/styles/components/_details.scss b/styles/components/_details.scss index e7b0c59..84e1329 100644 --- a/styles/components/_details.scss +++ b/styles/components/_details.scss @@ -3,6 +3,10 @@ padding: space(8) 0; } +.details > .container { + position: relative; +} + .details summary { cursor: pointer; list-style-type: disclosure-closed; @@ -28,4 +32,11 @@ padding: space(2); font-size: typesize(-1); margin-top: space(2); + white-space: pre-wrap; +} + +.details__download { + position: absolute; + top: 0; + right: 0; } diff --git a/views/run.html b/views/run.html index b6c4d2a..383d297 100644 --- a/views/run.html +++ b/views/run.html @@ -64,6 +64,7 @@

         
+        download the full report