Add file tree to menu

This commit is contained in:
2026-01-29 23:41:30 +01:00
parent 2331d2b969
commit 5ce6b0c417
13 changed files with 199 additions and 285 deletions

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import { fs_rename, fs_update, type FSNode, type NodeOptions } from "lib/FilesystemAPI.svelte";
import { fs_rename, fs_update, type FSNode, type FSPermissions, type NodeOptions } from "lib/FilesystemAPI.svelte";
import Modal from "util/Modal.svelte";
import BrandingOptions from "./BrandingOptions.svelte";
import { branding_from_props } from "./Branding";
@@ -22,6 +22,10 @@ let {
visible: boolean;
} = $props();
const default_permissions: FSPermissions = {
owner: false, read: false, write: false, delete: false
}
// Open the edit window. Argument 1 is the file to edit, 2 is whether the file
// should be opened after the user finishes editing and 3 is the default tab
// that should be open when the window shows
@@ -45,9 +49,9 @@ export const edit = (f: FSNode, oae = false, open_tab = "") => {
}
options.custom_domain_name = file.custom_domain_name
options.link_permissions = file.link_permissions
options.user_permissions = file.user_permissions
options.password_permissions = file.password_permissions
options.link_permissions = file.link_permissions === undefined ? default_permissions : file.link_permissions
options.user_permissions = file.user_permissions === undefined ? {} : file.user_permissions
options.password_permissions = file.password_permissions === undefined ? {} : file.password_permissions
branding_enabled = options.branding_enabled === "true"
if (branding_enabled) {