diff --git a/i18n/en.json b/i18n/en.json index 05fb92fc8c..e73ac13e60 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -2255,6 +2255,7 @@ "step_delete_confirm": "Are you sure you want to delete this step?", "step_details": "Step details", "steps": "Steps", + "steps_count": "{count, plural, one {# step} other {# steps}}", "stop_casting": "Stop casting", "stop_motion_photo": "Stop Motion Photo", "stop_photo_sharing": "Stop sharing your photos?", diff --git a/web/src/routes/(user)/workflows/+page.svelte b/web/src/routes/(user)/workflows/+page.svelte index 386f0435d8..9bad3333b7 100644 --- a/web/src/routes/(user)/workflows/+page.svelte +++ b/web/src/routes/(user)/workflows/+page.svelte @@ -4,27 +4,11 @@ import UserPageLayout from '$lib/components/layouts/UserPageLayout.svelte'; import OnEvents from '$lib/components/OnEvents.svelte'; import EmptyPlaceholder from '$lib/components/shared-components/EmptyPlaceholder.svelte'; - import { pluginManager } from '$lib/managers/plugin-manager.svelte'; import { Route } from '$lib/route'; import { getWorkflowActions, getWorkflowsActions, getWorkflowShowSchemaAction } from '$lib/services/workflow.service'; import { getWorkflowForShare, type WorkflowResponseDto } from '@immich/sdk'; - import { - Button, - Card, - CardBody, - CardDescription, - CardHeader, - CardTitle, - CodeBlock, - Container, - IconButton, - Link, - MenuItemType, - menuManager, - Text, - VStack, - } from '@immich/ui'; - import { mdiClose, mdiDotsVertical } from '@mdi/js'; + import { Button, CodeBlock, Container, Icon, IconButton, MenuItemType, menuManager } from '@immich/ui'; + import { mdiClose, mdiDotsVertical, mdiFlashOutline } from '@mdi/js'; import { t } from 'svelte-i18n'; import { SvelteSet } from 'svelte/reactivity'; import type { PageData } from './$types'; @@ -55,12 +39,6 @@ return labels[triggerType] || triggerType; }; - const formatTimestamp = (createdAt: string) => - new Intl.DateTimeFormat(undefined, { - dateStyle: 'medium', - timeStyle: 'short', - }).format(new Date(createdAt)); - const showWorkflowMenu = (event: MouseEvent, workflow: WorkflowResponseDto) => { const { ToggleEnabled, Edit, Delete } = getWorkflowActions($t, workflow); void menuManager.show({ @@ -93,12 +71,6 @@ -{#snippet chipItem(title: string)} - - {title} - -{/snippet} -
@@ -112,95 +84,85 @@ class="mx-auto mt-10" /> {:else} -
+
{#each workflows as workflow (workflow.id)} - - + -
-
- - - {workflow.name || $t('workflow')} - +
+ +
+ +
+
+

+ {workflow.name || $t('workflow')} +

+ {#if !workflow.enabled} + + {$t('disabled')} + + {/if}
+

+ {getTriggerLabel(workflow.trigger)} ยท {$t('steps_count', { + values: { count: workflow.steps.length }, + })} +

{#if workflow.description} - {workflow.description} +

+ {workflow.description} +

{/if}
-
- - - - -
- -
-
- {$t('trigger')} -
- {@render chipItem(getTriggerLabel(workflow.trigger))} -
- - -
-
- {$t('steps')} -
- -
- {#if workflow.steps.length === 0} - - {$t('no_steps')} - - {:else} -
- {#each workflow.steps as step, i (i)} - {@render chipItem(pluginManager.getMethodLabel(step.method))} - {/each} -
- {/if} -
-
-
- - {#if expandedIds.has(workflow.id)} - {#await getWorkflowForShare({ id: workflow.id }) then result} - - - - - {/await} - {/if} -
- + {/await} + {/if} +
{/each}
{/if}