aboutsummaryrefslogtreecommitdiffstats
path: root/src/renderer.rs
diff options
context:
space:
mode:
authorSilux <silux@silux.ink>2023-02-22 10:11:38 +0000
committerSilux <silux@silux.ink>2023-02-22 10:49:00 +0000
commit85b222fba477d1582e4240c2ddb099ed71b75442 (patch)
tree4f94f0122e2b40177c5367e0ec90fe2eb3d45edf /src/renderer.rs
parentCleaned up thewget_footer function and generated command (diff)
downloadminiserve-85b222fba477d1582e4240c2ddb099ed71b75442.tar.gz
miniserve-85b222fba477d1582e4240c2ddb099ed71b75442.zip
Make the wget footer click to copy
Diffstat (limited to '')
-rw-r--r--src/renderer.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/renderer.rs b/src/renderer.rs
index 4887dd5..affcbb2 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -283,10 +283,14 @@ fn wget_footer(abs_path: &str, root_dir_name: &str, current_user: Option<&Curren
None => String::new(),
};
+ let command =
+ format!("wget -rcnHp{cut_dirs} -R 'index.html*'{user_params} '{abs_path}?raw=true'");
+ let click_to_copy = format!("navigator.clipboard.writeText(\"{command}\")");
+
html! {
div.downloadDirectory {
p { "Download folder:" }
- div.cmd { (format!("wget -rcnHp{cut_dirs} -R \"index.html*\"{user_params} \"{abs_path}?raw=true\"")) }
+ a.cmd title="Click to copy!" style="cursor: pointer;" onclick=(click_to_copy) { (command) }
}
}
}