Add bulk download button for filesystem

This commit is contained in:
Pixeldrain-Server committed 2024-05-08 18:29:59 +02:00
1 parent 1cf6c90c2e
commit 7bc35e912c
4 files changed
+14 -16

No files matched your search

+4 -7
View File
@@ -4,18 +4,15 @@ import { onMount } from "svelte"
let ad_type = ""
onMount(() => {
// 30% pixeldrain socials
// 20% reviews
// 10% ad block promo
// 40% patreon
// 40% pixeldrain socials
// 10% reviews
// 50% patreon
let rand = Math.random()
if (rand < 0.3) {
if (rand < 0.4) {
ad_type = "socials"
} else if (rand < 0.5) {
ad_type = "reviews"
} else if (rand < 0.6) {
ad_type = "ad_block"
} else {
ad_type = "patreon_support"
}
+1 -2
View File
@@ -637,8 +637,7 @@ const keyboard_event = evt => {
.headerbar > * {
flex-grow: 0;
flex-shrink: 0;
margin-left: 4px;
margin-right: 4px;
margin: 3px;
}
.headerbar > .file_viewer_headerbar_title {
flex-grow: 1;
+5 -1
View File
@@ -94,7 +94,11 @@ const keydown = e => {
};
const download = () => {
download_frame.src = fs_path_url(state.base.path) + "?attach"
if (state.base.type === "file") {
download_frame.src = fs_path_url(state.base.path) + "?attach"
} else if (state.base.type === "dir") {
download_frame.src = fs_path_url(state.base.path) + "?bulk_download"
}
}
const search = async () => {
+4 -6
View File
@@ -112,12 +112,10 @@ let expand = e => {
<div class="separator hidden_horizontal"></div>
{#if state.base.type === "file"}
<button on:click={() => dispatch("download")}>
<i class="icon">save</i>
<span>Download</span>
</button>
{/if}
<button on:click={() => dispatch("download")}>
<i class="icon">save</i>
<span>Download</span>
</button>
{#if share_url !== ""}
<button on:click={copy_link} class:button_highlight={link_copied}>