diff --git a/svelte/src/filesystem/FSNavigator.ts b/svelte/src/filesystem/FSNavigator.ts index b064a4b..06a8091 100644 --- a/svelte/src/filesystem/FSNavigator.ts +++ b/svelte/src/filesystem/FSNavigator.ts @@ -299,6 +299,12 @@ export const path_link = (node: HTMLAnchorElement, data: { nav: FSNavigator, nod // Override click handler const click = (e: MouseEvent) => { + // Modified clicks open the link in a new tab or window, let the browser + // handle those + if (e.button !== 0 || e.ctrlKey || e.metaKey || e.shiftKey || e.altKey) { + return + } + e.preventDefault() data.nav.navigate(data.node.path, true) } diff --git a/svelte/src/filesystem/edit_window/AccessControl.svelte b/svelte/src/filesystem/edit_window/AccessControl.svelte index 0e2125d..fa94236 100644 --- a/svelte/src/filesystem/edit_window/AccessControl.svelte +++ b/svelte/src/filesystem/edit_window/AccessControl.svelte @@ -1,7 +1,9 @@ {#if $user.subscription.file_sharing === false} @@ -69,7 +72,26 @@ let share_link = $derived(window.location.protocol+"//"+window.location.host+"/d - + + +{#if owner && file.type === "dir" && file.id !== "me"} +
+ S3 access +

+ This directory can be used as a bucket by backup tools and other + software which supports Amazon S3. The directory ID is the access key, + and the passwords above are the secret keys. Each password's permissions + decide what it can do. +

+ + + + + + +
Endpoint{s3_endpoint}Copy
Bucket and access key{file.id}Copy
Regionus-east-1 (any region works)
+
+{/if}
Embedding diff --git a/svelte/src/layout/ToggleButton.svelte b/svelte/src/layout/ToggleButton.svelte index e14b543..481d61b 100644 --- a/svelte/src/layout/ToggleButton.svelte +++ b/svelte/src/layout/ToggleButton.svelte @@ -6,7 +6,7 @@ let { group_first = false, group_middle = false, group_last = false, - highlight = true, + highlight = false, flat = false, action, children, @@ -35,16 +35,16 @@ const click = (e: MouseEvent) => { onclick={click} type="button" class="button" - class:button_highlight={on && highlight} + class:button_highlight={highlight} class:group_first class:group_middle class:group_last class:flat > {#if on} - {icon_on} + {icon_on} {:else} - {icon_off} + {icon_off} {/if} {@render children?.()} @@ -53,4 +53,10 @@ const click = (e: MouseEvent) => { .button { flex: 0 0 content; } +.green { + color: var(--highlight_color); +} +.red { + color: var(--danger_color); +} diff --git a/svelte/src/lib/FilesystemAPI.svelte.ts b/svelte/src/lib/FilesystemAPI.svelte.ts index 4d0241d..e51956a 100644 --- a/svelte/src/lib/FilesystemAPI.svelte.ts +++ b/svelte/src/lib/FilesystemAPI.svelte.ts @@ -104,6 +104,10 @@ export type FSPermissions = { read: boolean, write: boolean, delete: boolean, + + // Only used for passwords + label?: string, + last_used?: string, } export type FSContext = { @@ -289,16 +293,6 @@ export const fs_timeseries = async (path: string, start: Date, end: Date, interv ) as NodeTimeSeries } -export const fs_import = async (parent_dir_path = "", filelist: Array) => { - const form = new FormData() - form.append("action", "import") - form.append("files", JSON.stringify(filelist)) - - return await fs_check_response( - await fetch(fs_path_url(parent_dir_path), { method: "POST", body: form }) - ) as GenericResponse -} - // Utility functions // =================