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