mirror of
https://github.com/immich-app/immich.git
synced 2025-02-11 01:18:24 -05:00
refactor: ui icon buttons (#15531)
This commit is contained in:
parent
1f19a65d1a
commit
78464a4ba3
13 changed files with 163 additions and 146 deletions
8
web/package-lock.json
generated
8
web/package-lock.json
generated
|
@ -11,7 +11,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@formatjs/icu-messageformat-parser": "^2.9.8",
|
"@formatjs/icu-messageformat-parser": "^2.9.8",
|
||||||
"@immich/sdk": "file:../open-api/typescript-sdk",
|
"@immich/sdk": "file:../open-api/typescript-sdk",
|
||||||
"@immich/ui": "^0.14.1",
|
"@immich/ui": "^0.15.0",
|
||||||
"@mapbox/mapbox-gl-rtl-text": "0.2.3",
|
"@mapbox/mapbox-gl-rtl-text": "0.2.3",
|
||||||
"@mdi/js": "^7.4.47",
|
"@mdi/js": "^7.4.47",
|
||||||
"@photo-sphere-viewer/core": "^5.11.5",
|
"@photo-sphere-viewer/core": "^5.11.5",
|
||||||
|
@ -1343,9 +1343,9 @@
|
||||||
"link": true
|
"link": true
|
||||||
},
|
},
|
||||||
"node_modules/@immich/ui": {
|
"node_modules/@immich/ui": {
|
||||||
"version": "0.14.1",
|
"version": "0.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/@immich/ui/-/ui-0.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/@immich/ui/-/ui-0.15.0.tgz",
|
||||||
"integrity": "sha512-s5HGT35Odu6PrjO49xJ1Kpe7v1K53iMV03tv6MePVIdIM9sZHA04+o0tJgMm2KqLPZrkU+jhKPSfSy0PqkoEyQ==",
|
"integrity": "sha512-vGDNEOGj5Ma/BAIgj31M1roAVoEOVWws5lkgt1xPlIxSHk4pMhGRFMQaJaCsfXeX/nTRsQCd3gOk7Yo0XNrVfg==",
|
||||||
"license": "GNU Affero General Public License version 3",
|
"license": "GNU Affero General Public License version 3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mdi/js": "^7.4.47",
|
"@mdi/js": "^7.4.47",
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@formatjs/icu-messageformat-parser": "^2.9.8",
|
"@formatjs/icu-messageformat-parser": "^2.9.8",
|
||||||
"@immich/sdk": "file:../open-api/typescript-sdk",
|
"@immich/sdk": "file:../open-api/typescript-sdk",
|
||||||
"@immich/ui": "^0.14.1",
|
"@immich/ui": "^0.15.0",
|
||||||
"@mapbox/mapbox-gl-rtl-text": "0.2.3",
|
"@mapbox/mapbox-gl-rtl-text": "0.2.3",
|
||||||
"@mdi/js": "^7.4.47",
|
"@mdi/js": "^7.4.47",
|
||||||
"@photo-sphere-viewer/core": "^5.11.5",
|
"@photo-sphere-viewer/core": "^5.11.5",
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Dropdown from '$lib/components/elements/dropdown.svelte';
|
import Dropdown from '$lib/components/elements/dropdown.svelte';
|
||||||
import GroupTab from '$lib/components/elements/group-tab.svelte';
|
import GroupTab from '$lib/components/elements/group-tab.svelte';
|
||||||
import Icon from '$lib/components/elements/icon.svelte';
|
|
||||||
import SearchBar from '$lib/components/elements/search-bar.svelte';
|
import SearchBar from '$lib/components/elements/search-bar.svelte';
|
||||||
import {
|
import {
|
||||||
AlbumFilter,
|
AlbumFilter,
|
||||||
|
@ -129,8 +128,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Create Album -->
|
<!-- Create Album -->
|
||||||
<Button onclick={() => createAlbumAndRedirect()} size="small" variant="ghost" color="secondary">
|
<Button
|
||||||
<Icon path={mdiPlusBoxOutline} />
|
leadingIcon={mdiPlusBoxOutline}
|
||||||
|
onclick={() => createAlbumAndRedirect()}
|
||||||
|
size="small"
|
||||||
|
variant="ghost"
|
||||||
|
color="secondary"
|
||||||
|
>
|
||||||
<p class="hidden md:block">{$t('create_album')}</p>
|
<p class="hidden md:block">{$t('create_album')}</p>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
@ -190,12 +194,24 @@
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<!-- Cover/List Display Toggle -->
|
<!-- Cover/List Display Toggle -->
|
||||||
<Button onclick={() => handleChangeListMode()} size="small" variant="ghost" color="secondary">
|
{#if $albumViewSettings.view === AlbumViewMode.List}
|
||||||
{#if $albumViewSettings.view === AlbumViewMode.List}
|
<Button
|
||||||
<Icon path={mdiViewGridOutline} />
|
leadingIcon={mdiViewGridOutline}
|
||||||
|
onclick={() => handleChangeListMode()}
|
||||||
|
size="small"
|
||||||
|
variant="ghost"
|
||||||
|
color="secondary"
|
||||||
|
>
|
||||||
<Text class="hidden md:block">{$t('covers')}</Text>
|
<Text class="hidden md:block">{$t('covers')}</Text>
|
||||||
{:else}
|
</Button>
|
||||||
<Icon path={mdiFormatListBulletedSquare} size="18" />
|
{:else}
|
||||||
|
<Button
|
||||||
|
leadingIcon={mdiFormatListBulletedSquare}
|
||||||
|
onclick={() => handleChangeListMode()}
|
||||||
|
size="small"
|
||||||
|
variant="ghost"
|
||||||
|
color="secondary"
|
||||||
|
>
|
||||||
<Text class="hidden md:block">{$t('list')}</Text>
|
<Text class="hidden md:block">{$t('list')}</Text>
|
||||||
{/if}
|
</Button>
|
||||||
</Button>
|
{/if}
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
import { clickOutside } from '$lib/actions/click-outside';
|
import { clickOutside } from '$lib/actions/click-outside';
|
||||||
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
||||||
import SkipLink from '$lib/components/elements/buttons/skip-link.svelte';
|
import SkipLink from '$lib/components/elements/buttons/skip-link.svelte';
|
||||||
import Icon from '$lib/components/elements/icon.svelte';
|
|
||||||
import HelpAndFeedbackModal from '$lib/components/shared-components/help-and-feedback-modal.svelte';
|
import HelpAndFeedbackModal from '$lib/components/shared-components/help-and-feedback-modal.svelte';
|
||||||
import ImmichLogo from '$lib/components/shared-components/immich-logo.svelte';
|
import ImmichLogo from '$lib/components/shared-components/immich-logo.svelte';
|
||||||
import SearchBar from '$lib/components/shared-components/search-bar/search-bar.svelte';
|
import SearchBar from '$lib/components/shared-components/search-bar/search-bar.svelte';
|
||||||
|
@ -99,11 +98,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if !page.url.pathname.includes('/admin') && showUploadButton}
|
{#if !page.url.pathname.includes('/admin') && showUploadButton}
|
||||||
<Button onclick={onUploadClick} class="hidden lg:block" variant="ghost" color="secondary">
|
<Button
|
||||||
<div class="flex gap-2">
|
leadingIcon={mdiTrayArrowUp}
|
||||||
<Icon path={mdiTrayArrowUp} size="1.5em" />
|
onclick={onUploadClick}
|
||||||
<span>{$t('upload')}</span>
|
class="hidden lg:flex"
|
||||||
</div>
|
variant="ghost"
|
||||||
|
color="secondary"
|
||||||
|
>{$t('upload')}
|
||||||
</Button>
|
</Button>
|
||||||
<CircleIconButton
|
<CircleIconButton
|
||||||
onclick={onUploadClick}
|
onclick={onUploadClick}
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
updatePerson,
|
updatePerson,
|
||||||
type PersonResponseDto,
|
type PersonResponseDto,
|
||||||
} from '@immich/sdk';
|
} from '@immich/sdk';
|
||||||
import { Button, Text } from '@immich/ui';
|
import { Button } from '@immich/ui';
|
||||||
import { mdiAccountOff, mdiEyeOutline } from '@mdi/js';
|
import { mdiAccountOff, mdiEyeOutline } from '@mdi/js';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
|
@ -392,10 +392,13 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Button onclick={() => (selectHidden = !selectHidden)} size="small" variant="ghost" color="secondary">
|
<Button
|
||||||
<Icon path={mdiEyeOutline} />
|
leadingIcon={mdiEyeOutline}
|
||||||
<Text>{$t('show_and_hide_people')}</Text>
|
onclick={() => (selectHidden = !selectHidden)}
|
||||||
</Button>
|
size="small"
|
||||||
|
variant="ghost"
|
||||||
|
color="secondary">{$t('show_and_hide_people')}</Button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import empty2Url from '$lib/assets/empty-2.svg';
|
import empty2Url from '$lib/assets/empty-2.svg';
|
||||||
import Albums from '$lib/components/album-page/albums-list.svelte';
|
import Albums from '$lib/components/album-page/albums-list.svelte';
|
||||||
import Icon from '$lib/components/elements/icon.svelte';
|
|
||||||
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
||||||
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
|
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
|
||||||
import UserAvatar from '$lib/components/shared-components/user-avatar.svelte';
|
import UserAvatar from '$lib/components/shared-components/user-avatar.svelte';
|
||||||
|
@ -15,7 +14,7 @@
|
||||||
type AlbumViewSettings,
|
type AlbumViewSettings,
|
||||||
} from '$lib/stores/preferences.store';
|
} from '$lib/stores/preferences.store';
|
||||||
import { createAlbumAndRedirect } from '$lib/utils/album-utils';
|
import { createAlbumAndRedirect } from '$lib/utils/album-utils';
|
||||||
import { Button, HStack } from '@immich/ui';
|
import { Button, HStack, Text } from '@immich/ui';
|
||||||
import { mdiLink, mdiPlusBoxOutline } from '@mdi/js';
|
import { mdiLink, mdiPlusBoxOutline } from '@mdi/js';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
|
@ -40,14 +39,17 @@
|
||||||
<UserPageLayout title={data.meta.title}>
|
<UserPageLayout title={data.meta.title}>
|
||||||
{#snippet buttons()}
|
{#snippet buttons()}
|
||||||
<HStack gap={0}>
|
<HStack gap={0}>
|
||||||
<Button onclick={() => createAlbumAndRedirect()} size="small" variant="ghost" color="secondary">
|
<Button
|
||||||
<Icon path={mdiPlusBoxOutline} class="shrink-0" />
|
leadingIcon={mdiPlusBoxOutline}
|
||||||
<span class="leading-none max-sm:text-xs">{$t('create_album')}</span>
|
onclick={() => createAlbumAndRedirect()}
|
||||||
|
size="small"
|
||||||
|
variant="ghost"
|
||||||
|
color="secondary"
|
||||||
|
>
|
||||||
|
<Text class="hidden md:block">{$t('create_album')}</Text>
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button leadingIcon={mdiLink} href={AppRoute.SHARED_LINKS} size="small" variant="ghost" color="secondary">
|
||||||
<Button href={AppRoute.SHARED_LINKS} size="small" variant="ghost" color="secondary">
|
<Text class="hidden md:block">{$t('shared_links')}</Text>
|
||||||
<Icon path={mdiLink} class="shrink-0" />
|
|
||||||
<span class="leading-none max-sm:text-xs">{$t('shared_links')}</span>
|
|
||||||
</Button>
|
</Button>
|
||||||
</HStack>
|
</HStack>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/stores';
|
||||||
import SkipLink from '$lib/components/elements/buttons/skip-link.svelte';
|
import SkipLink from '$lib/components/elements/buttons/skip-link.svelte';
|
||||||
import Icon from '$lib/components/elements/icon.svelte';
|
|
||||||
import UserPageLayout, { headerId } from '$lib/components/layouts/user-page-layout.svelte';
|
import UserPageLayout, { headerId } from '$lib/components/layouts/user-page-layout.svelte';
|
||||||
import AssetGrid from '$lib/components/photos-page/asset-grid.svelte';
|
import AssetGrid from '$lib/components/photos-page/asset-grid.svelte';
|
||||||
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
|
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
|
||||||
|
@ -169,18 +168,15 @@
|
||||||
|
|
||||||
{#snippet buttons()}
|
{#snippet buttons()}
|
||||||
<HStack>
|
<HStack>
|
||||||
<Button onclick={handleCreate} size="small" variant="ghost" color="secondary">
|
<Button leadingIcon={mdiPlus} onclick={handleCreate} size="small" variant="ghost" color="secondary">
|
||||||
<Icon path={mdiPlus} />
|
<Text class="hidden md:block">{$t('create_tag')}</Text>
|
||||||
<p class="hidden md:block">{$t('create_tag')}</p>
|
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
{#if pathSegments.length > 0 && tag}
|
{#if pathSegments.length > 0 && tag}
|
||||||
<Button onclick={handleEdit} size="small" variant="ghost" color="secondary">
|
<Button leadingIcon={mdiPencil} onclick={handleEdit} size="small" variant="ghost" color="secondary">
|
||||||
<Icon path={mdiPencil} size="18" />
|
|
||||||
<Text class="hidden md:block">{$t('edit_tag')}</Text>
|
<Text class="hidden md:block">{$t('edit_tag')}</Text>
|
||||||
</Button>
|
</Button>
|
||||||
<Button onclick={handleDelete} size="small" variant="ghost" color="secondary">
|
<Button leadingIcon={mdiTrashCanOutline} onclick={handleDelete} size="small" variant="ghost" color="secondary">
|
||||||
<Icon path={mdiTrashCanOutline} />
|
|
||||||
<Text class="hidden md:block">{$t('delete_tag')}</Text>
|
<Text class="hidden md:block">{$t('delete_tag')}</Text>
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import empty3Url from '$lib/assets/empty-3.svg';
|
import empty3Url from '$lib/assets/empty-3.svg';
|
||||||
import Icon from '$lib/components/elements/icon.svelte';
|
|
||||||
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
||||||
import DeleteAssets from '$lib/components/photos-page/actions/delete-assets.svelte';
|
import DeleteAssets from '$lib/components/photos-page/actions/delete-assets.svelte';
|
||||||
import RestoreAssets from '$lib/components/photos-page/actions/restore-assets.svelte';
|
import RestoreAssets from '$lib/components/photos-page/actions/restore-assets.svelte';
|
||||||
|
@ -21,7 +20,7 @@
|
||||||
import { handlePromiseError } from '$lib/utils';
|
import { handlePromiseError } from '$lib/utils';
|
||||||
import { handleError } from '$lib/utils/handle-error';
|
import { handleError } from '$lib/utils/handle-error';
|
||||||
import { emptyTrash, restoreTrash } from '@immich/sdk';
|
import { emptyTrash, restoreTrash } from '@immich/sdk';
|
||||||
import { Button, HStack } from '@immich/ui';
|
import { Button, HStack, Text } from '@immich/ui';
|
||||||
import { mdiDeleteForeverOutline, mdiHistory } from '@mdi/js';
|
import { mdiDeleteForeverOutline, mdiHistory } from '@mdi/js';
|
||||||
import { onDestroy } from 'svelte';
|
import { onDestroy } from 'svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
|
@ -115,24 +114,24 @@
|
||||||
{#snippet buttons()}
|
{#snippet buttons()}
|
||||||
<HStack gap={0}>
|
<HStack gap={0}>
|
||||||
<Button
|
<Button
|
||||||
|
leadingIcon={mdiHistory}
|
||||||
onclick={handleRestoreTrash}
|
onclick={handleRestoreTrash}
|
||||||
disabled={assetInteraction.selectionActive}
|
disabled={assetInteraction.selectionActive}
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<Icon path={mdiHistory} />
|
<Text class="hidden md:block">{$t('restore_all')}</Text>
|
||||||
{$t('restore_all')}
|
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
leadingIcon={mdiDeleteForeverOutline}
|
||||||
onclick={() => handleEmptyTrash()}
|
onclick={() => handleEmptyTrash()}
|
||||||
disabled={assetInteraction.selectionActive}
|
disabled={assetInteraction.selectionActive}
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
size="small"
|
size="small"
|
||||||
>
|
>
|
||||||
<Icon path={mdiDeleteForeverOutline} />
|
<Text class="hidden md:block">{$t('empty_trash')}</Text>
|
||||||
{$t('empty_trash')}
|
|
||||||
</Button>
|
</Button>
|
||||||
</HStack>
|
</HStack>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
||||||
import Icon from '$lib/components/elements/icon.svelte';
|
|
||||||
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
||||||
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
|
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
|
||||||
import DuplicatesModal from '$lib/components/shared-components/duplicates-modal.svelte';
|
import DuplicatesModal from '$lib/components/shared-components/duplicates-modal.svelte';
|
||||||
|
@ -17,7 +16,7 @@
|
||||||
import { handleError } from '$lib/utils/handle-error';
|
import { handleError } from '$lib/utils/handle-error';
|
||||||
import type { AssetResponseDto } from '@immich/sdk';
|
import type { AssetResponseDto } from '@immich/sdk';
|
||||||
import { deleteAssets, updateAssets } from '@immich/sdk';
|
import { deleteAssets, updateAssets } from '@immich/sdk';
|
||||||
import { Button, HStack, IconButton } from '@immich/ui';
|
import { Button, HStack, IconButton, Text } from '@immich/ui';
|
||||||
import { mdiCheckOutline, mdiInformationOutline, mdiKeyboard, mdiTrashCanOutline } from '@mdi/js';
|
import { mdiCheckOutline, mdiInformationOutline, mdiKeyboard, mdiTrashCanOutline } from '@mdi/js';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
|
@ -164,18 +163,24 @@
|
||||||
{#snippet buttons()}
|
{#snippet buttons()}
|
||||||
<HStack gap={0}>
|
<HStack gap={0}>
|
||||||
<Button
|
<Button
|
||||||
|
leadingIcon={mdiTrashCanOutline}
|
||||||
onclick={() => handleDeduplicateAll()}
|
onclick={() => handleDeduplicateAll()}
|
||||||
disabled={!hasDuplicates}
|
disabled={!hasDuplicates}
|
||||||
size="small"
|
size="small"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
>
|
>
|
||||||
<Icon path={mdiTrashCanOutline} />
|
<Text class="hidden md:block">{$t('deduplicate_all')}</Text>
|
||||||
{$t('deduplicate_all')}
|
|
||||||
</Button>
|
</Button>
|
||||||
<Button onclick={() => handleKeepAll()} disabled={!hasDuplicates} size="small" variant="ghost" color="secondary">
|
<Button
|
||||||
<Icon path={mdiCheckOutline} />
|
leadingIcon={mdiCheckOutline}
|
||||||
{$t('keep_all')}
|
onclick={() => handleKeepAll()}
|
||||||
|
disabled={!hasDuplicates}
|
||||||
|
size="small"
|
||||||
|
variant="ghost"
|
||||||
|
color="secondary"
|
||||||
|
>
|
||||||
|
<Text class="hidden md:block">{$t('keep_all')}</Text>
|
||||||
</Button>
|
</Button>
|
||||||
<IconButton
|
<IconButton
|
||||||
shape="round"
|
shape="round"
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import JobsPanel from '$lib/components/admin-page/jobs/jobs-panel.svelte';
|
import JobsPanel from '$lib/components/admin-page/jobs/jobs-panel.svelte';
|
||||||
import Icon from '$lib/components/elements/icon.svelte';
|
|
||||||
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
||||||
import Combobox, { type ComboBoxOption } from '$lib/components/shared-components/combobox.svelte';
|
import Combobox, { type ComboBoxOption } from '$lib/components/shared-components/combobox.svelte';
|
||||||
import ConfirmDialog from '$lib/components/shared-components/dialog/confirm-dialog.svelte';
|
import ConfirmDialog from '$lib/components/shared-components/dialog/confirm-dialog.svelte';
|
||||||
|
@ -12,7 +11,7 @@
|
||||||
import { asyncTimeout } from '$lib/utils';
|
import { asyncTimeout } from '$lib/utils';
|
||||||
import { handleError } from '$lib/utils/handle-error';
|
import { handleError } from '$lib/utils/handle-error';
|
||||||
import { createJob, getAllJobsStatus, ManualJobName, type AllJobStatusResponseDto } from '@immich/sdk';
|
import { createJob, getAllJobsStatus, ManualJobName, type AllJobStatusResponseDto } from '@immich/sdk';
|
||||||
import { Button, HStack } from '@immich/ui';
|
import { Button, HStack, Text } from '@immich/ui';
|
||||||
import { mdiCog, mdiPlus } from '@mdi/js';
|
import { mdiCog, mdiPlus } from '@mdi/js';
|
||||||
import { onDestroy, onMount } from 'svelte';
|
import { onDestroy, onMount } from 'svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
|
@ -72,13 +71,17 @@
|
||||||
<UserPageLayout title={data.meta.title} admin>
|
<UserPageLayout title={data.meta.title} admin>
|
||||||
{#snippet buttons()}
|
{#snippet buttons()}
|
||||||
<HStack gap={0}>
|
<HStack gap={0}>
|
||||||
<Button onclick={() => (isOpen = true)} size="small" variant="ghost" color="secondary">
|
<Button leadingIcon={mdiPlus} onclick={() => (isOpen = true)} size="small" variant="ghost" color="secondary">
|
||||||
<Icon path={mdiPlus} size="18" />
|
<Text class="hidden md:block">{$t('admin.create_job')}</Text>
|
||||||
{$t('admin.create_job')}
|
|
||||||
</Button>
|
</Button>
|
||||||
<Button href="{AppRoute.ADMIN_SETTINGS}?isOpen=job" size="small" variant="ghost" color="secondary">
|
<Button
|
||||||
<Icon path={mdiCog} size="18" />
|
leadingIcon={mdiCog}
|
||||||
{$t('admin.manage_concurrency')}
|
href="{AppRoute.ADMIN_SETTINGS}?isOpen=job"
|
||||||
|
size="small"
|
||||||
|
variant="ghost"
|
||||||
|
color="secondary"
|
||||||
|
>
|
||||||
|
<Text class="hidden md:block">{$t('admin.manage_concurrency')}</Text>
|
||||||
</Button>
|
</Button>
|
||||||
</HStack>
|
</HStack>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
type LibraryStatsResponseDto,
|
type LibraryStatsResponseDto,
|
||||||
type UserResponseDto,
|
type UserResponseDto,
|
||||||
} from '@immich/sdk';
|
} from '@immich/sdk';
|
||||||
import { Button } from '@immich/ui';
|
import { Button, Text } from '@immich/ui';
|
||||||
import { mdiDatabase, mdiDotsVertical, mdiPlusBoxOutline, mdiSync } from '@mdi/js';
|
import { mdiDatabase, mdiDotsVertical, mdiPlusBoxOutline, mdiSync } from '@mdi/js';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
|
@ -220,18 +220,18 @@
|
||||||
{#snippet buttons()}
|
{#snippet buttons()}
|
||||||
<div class="flex justify-end gap-2">
|
<div class="flex justify-end gap-2">
|
||||||
{#if libraries.length > 0}
|
{#if libraries.length > 0}
|
||||||
<Button onclick={handleScanAll} size="small" variant="ghost" color="secondary">
|
<Button leadingIcon={mdiSync} onclick={handleScanAll} size="small" variant="ghost" color="secondary">
|
||||||
<div class="flex gap-1 text-sm">
|
<Text class="hidden md:block">{$t('scan_all_libraries')}</Text>
|
||||||
<Icon path={mdiSync} size="18" />
|
|
||||||
<span>{$t('scan_all_libraries')}</span>
|
|
||||||
</div>
|
|
||||||
</Button>
|
</Button>
|
||||||
{/if}
|
{/if}
|
||||||
<Button onclick={() => (toCreateLibrary = true)} size="small" variant="ghost" color="secondary">
|
<Button
|
||||||
<div class="flex gap-1 text-sm">
|
leadingIcon={mdiPlusBoxOutline}
|
||||||
<Icon path={mdiPlusBoxOutline} size="18" />
|
onclick={() => (toCreateLibrary = true)}
|
||||||
<span>{$t('create_library')}</span>
|
size="small"
|
||||||
</div>
|
variant="ghost"
|
||||||
|
color="secondary"
|
||||||
|
>
|
||||||
|
<Text class="hidden md:block">{$t('create_library')}</Text>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import empty4Url from '$lib/assets/empty-4.svg';
|
import empty4Url from '$lib/assets/empty-4.svg';
|
||||||
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
||||||
import Icon from '$lib/components/elements/icon.svelte';
|
|
||||||
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
||||||
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
|
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
|
||||||
import {
|
import {
|
||||||
|
@ -14,7 +13,7 @@
|
||||||
import { downloadBlob } from '$lib/utils/asset-utils';
|
import { downloadBlob } from '$lib/utils/asset-utils';
|
||||||
import { handleError } from '$lib/utils/handle-error';
|
import { handleError } from '$lib/utils/handle-error';
|
||||||
import { fixAuditFiles, getAuditFiles, getFileChecksums, type FileReportItemDto } from '@immich/sdk';
|
import { fixAuditFiles, getAuditFiles, getFileChecksums, type FileReportItemDto } from '@immich/sdk';
|
||||||
import { Button, HStack } from '@immich/ui';
|
import { Button, HStack, Text } from '@immich/ui';
|
||||||
import { mdiCheckAll, mdiContentCopy, mdiDownload, mdiRefresh, mdiWrench } from '@mdi/js';
|
import { mdiCheckAll, mdiContentCopy, mdiDownload, mdiRefresh, mdiWrench } from '@mdi/js';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
import type { PageData } from './$types';
|
import type { PageData } from './$types';
|
||||||
|
@ -187,38 +186,37 @@
|
||||||
{#snippet buttons()}
|
{#snippet buttons()}
|
||||||
<HStack gap={0}>
|
<HStack gap={0}>
|
||||||
<Button
|
<Button
|
||||||
|
leadingIcon={mdiWrench}
|
||||||
onclick={() => handleRepair()}
|
onclick={() => handleRepair()}
|
||||||
disabled={matches.length === 0 || repairing}
|
disabled={matches.length === 0 || repairing}
|
||||||
size="small"
|
size="small"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
>
|
>
|
||||||
<Icon path={mdiWrench} />
|
<Text class="hidden md:block">{$t('admin.repair_all')}</Text>
|
||||||
{$t('admin.repair_all')}
|
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
leadingIcon={mdiCheckAll}
|
||||||
onclick={() => handleCheckAll()}
|
onclick={() => handleCheckAll()}
|
||||||
disabled={extras.length === 0 || checking}
|
disabled={extras.length === 0 || checking}
|
||||||
size="small"
|
size="small"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
>
|
>
|
||||||
<Icon path={mdiCheckAll} />
|
<Text class="hidden md:block">{$t('admin.check_all')}</Text>
|
||||||
{$t('admin.check_all')}
|
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
|
leadingIcon={mdiDownload}
|
||||||
onclick={() => handleDownload()}
|
onclick={() => handleDownload()}
|
||||||
disabled={extras.length + orphans.length === 0}
|
disabled={extras.length + orphans.length === 0}
|
||||||
size="small"
|
size="small"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
>
|
>
|
||||||
<Icon path={mdiDownload} />
|
<Text class="hidden md:block">{$t('export')}</Text>
|
||||||
{$t('export')}
|
|
||||||
</Button>
|
</Button>
|
||||||
<Button onclick={() => handleRefresh()} size="small" variant="ghost" color="secondary">
|
<Button leadingIcon={mdiRefresh} onclick={() => handleRefresh()} size="small" variant="ghost" color="secondary">
|
||||||
<Icon path={mdiRefresh} />
|
<Text class="hidden md:block">{$t('refresh')}</Text>
|
||||||
{$t('refresh')}
|
|
||||||
</Button>
|
</Button>
|
||||||
</HStack>
|
</HStack>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|
|
@ -17,8 +17,7 @@
|
||||||
import ThemeSettings from '$lib/components/admin-page/settings/theme/theme-settings.svelte';
|
import ThemeSettings from '$lib/components/admin-page/settings/theme/theme-settings.svelte';
|
||||||
import TrashSettings from '$lib/components/admin-page/settings/trash-settings/trash-settings.svelte';
|
import TrashSettings from '$lib/components/admin-page/settings/trash-settings/trash-settings.svelte';
|
||||||
import UserSettings from '$lib/components/admin-page/settings/user-settings/user-settings.svelte';
|
import UserSettings from '$lib/components/admin-page/settings/user-settings/user-settings.svelte';
|
||||||
import { Button, HStack } from '@immich/ui';
|
import { Button, Text, HStack, Alert } from '@immich/ui';
|
||||||
import Icon from '$lib/components/elements/icon.svelte';
|
|
||||||
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
||||||
import SettingAccordionState from '$lib/components/shared-components/settings/setting-accordion-state.svelte';
|
import SettingAccordionState from '$lib/components/shared-components/settings/setting-accordion-state.svelte';
|
||||||
import SettingAccordion from '$lib/components/shared-components/settings/setting-accordion.svelte';
|
import SettingAccordion from '$lib/components/shared-components/settings/setting-accordion.svelte';
|
||||||
|
@ -29,7 +28,6 @@
|
||||||
import { downloadBlob } from '$lib/utils/asset-utils';
|
import { downloadBlob } from '$lib/utils/asset-utils';
|
||||||
import {
|
import {
|
||||||
mdiAccountOutline,
|
mdiAccountOutline,
|
||||||
mdiAlert,
|
|
||||||
mdiBackupRestore,
|
mdiBackupRestore,
|
||||||
mdiBellOutline,
|
mdiBellOutline,
|
||||||
mdiBookshelf,
|
mdiBookshelf,
|
||||||
|
@ -243,68 +241,64 @@
|
||||||
|
|
||||||
<input bind:this={inputElement} type="file" accept=".json" style="display: none" onchange={uploadConfig} />
|
<input bind:this={inputElement} type="file" accept=".json" style="display: none" onchange={uploadConfig} />
|
||||||
|
|
||||||
<div class="h-svh flex flex-col overflow-hidden">
|
<UserPageLayout title={data.meta.title} admin>
|
||||||
{#if $featureFlags.configFile}
|
{#snippet buttons()}
|
||||||
<div class="flex flex-row items-center gap-2 bg-gray-100 p-3 dark:bg-gray-800">
|
<HStack gap={1}>
|
||||||
<Icon path={mdiAlert} class="text-yellow-400" size={18} />
|
<div class="hidden lg:block">
|
||||||
<h2 class="text-md text-immich-primary dark:text-immich-dark-primary">
|
<SearchBar placeholder={$t('search_settings')} bind:name={searchQuery} showLoadingSpinner={false} />
|
||||||
{$t('admin.config_set_by_file')}
|
</div>
|
||||||
</h2>
|
<Button
|
||||||
</div>
|
leadingIcon={mdiContentCopy}
|
||||||
{/if}
|
onclick={() => copyToClipboard(JSON.stringify(config, jsonReplacer, 2))}
|
||||||
|
size="small"
|
||||||
<UserPageLayout title={data.meta.title} admin>
|
variant="ghost"
|
||||||
{#snippet buttons()}
|
color="secondary"
|
||||||
<HStack gap={1}>
|
>
|
||||||
<div class="hidden lg:block">
|
<Text class="hidden md:block">{$t('copy_to_clipboard')}</Text>
|
||||||
<SearchBar placeholder={$t('search_settings')} bind:name={searchQuery} showLoadingSpinner={false} />
|
</Button>
|
||||||
</div>
|
<Button leadingIcon={mdiDownload} onclick={() => downloadConfig()} size="small" variant="ghost" color="secondary">
|
||||||
|
<Text class="hidden md:block">{$t('export_as_json')}</Text>
|
||||||
|
</Button>
|
||||||
|
{#if !$featureFlags.configFile}
|
||||||
<Button
|
<Button
|
||||||
onclick={() => copyToClipboard(JSON.stringify(config, jsonReplacer, 2))}
|
leadingIcon={mdiUpload}
|
||||||
|
onclick={() => inputElement?.click()}
|
||||||
size="small"
|
size="small"
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
>
|
>
|
||||||
<Icon path={mdiContentCopy} />
|
<Text class="hidden md:block">{$t('import_from_json')}</Text>
|
||||||
{$t('copy_to_clipboard')}
|
|
||||||
</Button>
|
</Button>
|
||||||
<Button onclick={() => downloadConfig()} size="small" variant="ghost" color="secondary">
|
{/if}
|
||||||
<Icon path={mdiDownload} />
|
</HStack>
|
||||||
{$t('export_as_json')}
|
{/snippet}
|
||||||
</Button>
|
|
||||||
{#if !$featureFlags.configFile}
|
|
||||||
<Button onclick={() => inputElement?.click()} size="small" variant="ghost" color="secondary">
|
|
||||||
<Icon path={mdiUpload} />
|
|
||||||
{$t('import_from_json')}
|
|
||||||
</Button>
|
|
||||||
{/if}
|
|
||||||
</HStack>
|
|
||||||
{/snippet}
|
|
||||||
|
|
||||||
<AdminSettings bind:config bind:this={adminSettingElement}>
|
<AdminSettings bind:config bind:this={adminSettingElement}>
|
||||||
{#snippet children({ savedConfig, defaultConfig })}
|
{#snippet children({ savedConfig, defaultConfig })}
|
||||||
<section id="setting-content" class="flex place-content-center sm:mx-4">
|
<section id="setting-content" class="flex place-content-center sm:mx-4">
|
||||||
<section class="w-full pb-28 sm:w-5/6 md:w-[896px]">
|
<section class="w-full pb-28 sm:w-5/6 md:w-[896px]">
|
||||||
<div class="block lg:hidden">
|
{#if $featureFlags.configFile}
|
||||||
<SearchBar placeholder={$t('search_settings')} bind:name={searchQuery} showLoadingSpinner={false} />
|
<Alert color="warning" class="text-dark my-4" title={$t('admin.config_set_by_file')} />
|
||||||
</div>
|
{/if}
|
||||||
<SettingAccordionState queryParam={QueryParameter.IS_OPEN}>
|
<div class="block lg:hidden">
|
||||||
{#each filteredSettings as { component: Component, title, subtitle, key, icon } (key)}
|
<SearchBar placeholder={$t('search_settings')} bind:name={searchQuery} showLoadingSpinner={false} />
|
||||||
<SettingAccordion {title} {subtitle} {key} {icon}>
|
</div>
|
||||||
<Component
|
<SettingAccordionState queryParam={QueryParameter.IS_OPEN}>
|
||||||
onSave={(config) => adminSettingElement?.handleSave(config)}
|
{#each filteredSettings as { component: Component, title, subtitle, key, icon } (key)}
|
||||||
onReset={(options) => adminSettingElement?.handleReset(options)}
|
<SettingAccordion {title} {subtitle} {key} {icon}>
|
||||||
disabled={$featureFlags.configFile}
|
<Component
|
||||||
bind:config
|
onSave={(config) => adminSettingElement?.handleSave(config)}
|
||||||
{defaultConfig}
|
onReset={(options) => adminSettingElement?.handleReset(options)}
|
||||||
{savedConfig}
|
disabled={$featureFlags.configFile}
|
||||||
/>
|
bind:config
|
||||||
</SettingAccordion>
|
{defaultConfig}
|
||||||
{/each}
|
{savedConfig}
|
||||||
</SettingAccordionState>
|
/>
|
||||||
</section>
|
</SettingAccordion>
|
||||||
|
{/each}
|
||||||
|
</SettingAccordionState>
|
||||||
</section>
|
</section>
|
||||||
{/snippet}
|
</section>
|
||||||
</AdminSettings>
|
{/snippet}
|
||||||
</UserPageLayout>
|
</AdminSettings>
|
||||||
</div>
|
</UserPageLayout>
|
||||||
|
|
Loading…
Add table
Reference in a new issue