diff --git a/.gitignore b/.gitignore
index c870aac..3e42fc3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
/target
/storage
-/result
-flamegraph.svg
-perf.data*
\ No newline at end of file
+/result
\ No newline at end of file
diff --git a/flake.nix b/flake.nix
index a915975..b1d4057 100644
--- a/flake.nix
+++ b/flake.nix
@@ -51,13 +51,7 @@
packages."${name}-unwrapped" = project.rootCrate.build;
devShell = pkgs.mkShell {
- nativeBuildInputs = with pkgs; [
- stdenv.cc
- rustc
- cargo
- cargo-audit
- cargo-flamegraph
- ];
+ nativeBuildInputs = with pkgs; [ rustc cargo cargo-audit stdenv.cc ];
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
};
}
diff --git a/src/download.rs b/src/download.rs
index 830e9fb..c86d801 100644
--- a/src/download.rs
+++ b/src/download.rs
@@ -45,7 +45,6 @@ impl DownloadingFile {
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_DISPOSITION,
diff --git a/static/index.html b/static/index.html
index c9b570e..5728d64 100644
--- a/static/index.html
+++ b/static/index.html
@@ -21,7 +21,9 @@
diff --git a/static/transbeam.css b/static/transbeam.css
index 90bfbfe..3a7402b 100644
--- a/static/transbeam.css
+++ b/static/transbeam.css
@@ -14,13 +14,16 @@ body {
margin: 10px auto;
}
-#progress_bar {
+#progress_bar, #progress_bar_filled {
height: 20px;
- border-radius: 10px;
+ border-radius: 8px;
+}
+#progress_bar {
border: 1px solid #48f;
- background-image: linear-gradient(0deg, #27f, #27f);
- background-repeat: no-repeat;
- background-size: 0;
+}
+#progress_bar_filled {
+ width: 0;
+ background-color: #27f;
}
table {
@@ -28,12 +31,6 @@ table {
margin: 20px auto;
}
-tr {
- background-image: linear-gradient(0deg, #7af, #7af);
- background-repeat: no-repeat;
- background-size: 0;
-}
-
tr + tr td {
border-top: 1px solid #ddd;
}
diff --git a/static/transbeam.js b/static/transbeam.js
index a0dfbb8..340d529 100644
--- a/static/transbeam.js
+++ b/static/transbeam.js
@@ -15,7 +15,7 @@ const downloadLink = document.getElementById('download_link');
const progressContainer = document.getElementById('progress_container');
const progress = document.getElementById('progress');
-const progressBar = document.getElementById('progress_bar');
+const progressBarFilled = document.getElementById('progress_bar_filled');
let files = [];
@@ -41,7 +41,6 @@ function finishSending() {
}
socket.close();
progressContainer.textContent = "Upload complete!";
- fileList.style.backgroundColor = "#7af";
}
function sendData() {
@@ -71,19 +70,8 @@ function updateProgress() {
} else {
percentage = `${(bytesSent*100/totalBytes).toFixed(1)}%`;
}
- progress.textContent = `${percentage} (${displaySize(bytesSent)}/${displaySize(totalBytes)})`;
- progressBar.style.backgroundSize = 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)}%`;
- }
- }
+ progress.textContent = percentage;
+ progressBarFilled.style.width = percentage;
}
function updateFiles() {