From 3c0707579b199cf1524732d40d4f4192342f3201 Mon Sep 17 00:00:00 2001 From: dterefe Date: Thu, 6 Jun 2024 13:13:31 +0100 Subject: [PATCH 01/15] first --- .../svelte/components/Input/Dropdown.svelte | 1 + .../components/Input/FolderStructure.svelte | 61 +++++++++++++++ DUUIWeb/src/lib/svelte/components/Node.svelte | 75 +++++++++++++++++++ .../src/lib/svelte/components/TreeView.svelte | 54 +++++++++++++ .../src/routes/processes/+layout.server.ts | 2 +- DUUIWeb/src/routes/processes/+page.svelte | 68 ++++++++++++++++- .../src/routes/processes/ProcessInput.svelte | 3 + 7 files changed, 262 insertions(+), 2 deletions(-) create mode 100644 DUUIWeb/src/lib/svelte/components/Input/FolderStructure.svelte create mode 100644 DUUIWeb/src/lib/svelte/components/Node.svelte create mode 100644 DUUIWeb/src/lib/svelte/components/TreeView.svelte diff --git a/DUUIWeb/src/lib/svelte/components/Input/Dropdown.svelte b/DUUIWeb/src/lib/svelte/components/Input/Dropdown.svelte index 329d42a..496649c 100644 --- a/DUUIWeb/src/lib/svelte/components/Input/Dropdown.svelte +++ b/DUUIWeb/src/lib/svelte/components/Input/Dropdown.svelte @@ -2,6 +2,7 @@ @component A Dropdown component where one option can be selected. --> + + + + toggleSelectable(e, 'images')} + > + toggleSelectable(e, 'avatar.png')} + /> + toggleSelectable(e, 'background.jpg')} + /> + + toggleSelectable(e, '.gitignore')} + /> + toggleSelectable(e, 'index.html')} + /> + diff --git a/DUUIWeb/src/lib/svelte/components/Node.svelte b/DUUIWeb/src/lib/svelte/components/Node.svelte new file mode 100644 index 0000000..1f91517 --- /dev/null +++ b/DUUIWeb/src/lib/svelte/components/Node.svelte @@ -0,0 +1,75 @@ + + + + + \ No newline at end of file diff --git a/DUUIWeb/src/lib/svelte/components/TreeView.svelte b/DUUIWeb/src/lib/svelte/components/TreeView.svelte new file mode 100644 index 0000000..1918853 --- /dev/null +++ b/DUUIWeb/src/lib/svelte/components/TreeView.svelte @@ -0,0 +1,54 @@ + + + + + + diff --git a/DUUIWeb/src/routes/processes/+layout.server.ts b/DUUIWeb/src/routes/processes/+layout.server.ts index 4ffbd62..a7f224b 100644 --- a/DUUIWeb/src/routes/processes/+layout.server.ts +++ b/DUUIWeb/src/routes/processes/+layout.server.ts @@ -3,7 +3,7 @@ import { redirect } from '@sveltejs/kit' import type { LayoutServerLoad } from '../$types' export const load: LayoutServerLoad = async ({ locals, url, cookies }) => { - if (!locals.user) { + if (locals.user) { redirect(302, handleLoginRedirect(url)) } } diff --git a/DUUIWeb/src/routes/processes/+page.svelte b/DUUIWeb/src/routes/processes/+page.svelte index 234cb5b..a938de4 100644 --- a/DUUIWeb/src/routes/processes/+page.svelte +++ b/DUUIWeb/src/routes/processes/+page.svelte @@ -33,9 +33,11 @@ faCloudUpload, faFileArrowUp } from '@fortawesome/free-solid-svg-icons' - import { FileDropzone, ProgressBar, getToastStore } from '@skeletonlabs/skeleton' + import {FileDropzone, ProgressBar, getToastStore, TreeViewItem, TreeView} from '@skeletonlabs/skeleton' import { onMount } from 'svelte' + import Node from '$lib/svelte/components/Node.svelte' import Fa from 'svelte-fa' + import FolderStructure from "$lib/svelte/components/Input/FolderStructure.svelte"; export let data const { user } = data @@ -229,6 +231,28 @@ isValidFileUpload(fileStorage) $: uploadBucketIsValid = isValidS3BucketName(fileStorage.path) $: $userSession + + let folder = { + label: 'root', + checked: true, + expanded: true, + children: [ + { + label: 'node A', + expanded: true, + children: [{ label: 'node Aa' }, { label: 'node Ab' }] + }, + { label: 'node B' }, + { label: 'node C' }, + { label: 'node D' } + ] + }; + + let selectedItem: string = "" + + function toggleSelectable(e, item) { + selectedItem = item; + } @@ -365,6 +389,48 @@ bind:value={$processSettingsStore.settings.language} /> +
+ + + + + + + + + + + + + + + + + + + + + + + + toggleSelectable(e, '.gitignore')} + /> + toggleSelectable(e, 'index.html')} + /> + +
+ + {#if equals($processSettingsStore.input.provider, IO.Text)}