mirror of
https://github.com/immich-app/immich.git
synced 2024-12-28 22:51:59 +00:00
fix(web): storage migration description (#10041)
This commit is contained in:
parent
3c5ba77e86
commit
4ec47b4186
4 changed files with 16 additions and 17 deletions
|
@ -12,7 +12,7 @@
|
|||
mdiPlay,
|
||||
mdiSelectionSearch,
|
||||
} from '@mdi/js';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { createEventDispatcher, type ComponentType } from 'svelte';
|
||||
import JobTileButton from './job-tile-button.svelte';
|
||||
import JobTileStatus from './job-tile-status.svelte';
|
||||
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
||||
|
@ -20,6 +20,7 @@
|
|||
|
||||
export let title: string;
|
||||
export let subtitle: string | undefined;
|
||||
export let description: ComponentType | undefined;
|
||||
export let jobCounts: JobCountsDto;
|
||||
export let queueStatus: QueueStatusDto;
|
||||
export let allowForceCommand = true;
|
||||
|
@ -29,8 +30,6 @@
|
|||
export let allText: string;
|
||||
export let missingText: string;
|
||||
|
||||
const slots = $$props.$$slots;
|
||||
|
||||
$: waitingCount = jobCounts.waiting + jobCounts.paused + jobCounts.delayed;
|
||||
$: isIdle = !queueStatus.isActive && !queueStatus.isPaused;
|
||||
|
||||
|
@ -86,9 +85,9 @@
|
|||
<div class="whitespace-pre-line text-sm dark:text-white">{subtitle}</div>
|
||||
{/if}
|
||||
|
||||
{#if slots?.description}
|
||||
{#if description}
|
||||
<div class="text-sm dark:text-white">
|
||||
<slot name="description" />
|
||||
<svelte:component this={description} />
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
|
|
@ -30,12 +30,12 @@
|
|||
interface JobDetails {
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
description?: ComponentType;
|
||||
allText?: string;
|
||||
missingText?: string;
|
||||
disabled?: boolean;
|
||||
icon: string;
|
||||
allowForceCommand?: boolean;
|
||||
component?: ComponentType;
|
||||
handleCommand?: (jobId: JobName, jobCommand: JobCommandDto) => Promise<void>;
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@
|
|||
icon: mdiFolderMove,
|
||||
title: getJobName(JobName.StorageTemplateMigration),
|
||||
allowForceCommand: false,
|
||||
component: StorageMigrationDescription,
|
||||
description: StorageMigrationDescription,
|
||||
},
|
||||
[JobName.Migration]: {
|
||||
icon: mdiFolderMove,
|
||||
|
@ -153,23 +153,20 @@
|
|||
</script>
|
||||
|
||||
<div class="flex flex-col gap-7">
|
||||
{#each jobList as [jobName, { title, subtitle, disabled, allText, missingText, allowForceCommand, icon, component, handleCommand: handleCommandOverride }]}
|
||||
{#each jobList as [jobName, { title, subtitle, description, disabled, allText, missingText, allowForceCommand, icon, handleCommand: handleCommandOverride }]}
|
||||
{@const { jobCounts, queueStatus } = jobs[jobName]}
|
||||
<JobTile
|
||||
{icon}
|
||||
{title}
|
||||
{disabled}
|
||||
{subtitle}
|
||||
{description}
|
||||
allText={allText || $t('all').toUpperCase()}
|
||||
missingText={missingText || $t('missing').toUpperCase()}
|
||||
{allowForceCommand}
|
||||
{jobCounts}
|
||||
{queueStatus}
|
||||
on:command={({ detail }) => (handleCommandOverride || handleCommand)(jobName, detail)}
|
||||
>
|
||||
{#if component}
|
||||
<svelte:component this={component} slot="description" />
|
||||
{/if}
|
||||
</JobTile>
|
||||
/>
|
||||
{/each}
|
||||
</div>
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
<script lang="ts">
|
||||
import { AppRoute } from '$lib/constants';
|
||||
import { AppRoute, OpenSettingQueryParameterValue, QueryParameter } from '$lib/constants';
|
||||
import { t } from 'svelte-i18n';
|
||||
</script>
|
||||
|
||||
Apply the current
|
||||
<a href="{AppRoute.ADMIN_SETTINGS}?open=storageTemplate" class="text-immich-primary dark:text-immich-dark-primary"
|
||||
>{$t('admin.storage_template_settings')}</a
|
||||
<a
|
||||
href="{AppRoute.ADMIN_SETTINGS}?{QueryParameter.IS_OPEN}={OpenSettingQueryParameterValue.STORAGE_TEMPLATE}"
|
||||
class="text-immich-primary dark:text-immich-dark-primary"
|
||||
>
|
||||
{$t('admin.storage_template_settings')}
|
||||
</a>
|
||||
to previously uploaded assets
|
||||
|
|
|
@ -80,7 +80,7 @@ export enum QueryParameter {
|
|||
export enum OpenSettingQueryParameterValue {
|
||||
OAUTH = 'oauth',
|
||||
JOB = 'job',
|
||||
STORAGE_TEMPLATE = 'storageTemplate',
|
||||
STORAGE_TEMPLATE = 'storage-template',
|
||||
}
|
||||
|
||||
export enum ActionQueryParameterValue {
|
||||
|
|
Loading…
Reference in a new issue