Unified web and standalone versions done.

This commit is contained in:
2023-01-11 22:40:43 +01:00
parent ac3e1ea0d6
commit 7fce9c5d12
2 changed files with 14 additions and 2 deletions
+1 -1
View File
@@ -1122,7 +1122,7 @@ function startSequence(All) {
}
}
// Update GUI progress bar
Progress=Progress+90/SValues.length;
Progress=Math.round(Progress+90/SValues.length);
document.getElementById("pBar").style.width = Progress + "%";
document.getElementById("pBar").innerHTML = Progress + "%";
+13 -1
View File
@@ -20,6 +20,7 @@ function writeAsciiFile(filename,content) {
// Prepare CGI args
let cgiargs = "?fn="+filename;
let lines = content.split(/\n/);
let prefix = filename.split(/\//);
for (let i=0; i<lines.length; i++) {
cgiargs += "&line" + i + "=" + lines[i];
}
@@ -33,9 +34,20 @@ function writeAsciiFile(filename,content) {
console.log(xhttp.status, xhttp.statusText);
}
}
let request = "/cgi-bin/try.cgi"+cgiargs;
let request = "/cgi-bin/singleTrimSP.cgi"+cgiargs;
xhttp.open("GET", request, false);
xhttp.send();
// Now you can add a link to the files
let d = document.getElementById("linkDiv");
if (!d) {
d = document.createElement("div");
d.id = "linkDiv";
let htmlLink = "Download files: <a href='";
htmlLink += "/tmp/" + prefix[2] + ".tgz'>";
htmlLink += prefix[2] + ".tgz</a>";
d.innerHTML = htmlLink;
document.body.appendChild(d);
}
return(1);
}