fixed some stuff
This commit is contained in:
parent
821163eeb3
commit
78f331160a
|
@ -33,12 +33,14 @@
|
||||||
<div id="main" class="container" style="text-align: center;">
|
<div id="main" class="container" style="text-align: center;">
|
||||||
<h1>Fawkes</h1>
|
<h1>Fawkes</h1>
|
||||||
<p>Protect your images from facial recognition.</p>
|
<p>Protect your images from facial recognition.</p>
|
||||||
<p>TODO: add more info</p>
|
</div>
|
||||||
|
|
||||||
|
<div id="manual-area" class="container" style="text-align: center;">
|
||||||
|
<p>Please upload the images you want to protect.</p>
|
||||||
<p>The table below shows the status for each image you've uploaded. You can select the files you want to protect using the <i>Browse</i> and <i>Upload</i> buttons below.</p>
|
<p>The table below shows the status for each image you've uploaded. You can select the files you want to protect using the <i>Browse</i> and <i>Upload</i> buttons below.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="upload-area" class="container">
|
<div id="upload-area" class="container">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="twelve columns">
|
<div class="twelve columns">
|
||||||
<label for="input-file">Your Image</label>
|
<label for="input-file">Your Image</label>
|
||||||
|
@ -63,10 +65,9 @@
|
||||||
<p id="text-no-images" style="text-align: center;">You haven't uploaded any images yet.</p>
|
<p id="text-no-images" style="text-align: center;">You haven't uploaded any images yet.</p>
|
||||||
|
|
||||||
<button class="button button-primary" id="button-start"><i class="fas fa-check"></i> Start Fawkes</button>
|
<button class="button button-primary" id="button-start"><i class="fas fa-check"></i> Start Fawkes</button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="download-area" class="container">
|
<div id="download-area" class="container" style="text-align: center;">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
@ -111,6 +112,9 @@ document.getElementById("button-upload").addEventListener("click", function(){
|
||||||
// Send request to server
|
// Send request to server
|
||||||
socket.emit("FILE_START", {name:id, length:file.size});
|
socket.emit("FILE_START", {name:id, length:file.size});
|
||||||
|
|
||||||
|
// Reset file input
|
||||||
|
document.getElementById("input-file").value = "";
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
// No file selected
|
// No file selected
|
||||||
alert("Please select a file using the 'Browse' button.");
|
alert("Please select a file using the 'Browse' button.");
|
||||||
|
@ -168,6 +172,11 @@ document.getElementById("button-start").addEventListener("click", function(){
|
||||||
document.getElementById("button-start").style.display = "none";
|
document.getElementById("button-start").style.display = "none";
|
||||||
document.getElementById("upload-area").style.display = "none";
|
document.getElementById("upload-area").style.display = "none";
|
||||||
|
|
||||||
|
// Display new manual text
|
||||||
|
var man = "";
|
||||||
|
man += "<p>Please wait while Fawkes processes your images. This might take a while.</p>";
|
||||||
|
document.getElementById("manual-area").innerHTML = man;
|
||||||
|
|
||||||
// Send server request to start Fawkes
|
// Send server request to start Fawkes
|
||||||
socket.emit("FAWKES_START");
|
socket.emit("FAWKES_START");
|
||||||
});
|
});
|
||||||
|
@ -201,6 +210,8 @@ socket.on("FAWKES_DONE", function(data){
|
||||||
page += "<p>Your images have been protected!</p>";
|
page += "<p>Your images have been protected!</p>";
|
||||||
page += "<a class='button button-primary' href='"+data.downloadUrl+"' target='_blank'><i class='fas fa-download'></i> Download</a>";
|
page += "<a class='button button-primary' href='"+data.downloadUrl+"' target='_blank'><i class='fas fa-download'></i> Download</a>";
|
||||||
document.getElementById("download-area").innerHTML = page;
|
document.getElementById("download-area").innerHTML = page;
|
||||||
|
document.getElementById("table-area").style.display = "none";
|
||||||
|
document.getElementById("manual-area").style.display = "none";
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
// Error
|
// Error
|
||||||
|
@ -208,6 +219,8 @@ socket.on("FAWKES_DONE", function(data){
|
||||||
page += "<h5><i class='fas fa-exclamation-triangle'></i> Processing Failed</h5>";
|
page += "<h5><i class='fas fa-exclamation-triangle'></i> Processing Failed</h5>";
|
||||||
page += "<p>"+data.message+"</p>";
|
page += "<p>"+data.message+"</p>";
|
||||||
document.getElementById("download-area").innerHTML = page;
|
document.getElementById("download-area").innerHTML = page;
|
||||||
|
document.getElementById("table-area").style.display = "none";
|
||||||
|
document.getElementById("manual-area").style.display = "none";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
1
main.js
1
main.js
|
@ -276,6 +276,7 @@ io.on("connection", (socket) => {
|
||||||
"tar -czvf fawkes/files/"+archiveName+" -C fawkes/files/"+userId+"cloaked ."
|
"tar -czvf fawkes/files/"+archiveName+" -C fawkes/files/"+userId+"cloaked ."
|
||||||
, (error, stdout, stderr) => {
|
, (error, stdout, stderr) => {
|
||||||
console.log("archive creation done: "+error+", "+stdout+", "+stderr);
|
console.log("archive creation done: "+error+", "+stdout+", "+stderr);
|
||||||
|
|
||||||
// Zip done
|
// Zip done
|
||||||
if(error){
|
if(error){
|
||||||
socket.emit("FAWKES_DONE", {success:false, message:"Internal server error. Couldn't create archive."});
|
socket.emit("FAWKES_DONE", {success:false, message:"Internal server error. Couldn't create archive."});
|
||||||
|
|
Loading…
Reference in New Issue