Added a download button to GUI in order to download reports easily

This commit is contained in:
marvindoering 2021-02-14 18:15:23 +01:00
parent 7ff5287a23
commit 65a988f13b
2 changed files with 16 additions and 1 deletions

View file

@ -40,6 +40,7 @@
<body>
<script type="text/javascript">
var report;
var validate = function () {
const input = document.getElementById('file');
@ -62,6 +63,20 @@
return false;
};
var reporting = function() {
var filename = "report.html";
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(report));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
</script>