From e0d15c96f1e1dc563e30caac05ce774f7941eb8b Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 7 Apr 2024 19:18:49 -0500 Subject: [PATCH] feat(web): workflow automation ui --- .../components/elements/buttons/button.svelte | 2 +- .../side-bar/side-bar.svelte | 11 ++++ .../workflow-page/workflow-card.svelte | 10 +++ .../workflow-page/workflow-editor.svelte | 64 +++++++++++++++++++ .../workflow-page/workflow-list.svelte | 17 +++++ web/src/routes/(user)/workflows/+page.svelte | 15 +++++ web/src/routes/(user)/workflows/+page.ts | 12 ++++ 7 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 web/src/lib/components/workflow-page/workflow-card.svelte create mode 100644 web/src/lib/components/workflow-page/workflow-editor.svelte create mode 100644 web/src/lib/components/workflow-page/workflow-list.svelte create mode 100644 web/src/routes/(user)/workflows/+page.svelte create mode 100644 web/src/routes/(user)/workflows/+page.ts diff --git a/web/src/lib/components/elements/buttons/button.svelte b/web/src/lib/components/elements/buttons/button.svelte index 31817f206a..9fc47c1634 100644 --- a/web/src/lib/components/elements/buttons/button.svelte +++ b/web/src/lib/components/elements/buttons/button.svelte @@ -42,7 +42,7 @@ 'text-immich-primary dark:text-immich-dark-primary enabled:dark:hover:bg-immich-dark-primary/10 enabled:hover:bg-immich-primary/10', 'light-red': 'bg-[#F9DEDC] text-[#410E0B] enabled:hover:bg-red-50', red: 'bg-red-500 text-white enabled:hover:bg-red-400', - green: 'bg-green-500 text-gray-800 enabled:hover:bg-green-400/90', + green: 'bg-green-600 text-white enabled:hover:bg-green-400/90', gray: 'bg-gray-500 dark:bg-gray-200 enabled:hover:bg-gray-500/75 enabled:dark:hover:bg-gray-200/80 text-white dark:text-immich-dark-gray', 'transparent-gray': 'dark:text-immich-dark-fg enabled:hover:bg-immich-primary/5 enabled:hover:text-gray-700 enabled:hover:dark:text-immich-dark-fg enabled:dark:hover:bg-immich-dark-primary/25', diff --git a/web/src/lib/components/shared-components/side-bar/side-bar.svelte b/web/src/lib/components/shared-components/side-bar/side-bar.svelte index cfb0a6bde3..f4eaf6372b 100644 --- a/web/src/lib/components/shared-components/side-bar/side-bar.svelte +++ b/web/src/lib/components/shared-components/side-bar/side-bar.svelte @@ -9,12 +9,17 @@ mdiArchiveArrowDownOutline, mdiHeartMultiple, mdiHeartMultipleOutline, + mdiHomeAutomation, mdiImageAlbum, mdiImageMultiple, mdiImageMultipleOutline, mdiMagnify, mdiMap, + mdiPageLayoutSidebarLeft, + mdiSettingsHelper, + mdiSlide, mdiTrashCanOutline, + mdiTuneVariant, } from '@mdi/js'; import LoadingSpinner from '../loading-spinner.svelte'; import StatusBox from '../status-box.svelte'; @@ -145,6 +150,12 @@ {/if} + +
+ +
+
+ diff --git a/web/src/lib/components/workflow-page/workflow-card.svelte b/web/src/lib/components/workflow-page/workflow-card.svelte new file mode 100644 index 0000000000..0f01ef35d3 --- /dev/null +++ b/web/src/lib/components/workflow-page/workflow-card.svelte @@ -0,0 +1,10 @@ + + +
+
+

Add this photo to every albums and notify everybody about this glorious asset

+
diff --git a/web/src/lib/components/workflow-page/workflow-editor.svelte b/web/src/lib/components/workflow-page/workflow-editor.svelte new file mode 100644 index 0000000000..8eeeaca690 --- /dev/null +++ b/web/src/lib/components/workflow-page/workflow-editor.svelte @@ -0,0 +1,64 @@ + + +
+
+
+

+ Add this photo to every albums and notify everybody about this glorious asset +

+
+ +
+ + + +
+
+ +
+
+ When an asset is uploaded +
+ +
+
+
+
+
+
+
+ +
+
+ And has Alex and Henry and Nate +
+ +
+ And from Nurnberg, Germany +
+
+ +
+
+
+
+
+
+
+ +
+
+ Add to Album +
+
+ Send webhook to abc.com with payload 123 +
+
+
+
diff --git a/web/src/lib/components/workflow-page/workflow-list.svelte b/web/src/lib/components/workflow-page/workflow-list.svelte new file mode 100644 index 0000000000..c827ca74f8 --- /dev/null +++ b/web/src/lib/components/workflow-page/workflow-list.svelte @@ -0,0 +1,17 @@ + + +
+
+

CURRENT WORKFLOW

+ +
+ +
+ {#each Array.from({ length: 50 }) as _, i} + + {/each} +
+
diff --git a/web/src/routes/(user)/workflows/+page.svelte b/web/src/routes/(user)/workflows/+page.svelte new file mode 100644 index 0000000000..e1abf8b7a1 --- /dev/null +++ b/web/src/routes/(user)/workflows/+page.svelte @@ -0,0 +1,15 @@ + + + +
+ + +
+
diff --git a/web/src/routes/(user)/workflows/+page.ts b/web/src/routes/(user)/workflows/+page.ts new file mode 100644 index 0000000000..20aa9256d6 --- /dev/null +++ b/web/src/routes/(user)/workflows/+page.ts @@ -0,0 +1,12 @@ +import { authenticate } from '$lib/utils/auth'; +import type { PageLoad } from './$types'; + +export const load = (async () => { + await authenticate(); + + return { + meta: { + title: 'Workflows', + }, + }; +}) satisfies PageLoad;