Compare commits
No commits in common. "b520304a9daf9031d723820bbf689ba80cf12f6c" and "43065cfb732d3c8c7069d0d6ae4bb7e609e53db5" have entirely different histories.
b520304a9d
...
43065cfb73
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,5 +1,3 @@
|
||||||
/target
|
/target
|
||||||
/storage
|
/storage
|
||||||
/result
|
/result
|
||||||
flamegraph.svg
|
|
||||||
perf.data*
|
|
|
@ -51,13 +51,7 @@
|
||||||
packages."${name}-unwrapped" = project.rootCrate.build;
|
packages."${name}-unwrapped" = project.rootCrate.build;
|
||||||
|
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [ rustc cargo cargo-audit stdenv.cc ];
|
||||||
stdenv.cc
|
|
||||||
rustc
|
|
||||||
cargo
|
|
||||||
cargo-audit
|
|
||||||
cargo-flamegraph
|
|
||||||
];
|
|
||||||
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,6 @@ impl DownloadingFile {
|
||||||
|
|
||||||
let mut res = HttpResponse::build(StatusCode::OK);
|
let mut res = HttpResponse::build(StatusCode::OK);
|
||||||
|
|
||||||
res.insert_header((header::CONTENT_SECURITY_POLICY, "sandbox"));
|
|
||||||
res.insert_header((header::CONTENT_TYPE, mime::APPLICATION_OCTET_STREAM));
|
res.insert_header((header::CONTENT_TYPE, mime::APPLICATION_OCTET_STREAM));
|
||||||
res.insert_header((
|
res.insert_header((
|
||||||
header::CONTENT_DISPOSITION,
|
header::CONTENT_DISPOSITION,
|
||||||
|
|
|
@ -21,7 +21,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="progress_container" style="display: none;">
|
<div id="progress_container" style="display: none;">
|
||||||
<div id="progress"></div>
|
<div id="progress"></div>
|
||||||
<div id="progress_bar"></div>
|
<div id="progress_bar">
|
||||||
|
<div id="progress_bar_filled"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="file_list_container" style="display: none;">
|
<div id="file_list_container" style="display: none;">
|
||||||
<table id="file_list">
|
<table id="file_list">
|
||||||
|
|
|
@ -14,13 +14,16 @@ body {
|
||||||
margin: 10px auto;
|
margin: 10px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
#progress_bar {
|
#progress_bar, #progress_bar_filled {
|
||||||
height: 20px;
|
height: 20px;
|
||||||
border-radius: 10px;
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
#progress_bar {
|
||||||
border: 1px solid #48f;
|
border: 1px solid #48f;
|
||||||
background-image: linear-gradient(0deg, #27f, #27f);
|
}
|
||||||
background-repeat: no-repeat;
|
#progress_bar_filled {
|
||||||
background-size: 0;
|
width: 0;
|
||||||
|
background-color: #27f;
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
|
@ -28,12 +31,6 @@ table {
|
||||||
margin: 20px auto;
|
margin: 20px auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr {
|
|
||||||
background-image: linear-gradient(0deg, #7af, #7af);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
background-size: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
tr + tr td {
|
tr + tr td {
|
||||||
border-top: 1px solid #ddd;
|
border-top: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ const downloadLink = document.getElementById('download_link');
|
||||||
|
|
||||||
const progressContainer = document.getElementById('progress_container');
|
const progressContainer = document.getElementById('progress_container');
|
||||||
const progress = document.getElementById('progress');
|
const progress = document.getElementById('progress');
|
||||||
const progressBar = document.getElementById('progress_bar');
|
const progressBarFilled = document.getElementById('progress_bar_filled');
|
||||||
|
|
||||||
let files = [];
|
let files = [];
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@ function finishSending() {
|
||||||
}
|
}
|
||||||
socket.close();
|
socket.close();
|
||||||
progressContainer.textContent = "Upload complete!";
|
progressContainer.textContent = "Upload complete!";
|
||||||
fileList.style.backgroundColor = "#7af";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendData() {
|
function sendData() {
|
||||||
|
@ -71,19 +70,8 @@ function updateProgress() {
|
||||||
} else {
|
} else {
|
||||||
percentage = `${(bytesSent*100/totalBytes).toFixed(1)}%`;
|
percentage = `${(bytesSent*100/totalBytes).toFixed(1)}%`;
|
||||||
}
|
}
|
||||||
progress.textContent = `${percentage} (${displaySize(bytesSent)}/${displaySize(totalBytes)})`;
|
progress.textContent = percentage;
|
||||||
progressBar.style.backgroundSize = percentage;
|
progressBarFilled.style.width = percentage;
|
||||||
|
|
||||||
const fileEntries = Array.from(fileList.children);
|
|
||||||
for (entry of fileEntries.slice(0, fileIndex)) {
|
|
||||||
entry.style.backgroundSize = "100%";
|
|
||||||
}
|
|
||||||
if (fileIndex < files.length) {
|
|
||||||
const currentFile = files[fileIndex];
|
|
||||||
if (currentFile.size > 0) {
|
|
||||||
fileEntries[fileIndex].style.backgroundSize = `${(byteIndex*100/currentFile.size)}%`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateFiles() {
|
function updateFiles() {
|
||||||
|
|
Loading…
Reference in a new issue