0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-03-25 02:41:37 -05:00

refactor: replace link-button component with immich-ui buttons (#15374)

* refactor: replace link-button component with immich-ui buttons

* minor styling tweak

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Jason Rasmussen 2025-01-16 11:03:04 -05:00 committed by GitHub
parent 378bd3c993
commit 3a2bf91889
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 385 additions and 383 deletions

View file

@ -26,7 +26,7 @@
:root { :root {
/* light */ /* light */
--immich-ui-primary: 66 80 175; --immich-ui-primary: 66 80 175;
--immich-ui-dark: 0 0 0; --immich-ui-dark: 58 58 58;
--immich-ui-light: 255 255 255; --immich-ui-light: 255 255 255;
--immich-ui-success: 34 197 94; --immich-ui-success: 34 197 94;
--immich-ui-danger: 180 0 0; --immich-ui-danger: 180 0 0;

View file

@ -1,15 +1,30 @@
<script lang="ts"> <script lang="ts">
import LinkButton from '$lib/components/elements/buttons/link-button.svelte';
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 Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import SearchBar from '$lib/components/elements/search-bar.svelte';
import { import {
AlbumFilter, AlbumFilter,
AlbumSortBy,
AlbumGroupBy, AlbumGroupBy,
AlbumSortBy,
AlbumViewMode, AlbumViewMode,
albumViewSettings, albumViewSettings,
SortOrder, SortOrder,
} from '$lib/stores/preferences.store'; } from '$lib/stores/preferences.store';
import {
type AlbumGroupOptionMetadata,
type AlbumSortOptionMetadata,
collapseAllAlbumGroups,
createAlbumAndRedirect,
expandAllAlbumGroups,
findFilterOption,
findGroupOptionMetadata,
findSortOptionMetadata,
getSelectedAlbumGroupOption,
groupOptionsMetadata,
sortOptionsMetadata,
} from '$lib/utils/album-utils';
import { Button, IconButton, Text } from '@immich/ui';
import { import {
mdiArrowDownThin, mdiArrowDownThin,
mdiArrowUpThin, mdiArrowUpThin,
@ -22,21 +37,8 @@
mdiUnfoldMoreHorizontal, mdiUnfoldMoreHorizontal,
mdiViewGridOutline, mdiViewGridOutline,
} from '@mdi/js'; } from '@mdi/js';
import {
type AlbumGroupOptionMetadata,
type AlbumSortOptionMetadata,
findGroupOptionMetadata,
findFilterOption,
findSortOptionMetadata,
getSelectedAlbumGroupOption,
groupOptionsMetadata,
sortOptionsMetadata,
} from '$lib/utils/album-utils';
import SearchBar from '$lib/components/elements/search-bar.svelte';
import GroupTab from '$lib/components/elements/group-tab.svelte';
import { createAlbumAndRedirect, collapseAllAlbumGroups, expandAllAlbumGroups } from '$lib/utils/album-utils';
import { fly } from 'svelte/transition';
import { t } from 'svelte-i18n'; import { t } from 'svelte-i18n';
import { fly } from 'svelte/transition';
interface Props { interface Props {
albumGroups: string[]; albumGroups: string[];
@ -127,12 +129,10 @@
</div> </div>
<!-- Create Album --> <!-- Create Album -->
<LinkButton onclick={() => createAlbumAndRedirect()}> <Button onclick={() => createAlbumAndRedirect()} size="small" variant="ghost" color="secondary">
<div class="flex place-items-center gap-2 text-sm"> <Icon path={mdiPlusBoxOutline} />
<Icon path={mdiPlusBoxOutline} size="18" /> <p class="hidden md:block">{$t('create_album')}</p>
<p class="hidden md:block">{$t('create_album')}</p> </Button>
</div>
</LinkButton>
<!-- Sort Albums --> <!-- Sort Albums -->
<Dropdown <Dropdown
@ -164,34 +164,38 @@
<!-- Expand Album Groups --> <!-- Expand Album Groups -->
<div class="hidden xl:flex gap-0"> <div class="hidden xl:flex gap-0">
<div class="block"> <div class="block">
<LinkButton title={$t('expand_all')} onclick={() => expandAllAlbumGroups()}> <IconButton
<div class="flex place-items-center gap-2 text-sm"> title={$t('expand_all')}
<Icon path={mdiUnfoldMoreHorizontal} size="18" /> onclick={() => expandAllAlbumGroups()}
</div> variant="ghost"
</LinkButton> color="secondary"
shape="round"
icon={mdiUnfoldMoreHorizontal}
/>
</div> </div>
<!-- Collapse Album Groups --> <!-- Collapse Album Groups -->
<div class="block"> <div class="block">
<LinkButton title={$t('collapse_all')} onclick={() => collapseAllAlbumGroups(albumGroups)}> <IconButton
<div class="flex place-items-center gap-2 text-sm"> title={$t('collapse_all')}
<Icon path={mdiUnfoldLessHorizontal} size="18" /> onclick={() => collapseAllAlbumGroups(albumGroups)}
</div> variant="ghost"
</LinkButton> color="secondary"
shape="round"
icon={mdiUnfoldLessHorizontal}
/>
</div> </div>
</div> </div>
</span> </span>
{/if} {/if}
<!-- Cover/List Display Toggle --> <!-- Cover/List Display Toggle -->
<LinkButton onclick={() => handleChangeListMode()}> <Button onclick={() => handleChangeListMode()} size="small" variant="ghost" color="secondary">
<div class="flex place-items-center gap-2 text-sm"> {#if $albumViewSettings.view === AlbumViewMode.List}
{#if $albumViewSettings.view === AlbumViewMode.List} <Icon path={mdiViewGridOutline} />
<Icon path={mdiViewGridOutline} size="18" /> <Text class="hidden md:block">{$t('covers')}</Text>
<p class="hidden md:block">{$t('covers')}</p> {:else}
{:else} <Icon path={mdiFormatListBulletedSquare} size="18" />
<Icon path={mdiFormatListBulletedSquare} size="18" /> <Text class="hidden md:block">{$t('list')}</Text>
<p class="hidden md:block">{$t('list')}</p> {/if}
{/if} </Button>
</div>
</LinkButton>

View file

@ -1,25 +0,0 @@
<script lang="ts" module>
export type Color = 'transparent-primary' | 'transparent-gray';
</script>
<script lang="ts">
import Button from '$lib/components/elements/buttons/button.svelte';
import type { Snippet } from 'svelte';
interface Props {
href?: string;
color?: Color;
children?: Snippet;
onclick?: (e: MouseEvent) => void;
title?: string;
disabled?: boolean;
fullwidth?: boolean;
class?: string;
}
let { color = 'transparent-gray', children, ...rest }: Props = $props();
</script>
<Button size="link" {color} shadow={false} rounded="lg" {...rest}>
{@render children?.()}
</Button>

View file

@ -11,14 +11,12 @@
</script> </script>
<script lang="ts" generics="T"> <script lang="ts" generics="T">
import Icon from './icon.svelte';
import { mdiCheck } from '@mdi/js';
import { isEqual } from 'lodash-es';
import LinkButton from './buttons/link-button.svelte';
import { clickOutside } from '$lib/actions/click-outside'; import { clickOutside } from '$lib/actions/click-outside';
import { Button, Text } from '@immich/ui';
import { mdiCheck } from '@mdi/js';
import { isEqual } from 'lodash-es';
import { fly } from 'svelte/transition'; import { fly } from 'svelte/transition';
import Icon from './icon.svelte';
interface Props { interface Props {
class?: string; class?: string;
@ -82,14 +80,12 @@
<div use:clickOutside={{ onOutclick: handleClickOutside, onEscape: handleClickOutside }}> <div use:clickOutside={{ onOutclick: handleClickOutside, onEscape: handleClickOutside }}>
<!-- BUTTON TITLE --> <!-- BUTTON TITLE -->
<LinkButton onclick={() => (showMenu = true)} fullwidth {title}> <Button onclick={() => (showMenu = true)} fullWidth {title} variant="ghost" color="secondary" size="small">
<div class="flex place-items-center gap-2 text-sm"> {#if renderedSelectedOption?.icon}
{#if renderedSelectedOption?.icon} <Icon path={renderedSelectedOption.icon} />
<Icon path={renderedSelectedOption.icon} size="18" /> {/if}
{/if} <Text class={hideTextOnSmallScreen ? 'hidden sm:block' : ''}>{renderedSelectedOption.title}</Text>
<p class={hideTextOnSmallScreen ? 'hidden sm:block' : ''}>{renderedSelectedOption.title}</p> </Button>
</div>
</LinkButton>
<!-- DROP DOWN MENU --> <!-- DROP DOWN MENU -->
{#if showMenu} {#if showMenu}
@ -108,7 +104,7 @@
> >
{#if isEqual(selectedOption, option)} {#if isEqual(selectedOption, option)}
<div class="text-immich-primary dark:text-immich-dark-primary"> <div class="text-immich-primary dark:text-immich-dark-primary">
<Icon path={mdiCheck} size="18" /> <Icon path={mdiCheck} />
</div> </div>
<p class="justify-self-start text-immich-primary dark:text-immich-dark-primary"> <p class="justify-self-start text-immich-primary dark:text-immich-dark-primary">
{renderedOption.title} {renderedOption.title}

View file

@ -1,13 +1,11 @@
<script lang="ts"> <script lang="ts">
import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte'; import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte';
import SettingSelect from '$lib/components/shared-components/settings/setting-select.svelte'; import SettingSelect from '$lib/components/shared-components/settings/setting-select.svelte';
import SettingSwitch from '$lib/components/shared-components/settings/setting-switch.svelte';
import type { MapSettings } from '$lib/stores/preferences.store'; import type { MapSettings } from '$lib/stores/preferences.store';
import { Button, Field, Stack, Switch } from '@immich/ui';
import { Duration } from 'luxon'; import { Duration } from 'luxon';
import { t } from 'svelte-i18n'; import { t } from 'svelte-i18n';
import { fly } from 'svelte/transition'; import { fly } from 'svelte/transition';
import Button from '../elements/buttons/button.svelte';
import LinkButton from '../elements/buttons/link-button.svelte';
import DateInput from '../elements/date-input.svelte'; import DateInput from '../elements/date-input.svelte';
interface Props { interface Props {
@ -16,7 +14,8 @@
onSave: (settings: MapSettings) => void; onSave: (settings: MapSettings) => void;
} }
let { settings = $bindable(), onClose, onSave }: Props = $props(); let { settings: initialValues, onClose, onSave }: Props = $props();
let settings = $state(initialValues);
let customDateRange = $state(!!settings.dateAfter || !!settings.dateBefore); let customDateRange = $state(!!settings.dateAfter || !!settings.dateBefore);
@ -26,90 +25,109 @@
}; };
</script> </script>
<FullScreenModal title={$t('map_settings')} {onClose}> <form {onsubmit}>
<form {onsubmit} class="flex flex-col gap-4 text-immich-primary dark:text-immich-dark-primary" id="map-settings-form"> <FullScreenModal title={$t('map_settings')} {onClose}>
<SettingSwitch title={$t('allow_dark_mode')} bind:checked={settings.allowDarkMode} /> <Stack gap={4}>
<SettingSwitch title={$t('only_favorites')} bind:checked={settings.onlyFavorites} /> <Field label={$t('allow_dark_mode')}>
<SettingSwitch title={$t('include_archived')} bind:checked={settings.includeArchived} /> <Switch bind:checked={settings.allowDarkMode} class="flex justify-between items-center text-sm" />
<SettingSwitch title={$t('include_shared_partner_assets')} bind:checked={settings.withPartners} /> </Field>
<SettingSwitch title={$t('include_shared_albums')} bind:checked={settings.withSharedAlbums} /> <Field label={$t('only_favorites')}>
{#if customDateRange} <Switch bind:checked={settings.onlyFavorites} class="flex justify-between items-center text-sm" />
<div in:fly={{ y: 10, duration: 200 }} class="flex flex-col gap-4"> </Field>
<div class="flex items-center justify-between gap-8"> <Field label={$t('include_archived')}>
<label class="immich-form-label shrink-0 text-sm" for="date-after">{$t('date_after')}</label> <Switch bind:checked={settings.includeArchived} class="flex justify-between items-center text-sm" />
<DateInput </Field>
class="immich-form-input w-40" <Field label={$t('include_shared_partner_assets')}>
type="date" <Switch bind:checked={settings.withPartners} class="flex justify-between items-center text-sm" />
id="date-after" </Field>
max={settings.dateBefore} <Field label={$t('include_shared_albums')}>
bind:value={settings.dateAfter} <Switch bind:checked={settings.withSharedAlbums} class="flex justify-between items-center text-sm" />
/> </Field>
</div>
<div class="flex items-center justify-between gap-8">
<label class="immich-form-label shrink-0 text-sm" for="date-before">{$t('date_before')}</label>
<DateInput class="immich-form-input w-40" type="date" id="date-before" bind:value={settings.dateBefore} />
</div>
<div class="flex justify-center text-xs">
<LinkButton
onclick={() => {
customDateRange = false;
settings.dateAfter = '';
settings.dateBefore = '';
}}
>
{$t('remove_custom_date_range')}
</LinkButton>
</div>
</div>
{:else}
<div in:fly={{ y: -10, duration: 200 }} class="flex flex-col gap-1">
<SettingSelect
label={$t('date_range')}
name="date-range"
bind:value={settings.relativeDate}
options={[
{
value: '',
text: $t('all'),
},
{
value: Duration.fromObject({ hours: 24 }).toISO() || '',
text: $t('past_durations.hours', { values: { hours: 24 } }),
},
{
value: Duration.fromObject({ days: 7 }).toISO() || '',
text: $t('past_durations.days', { values: { days: 7 } }),
},
{
value: Duration.fromObject({ days: 30 }).toISO() || '',
text: $t('past_durations.days', { values: { days: 30 } }),
},
{
value: Duration.fromObject({ years: 1 }).toISO() || '',
text: $t('past_durations.years', { values: { years: 1 } }),
},
{
value: Duration.fromObject({ years: 3 }).toISO() || '',
text: $t('past_durations.years', { values: { years: 3 } }),
},
]}
/>
<div class="text-xs">
<LinkButton
onclick={() => {
customDateRange = true;
settings.relativeDate = '';
}}
>
{$t('use_custom_date_range')}
</LinkButton>
</div>
</div>
{/if}
</form>
{#snippet stickyBottom()} {#if customDateRange}
<Button color="gray" size="sm" fullwidth onclick={onClose}>{$t('cancel')}</Button> <div in:fly={{ y: 10, duration: 200 }} class="flex flex-col gap-4">
<Button type="submit" size="sm" fullwidth form="map-settings-form">{$t('save')}</Button> <div class="flex items-center justify-between gap-8">
{/snippet} <label class="immich-form-label shrink-0 text-sm" for="date-after">{$t('date_after')}</label>
</FullScreenModal> <DateInput
class="immich-form-input w-40"
type="date"
id="date-after"
max={settings.dateBefore}
bind:value={settings.dateAfter}
/>
</div>
<div class="flex items-center justify-between gap-8">
<label class="immich-form-label shrink-0 text-sm" for="date-before">{$t('date_before')}</label>
<DateInput class="immich-form-input w-40" type="date" id="date-before" bind:value={settings.dateBefore} />
</div>
<div class="flex justify-center text-xs">
<Button
color="primary"
size="small"
variant="ghost"
onclick={() => {
customDateRange = false;
settings.dateAfter = '';
settings.dateBefore = '';
}}
>
{$t('remove_custom_date_range')}
</Button>
</div>
</div>
{:else}
<div in:fly={{ y: -10, duration: 200 }} class="flex flex-col gap-1">
<SettingSelect
label={$t('date_range')}
name="date-range"
bind:value={settings.relativeDate}
options={[
{
value: '',
text: $t('all'),
},
{
value: Duration.fromObject({ hours: 24 }).toISO() || '',
text: $t('past_durations.hours', { values: { hours: 24 } }),
},
{
value: Duration.fromObject({ days: 7 }).toISO() || '',
text: $t('past_durations.days', { values: { days: 7 } }),
},
{
value: Duration.fromObject({ days: 30 }).toISO() || '',
text: $t('past_durations.days', { values: { days: 30 } }),
},
{
value: Duration.fromObject({ years: 1 }).toISO() || '',
text: $t('past_durations.years', { values: { years: 1 } }),
},
{
value: Duration.fromObject({ years: 3 }).toISO() || '',
text: $t('past_durations.years', { values: { years: 3 } }),
},
]}
/>
<div class="text-xs">
<Button
color="primary"
size="small"
variant="ghost"
onclick={() => {
customDateRange = true;
settings.relativeDate = '';
}}
>
{$t('use_custom_date_range')}
</Button>
</div>
</div>
{/if}
</Stack>
{#snippet stickyBottom()}
<Button color="secondary" shape="round" fullWidth onclick={onClose}>{$t('cancel')}</Button>
<Button type="submit" shape="round" fullWidth>{$t('save')}</Button>
{/snippet}
</FullScreenModal>
</form>

View file

@ -1,21 +1,20 @@
<script lang="ts"> <script lang="ts">
import Button from '$lib/components/elements/buttons/button.svelte'; import Button from '$lib/components/elements/buttons/button.svelte';
import LinkButton from '$lib/components/elements/buttons/link-button.svelte'; import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte';
import Icon from '$lib/components/elements/icon.svelte'; import SettingSelect from '$lib/components/shared-components/settings/setting-select.svelte';
import { SettingInputFieldType } from '$lib/constants';
import { locale } from '$lib/stores/preferences.store';
import { serverConfig } from '$lib/stores/server-config.store'; import { serverConfig } from '$lib/stores/server-config.store';
import { copyToClipboard, makeSharedLinkUrl } from '$lib/utils'; import { copyToClipboard, makeSharedLinkUrl } from '$lib/utils';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { SharedLinkType, createSharedLink, updateSharedLink, type SharedLinkResponseDto } from '@immich/sdk'; import { SharedLinkType, createSharedLink, updateSharedLink, type SharedLinkResponseDto } from '@immich/sdk';
import { HStack, IconButton, Input } from '@immich/ui';
import { mdiContentCopy, mdiLink } from '@mdi/js'; import { mdiContentCopy, mdiLink } from '@mdi/js';
import { DateTime, Duration } from 'luxon';
import { t } from 'svelte-i18n';
import { NotificationType, notificationController } from '../notification/notification'; import { NotificationType, notificationController } from '../notification/notification';
import SettingInputField from '../settings/setting-input-field.svelte'; import SettingInputField from '../settings/setting-input-field.svelte';
import SettingSwitch from '../settings/setting-switch.svelte'; import SettingSwitch from '../settings/setting-switch.svelte';
import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte';
import { t } from 'svelte-i18n';
import { locale } from '$lib/stores/preferences.store';
import { DateTime, Duration } from 'luxon';
import SettingSelect from '$lib/components/shared-components/settings/setting-select.svelte';
import { SettingInputFieldType } from '$lib/constants';
interface Props { interface Props {
onClose: () => void; onClose: () => void;
@ -243,14 +242,18 @@
<Button size="sm" fullwidth onclick={handleCreateSharedLink}>{$t('create_link')}</Button> <Button size="sm" fullwidth onclick={handleCreateSharedLink}>{$t('create_link')}</Button>
{/if} {/if}
{:else} {:else}
<div class="flex w-full gap-2"> <HStack class="w-full">
<input class="immich-form-input w-full" bind:value={sharedLink} disabled /> <Input bind:value={sharedLink} disabled class="flex flex-row" />
<LinkButton onclick={() => (sharedLink ? copyToClipboard(sharedLink) : '')}> <IconButton
<div class="flex place-items-center gap-2 text-sm"> variant="ghost"
<Icon path={mdiContentCopy} ariaLabel={$t('copy_link_to_clipboard')} size="18" /> shape="round"
</div> color="secondary"
</LinkButton> size="giant"
</div> icon={mdiContentCopy}
onclick={() => (sharedLink ? copyToClipboard(sharedLink) : '')}
aria-label={$t('copy_link_to_clipboard')}
/>
</HStack>
{/if} {/if}
{/snippet} {/snippet}
</FullScreenModal> </FullScreenModal>

View file

@ -2,25 +2,25 @@
import { page } from '$app/state'; import { page } from '$app/state';
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 LinkButton from '$lib/components/elements/buttons/link-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 Icon from '$lib/components/elements/icon.svelte';
import HelpAndFeedbackModal from '$lib/components/shared-components/help-and-feedback-modal.svelte';
import ImmichLogo from '$lib/components/shared-components/immich-logo.svelte';
import SearchBar from '$lib/components/shared-components/search-bar/search-bar.svelte';
import { AppRoute } from '$lib/constants';
import { featureFlags } from '$lib/stores/server-config.store'; import { featureFlags } from '$lib/stores/server-config.store';
import { user } from '$lib/stores/user.store'; import { user } from '$lib/stores/user.store';
import { userInteraction } from '$lib/stores/user.svelte'; import { userInteraction } from '$lib/stores/user.svelte';
import { handleLogout } from '$lib/utils/auth'; import { handleLogout } from '$lib/utils/auth';
import { getAboutInfo, logout, type ServerAboutResponseDto } from '@immich/sdk'; import { getAboutInfo, logout, type ServerAboutResponseDto } from '@immich/sdk';
import { Button, IconButton } from '@immich/ui';
import { mdiHelpCircleOutline, mdiMagnify, mdiTrayArrowUp } from '@mdi/js'; import { mdiHelpCircleOutline, mdiMagnify, mdiTrayArrowUp } from '@mdi/js';
import { onMount } from 'svelte';
import { t } from 'svelte-i18n'; import { t } from 'svelte-i18n';
import { fade } from 'svelte/transition'; import { fade } from 'svelte/transition';
import { AppRoute } from '$lib/constants';
import ImmichLogo from '$lib/components/shared-components/immich-logo.svelte';
import SearchBar from '$lib/components/shared-components/search-bar/search-bar.svelte';
import ThemeButton from '../theme-button.svelte'; import ThemeButton from '../theme-button.svelte';
import UserAvatar from '../user-avatar.svelte'; import UserAvatar from '../user-avatar.svelte';
import AccountInfoPanel from './account-info-panel.svelte'; import AccountInfoPanel from './account-info-panel.svelte';
import HelpAndFeedbackModal from '$lib/components/shared-components/help-and-feedback-modal.svelte';
import { onMount } from 'svelte';
interface Props { interface Props {
showUploadButton?: boolean; showUploadButton?: boolean;
@ -87,22 +87,24 @@
onEscape: () => (shouldShowHelpPanel = false), onEscape: () => (shouldShowHelpPanel = false),
}} }}
> >
<CircleIconButton <IconButton
id="support-feedback-button" shape="round"
color="secondary"
variant="ghost"
size="large"
title={$t('support_and_feedback')} title={$t('support_and_feedback')}
icon={mdiHelpCircleOutline} icon={mdiHelpCircleOutline}
onclick={() => (shouldShowHelpPanel = !shouldShowHelpPanel)} onclick={() => (shouldShowHelpPanel = !shouldShowHelpPanel)}
padding="1"
/> />
</div> </div>
{#if !page.url.pathname.includes('/admin') && showUploadButton} {#if !page.url.pathname.includes('/admin') && showUploadButton}
<LinkButton onclick={onUploadClick} class="hidden lg:block"> <Button onclick={onUploadClick} class="hidden lg:block" variant="ghost" color="secondary">
<div class="flex gap-2"> <div class="flex gap-2">
<Icon path={mdiTrayArrowUp} size="1.5em" /> <Icon path={mdiTrayArrowUp} size="1.5em" />
<span>{$t('upload')}</span> <span>{$t('upload')}</span>
</div> </div>
</LinkButton> </Button>
<CircleIconButton <CircleIconButton
onclick={onUploadClick} onclick={onUploadClick}
title={$t('upload')} title={$t('upload')}

View file

@ -3,8 +3,6 @@
import { page } from '$app/stores'; import { page } from '$app/stores';
import { focusTrap } from '$lib/actions/focus-trap'; import { focusTrap } from '$lib/actions/focus-trap';
import { scrollMemory } from '$lib/actions/scroll-memory'; import { scrollMemory } from '$lib/actions/scroll-memory';
import Button from '$lib/components/elements/buttons/button.svelte';
import LinkButton from '$lib/components/elements/buttons/link-button.svelte';
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import ManagePeopleVisibility from '$lib/components/faces-page/manage-people-visibility.svelte'; import ManagePeopleVisibility from '$lib/components/faces-page/manage-people-visibility.svelte';
import MergeSuggestionModal from '$lib/components/faces-page/merge-suggestion-modal.svelte'; import MergeSuggestionModal from '$lib/components/faces-page/merge-suggestion-modal.svelte';
@ -32,6 +30,7 @@
updatePerson, updatePerson,
type PersonResponseDto, type PersonResponseDto,
} from '@immich/sdk'; } from '@immich/sdk';
import { Button, Text } 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';
@ -393,12 +392,10 @@
/> />
</div> </div>
</div> </div>
<LinkButton onclick={() => (selectHidden = !selectHidden)}> <Button onclick={() => (selectHidden = !selectHidden)} size="small" variant="ghost" color="secondary">
<div class="flex flex-wrap place-items-center justify-center gap-x-1 text-sm"> <Icon path={mdiEyeOutline} />
<Icon path={mdiEyeOutline} size="18" /> <Text>{$t('show_and_hide_people')}</Text>
<p class="ml-2">{$t('show_and_hide_people')}</p> </Button>
</div>
</LinkButton>
</div> </div>
{/if} {/if}
{/snippet} {/snippet}
@ -445,13 +442,13 @@
{#snippet stickyBottom()} {#snippet stickyBottom()}
<Button <Button
color="gray" color="secondary"
fullwidth fullWidth
onclick={() => { onclick={() => {
showChangeNameModal = false; showChangeNameModal = false;
}}>{$t('cancel')}</Button }}>{$t('cancel')}</Button
> >
<Button type="submit" fullwidth form="change-name-form">{$t('ok')}</Button> <Button type="submit" fullWidth form="change-name-form">{$t('ok')}</Button>
{/snippet} {/snippet}
</FullScreenModal> </FullScreenModal>
{/if} {/if}

View file

@ -1,14 +1,11 @@
<script lang="ts"> <script lang="ts">
import empty2Url from '$lib/assets/empty-2.svg'; import empty2Url from '$lib/assets/empty-2.svg';
import LinkButton from '$lib/components/elements/buttons/link-button.svelte'; import Albums from '$lib/components/album-page/albums-list.svelte';
import Icon from '$lib/components/elements/icon.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';
import { AppRoute } from '$lib/constants'; import { AppRoute } from '$lib/constants';
import { mdiLink, mdiPlusBoxOutline } from '@mdi/js';
import type { PageData } from './$types';
import { createAlbumAndRedirect } from '$lib/utils/album-utils';
import { import {
AlbumFilter, AlbumFilter,
AlbumGroupBy, AlbumGroupBy,
@ -17,8 +14,11 @@
SortOrder, SortOrder,
type AlbumViewSettings, type AlbumViewSettings,
} from '$lib/stores/preferences.store'; } from '$lib/stores/preferences.store';
import Albums from '$lib/components/album-page/albums-list.svelte'; import { createAlbumAndRedirect } from '$lib/utils/album-utils';
import { Button, HStack } from '@immich/ui';
import { mdiLink, mdiPlusBoxOutline } from '@mdi/js';
import { t } from 'svelte-i18n'; import { t } from 'svelte-i18n';
import type { PageData } from './$types';
interface Props { interface Props {
data: PageData; data: PageData;
@ -39,21 +39,17 @@
<UserPageLayout title={data.meta.title}> <UserPageLayout title={data.meta.title}>
{#snippet buttons()} {#snippet buttons()}
<div class="flex"> <HStack gap={0}>
<LinkButton onclick={() => createAlbumAndRedirect()}> <Button onclick={() => createAlbumAndRedirect()} size="small" variant="ghost" color="secondary">
<div class="flex flex-wrap place-items-center justify-center gap-x-1 text-sm"> <Icon path={mdiPlusBoxOutline} class="shrink-0" />
<Icon path={mdiPlusBoxOutline} size="18" class="shrink-0" /> <span class="leading-none max-sm:text-xs">{$t('create_album')}</span>
<span class="leading-none max-sm:text-xs">{$t('create_album')}</span> </Button>
</div>
</LinkButton>
<LinkButton href={AppRoute.SHARED_LINKS}> <Button href={AppRoute.SHARED_LINKS} size="small" variant="ghost" color="secondary">
<div class="flex flex-wrap place-items-center justify-center gap-x-1 text-sm"> <Icon path={mdiLink} class="shrink-0" />
<Icon path={mdiLink} size="18" class="shrink-0" /> <span class="leading-none max-sm:text-xs">{$t('shared_links')}</span>
<span class="leading-none max-sm:text-xs">{$t('shared_links')}</span> </Button>
</div> </HStack>
</LinkButton>
</div>
{/snippet} {/snippet}
<div class="flex flex-col"> <div class="flex flex-col">

View file

@ -1,11 +1,11 @@
<script lang="ts"> <script lang="ts">
import { goto } from '$app/navigation'; import { goto } from '$app/navigation';
import { page } from '$app/stores'; import { page } from '$app/stores';
import Button from '$lib/components/elements/buttons/button.svelte'; import SkipLink from '$lib/components/elements/buttons/skip-link.svelte';
import LinkButton from '$lib/components/elements/buttons/link-button.svelte';
import Icon from '$lib/components/elements/icon.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 FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte'; import FullScreenModal from '$lib/components/shared-components/full-screen-modal.svelte';
import { import {
notificationController, notificationController,
@ -13,19 +13,18 @@
} from '$lib/components/shared-components/notification/notification'; } from '$lib/components/shared-components/notification/notification';
import SettingInputField from '$lib/components/shared-components/settings/setting-input-field.svelte'; import SettingInputField from '$lib/components/shared-components/settings/setting-input-field.svelte';
import SideBarSection from '$lib/components/shared-components/side-bar/side-bar-section.svelte'; import SideBarSection from '$lib/components/shared-components/side-bar/side-bar-section.svelte';
import Breadcrumbs from '$lib/components/shared-components/tree/breadcrumbs.svelte';
import TreeItemThumbnails from '$lib/components/shared-components/tree/tree-item-thumbnails.svelte'; import TreeItemThumbnails from '$lib/components/shared-components/tree/tree-item-thumbnails.svelte';
import TreeItems from '$lib/components/shared-components/tree/tree-items.svelte'; import TreeItems from '$lib/components/shared-components/tree/tree-items.svelte';
import { AppRoute, AssetAction, QueryParameter, SettingInputFieldType } from '$lib/constants'; import { AppRoute, AssetAction, QueryParameter, SettingInputFieldType } from '$lib/constants';
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
import { AssetStore } from '$lib/stores/assets.store'; import { AssetStore } from '$lib/stores/assets.store';
import { buildTree, normalizeTreePath } from '$lib/utils/tree-utils'; import { buildTree, normalizeTreePath } from '$lib/utils/tree-utils';
import { deleteTag, getAllTags, updateTag, upsertTags, type TagResponseDto } from '@immich/sdk'; import { deleteTag, getAllTags, updateTag, upsertTags, type TagResponseDto } from '@immich/sdk';
import { Button, HStack, Text } from '@immich/ui';
import { mdiPencil, mdiPlus, mdiTag, mdiTagMultiple, mdiTrashCanOutline } from '@mdi/js'; import { mdiPencil, mdiPlus, mdiTag, mdiTagMultiple, mdiTrashCanOutline } from '@mdi/js';
import { t } from 'svelte-i18n'; import { t } from 'svelte-i18n';
import type { PageData } from './$types'; import type { PageData } from './$types';
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
import Breadcrumbs from '$lib/components/shared-components/tree/breadcrumbs.svelte';
import SkipLink from '$lib/components/elements/buttons/skip-link.svelte';
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
interface Props { interface Props {
data: PageData; data: PageData;
@ -169,29 +168,23 @@
{/snippet} {/snippet}
{#snippet buttons()} {#snippet buttons()}
<section> <HStack>
<LinkButton onclick={handleCreate}> <Button onclick={handleCreate} size="small" variant="ghost" color="secondary">
<div class="flex place-items-center gap-2 text-sm"> <Icon path={mdiPlus} />
<Icon path={mdiPlus} size="18" /> <p class="hidden md:block">{$t('create_tag')}</p>
<p class="hidden md:block">{$t('create_tag')}</p> </Button>
</div>
</LinkButton>
{#if pathSegments.length > 0 && tag} {#if pathSegments.length > 0 && tag}
<LinkButton onclick={handleEdit}> <Button onclick={handleEdit} size="small" variant="ghost" color="secondary">
<div class="flex place-items-center gap-2 text-sm"> <Icon path={mdiPencil} size="18" />
<Icon path={mdiPencil} size="18" /> <Text class="hidden md:block">{$t('edit_tag')}</Text>
<p class="hidden md:block">{$t('edit_tag')}</p> </Button>
</div> <Button onclick={handleDelete} size="small" variant="ghost" color="secondary">
</LinkButton> <Icon path={mdiTrashCanOutline} />
<LinkButton onclick={handleDelete}> <Text class="hidden md:block">{$t('delete_tag')}</Text>
<div class="flex place-items-center gap-2 text-sm"> </Button>
<Icon path={mdiTrashCanOutline} size="18" />
<p class="hidden md:block">{$t('delete_tag')}</p>
</div>
</LinkButton>
{/if} {/if}
</section> </HStack>
{/snippet} {/snippet}
<Breadcrumbs {pathSegments} icon={mdiTagMultiple} title={$t('tags')} {getLink} /> <Breadcrumbs {pathSegments} icon={mdiTagMultiple} title={$t('tags')} {getLink} />
@ -230,8 +223,8 @@
</form> </form>
{#snippet stickyBottom()} {#snippet stickyBottom()}
<Button color="gray" fullwidth onclick={() => handleCancel()}>{$t('cancel')}</Button> <Button color="secondary" fullWidth shape="round" onclick={() => handleCancel()}>{$t('cancel')}</Button>
<Button type="submit" fullwidth form="create-tag-form">{$t('create')}</Button> <Button type="submit" fullWidth shape="round" form="create-tag-form">{$t('create')}</Button>
{/snippet} {/snippet}
</FullScreenModal> </FullScreenModal>
{/if} {/if}
@ -249,8 +242,8 @@
</form> </form>
{#snippet stickyBottom()} {#snippet stickyBottom()}
<Button color="gray" fullwidth onclick={() => handleCancel()}>{$t('cancel')}</Button> <Button color="secondary" fullWidth shape="round" onclick={() => handleCancel()}>{$t('cancel')}</Button>
<Button type="submit" fullwidth form="edit-tag-form">{$t('save')}</Button> <Button type="submit" fullWidth shape="round" form="edit-tag-form">{$t('save')}</Button>
{/snippet} {/snippet}
</FullScreenModal> </FullScreenModal>
{/if} {/if}

View file

@ -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 LinkButton from '$lib/components/elements/buttons/link-button.svelte';
import Icon from '$lib/components/elements/icon.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 DeleteAssets from '$lib/components/photos-page/actions/delete-assets.svelte'; import DeleteAssets from '$lib/components/photos-page/actions/delete-assets.svelte';
@ -9,23 +8,24 @@
import SelectAllAssets from '$lib/components/photos-page/actions/select-all-assets.svelte'; import SelectAllAssets from '$lib/components/photos-page/actions/select-all-assets.svelte';
import AssetGrid from '$lib/components/photos-page/asset-grid.svelte'; import AssetGrid from '$lib/components/photos-page/asset-grid.svelte';
import AssetSelectControlBar from '$lib/components/photos-page/asset-select-control-bar.svelte'; import AssetSelectControlBar from '$lib/components/photos-page/asset-select-control-bar.svelte';
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte'; import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
import { import {
NotificationType, NotificationType,
notificationController, notificationController,
} from '$lib/components/shared-components/notification/notification'; } from '$lib/components/shared-components/notification/notification';
import { AppRoute } from '$lib/constants'; import { AppRoute } from '$lib/constants';
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
import { AssetStore } from '$lib/stores/assets.store'; import { AssetStore } from '$lib/stores/assets.store';
import { featureFlags, serverConfig } from '$lib/stores/server-config.store'; import { featureFlags, serverConfig } from '$lib/stores/server-config.store';
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 { mdiDeleteForeverOutline, mdiHistory } from '@mdi/js'; import { mdiDeleteForeverOutline, mdiHistory } from '@mdi/js';
import type { PageData } from './$types';
import { handlePromiseError } from '$lib/utils';
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
import { t } from 'svelte-i18n';
import { onDestroy } from 'svelte'; import { onDestroy } from 'svelte';
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte'; import { t } from 'svelte-i18n';
import type { PageData } from './$types';
interface Props { interface Props {
data: PageData; data: PageData;
@ -113,20 +113,28 @@
{#if $featureFlags.loaded && $featureFlags.trash} {#if $featureFlags.loaded && $featureFlags.trash}
<UserPageLayout hideNavbar={assetInteraction.selectionActive} title={data.meta.title} scrollbar={false}> <UserPageLayout hideNavbar={assetInteraction.selectionActive} title={data.meta.title} scrollbar={false}>
{#snippet buttons()} {#snippet buttons()}
<div class="flex place-items-center gap-2"> <HStack gap={0}>
<LinkButton onclick={handleRestoreTrash} disabled={assetInteraction.selectionActive}> <Button
<div class="flex place-items-center gap-2 text-sm"> onclick={handleRestoreTrash}
<Icon path={mdiHistory} size="18" /> disabled={assetInteraction.selectionActive}
{$t('restore_all')} variant="ghost"
</div> color="secondary"
</LinkButton> size="small"
<LinkButton onclick={() => handleEmptyTrash()} disabled={assetInteraction.selectionActive}> >
<div class="flex place-items-center gap-2 text-sm"> <Icon path={mdiHistory} />
<Icon path={mdiDeleteForeverOutline} size="18" /> {$t('restore_all')}
{$t('empty_trash')} </Button>
</div> <Button
</LinkButton> onclick={() => handleEmptyTrash()}
</div> disabled={assetInteraction.selectionActive}
variant="ghost"
color="secondary"
size="small"
>
<Icon path={mdiDeleteForeverOutline} />
{$t('empty_trash')}
</Button>
</HStack>
{/snippet} {/snippet}
<AssetGrid enableRouting={true} {assetStore} {assetInteraction} onEscape={handleEscape}> <AssetGrid enableRouting={true} {assetStore} {assetInteraction} onEscape={handleEscape}>

View file

@ -1,27 +1,26 @@
<script lang="ts"> <script lang="ts">
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 { import {
NotificationType, NotificationType,
notificationController, notificationController,
} from '$lib/components/shared-components/notification/notification'; } from '$lib/components/shared-components/notification/notification';
import ShowShortcuts from '$lib/components/shared-components/show-shortcuts.svelte';
import DuplicatesCompareControl from '$lib/components/utilities-page/duplicates/duplicates-compare-control.svelte'; import DuplicatesCompareControl from '$lib/components/utilities-page/duplicates/duplicates-compare-control.svelte';
import type { AssetResponseDto } from '@immich/sdk'; import { locale } from '$lib/stores/preferences.store';
import { featureFlags } from '$lib/stores/server-config.store'; import { featureFlags } from '$lib/stores/server-config.store';
import { stackAssets } from '$lib/utils/asset-utils';
import { suggestDuplicate } from '$lib/utils/duplicate-utils';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
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 { 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';
import { suggestDuplicate } from '$lib/utils/duplicate-utils';
import LinkButton from '$lib/components/elements/buttons/link-button.svelte';
import { mdiCheckOutline, mdiInformationOutline, mdiTrashCanOutline } from '@mdi/js';
import { stackAssets } from '$lib/utils/asset-utils';
import ShowShortcuts from '$lib/components/shared-components/show-shortcuts.svelte';
import DuplicatesModal from '$lib/components/shared-components/duplicates-modal.svelte';
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
import { mdiKeyboard } from '@mdi/js';
import Icon from '$lib/components/elements/icon.svelte';
import { locale } from '$lib/stores/preferences.store';
interface Props { interface Props {
data: PageData; data: PageData;
@ -163,25 +162,31 @@
<UserPageLayout title={data.meta.title + ` (${duplicates.length.toLocaleString($locale)})`} scrollbar={true}> <UserPageLayout title={data.meta.title + ` (${duplicates.length.toLocaleString($locale)})`} scrollbar={true}>
{#snippet buttons()} {#snippet buttons()}
<div class="flex place-items-center gap-2"> <HStack gap={0}>
<LinkButton onclick={() => handleDeduplicateAll()} disabled={!hasDuplicates}> <Button
<div class="flex place-items-center gap-2 text-sm"> onclick={() => handleDeduplicateAll()}
<Icon path={mdiTrashCanOutline} size="18" /> disabled={!hasDuplicates}
{$t('deduplicate_all')} size="small"
</div> variant="ghost"
</LinkButton> color="secondary"
<LinkButton onclick={() => handleKeepAll()} disabled={!hasDuplicates}> >
<div class="flex place-items-center gap-2 text-sm"> <Icon path={mdiTrashCanOutline} />
<Icon path={mdiCheckOutline} size="18" /> {$t('deduplicate_all')}
{$t('keep_all')} </Button>
</div> <Button onclick={() => handleKeepAll()} disabled={!hasDuplicates} size="small" variant="ghost" color="secondary">
</LinkButton> <Icon path={mdiCheckOutline} />
<CircleIconButton {$t('keep_all')}
</Button>
<IconButton
shape="round"
variant="ghost"
color="secondary"
size="large"
icon={mdiKeyboard} icon={mdiKeyboard}
title={$t('show_keyboard_shortcuts')} title={$t('show_keyboard_shortcuts')}
onclick={() => (isShowKeyboardShortcut = !isShowKeyboardShortcut)} onclick={() => (isShowKeyboardShortcut = !isShowKeyboardShortcut)}
/> />
</div> </HStack>
{/snippet} {/snippet}
<div class=""> <div class="">

View file

@ -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 LinkButton from '$lib/components/elements/buttons/link-button.svelte';
import Icon from '$lib/components/elements/icon.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';
@ -13,6 +12,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 { 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';
@ -71,20 +71,16 @@
<UserPageLayout title={data.meta.title} admin> <UserPageLayout title={data.meta.title} admin>
{#snippet buttons()} {#snippet buttons()}
<div class="flex justify-end"> <HStack gap={0}>
<LinkButton onclick={() => (isOpen = true)}> <Button onclick={() => (isOpen = true)} size="small" variant="ghost" color="secondary">
<div class="flex place-items-center gap-2 text-sm"> <Icon path={mdiPlus} size="18" />
<Icon path={mdiPlus} size="18" /> {$t('admin.create_job')}
{$t('admin.create_job')} </Button>
</div> <Button href="{AppRoute.ADMIN_SETTINGS}?isOpen=job" size="small" variant="ghost" color="secondary">
</LinkButton> <Icon path={mdiCog} size="18" />
<LinkButton href="{AppRoute.ADMIN_SETTINGS}?isOpen=job"> {$t('admin.manage_concurrency')}
<div class="flex place-items-center gap-2 text-sm"> </Button>
<Icon path={mdiCog} size="18" /> </HStack>
{$t('admin.manage_concurrency')}
</div>
</LinkButton>
</div>
{/snippet} {/snippet}
<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-[850px]"> <section class="w-full pb-28 sm:w-5/6 md:w-[850px]">

View file

@ -1,17 +1,20 @@
<script lang="ts"> <script lang="ts">
import Icon from '$lib/components/elements/icon.svelte'; import Icon from '$lib/components/elements/icon.svelte';
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
import LibraryImportPathsForm from '$lib/components/forms/library-import-paths-form.svelte'; import LibraryImportPathsForm from '$lib/components/forms/library-import-paths-form.svelte';
import LibraryRenameForm from '$lib/components/forms/library-rename-form.svelte'; import LibraryRenameForm from '$lib/components/forms/library-rename-form.svelte';
import LibraryScanSettingsForm from '$lib/components/forms/library-scan-settings-form.svelte'; import LibraryScanSettingsForm from '$lib/components/forms/library-scan-settings-form.svelte';
import LibraryUserPickerForm from '$lib/components/forms/library-user-picker-form.svelte'; import LibraryUserPickerForm from '$lib/components/forms/library-user-picker-form.svelte';
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte'; import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
import ButtonContextMenu from '$lib/components/shared-components/context-menu/button-context-menu.svelte';
import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte'; import MenuOption from '$lib/components/shared-components/context-menu/menu-option.svelte';
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
import EmptyPlaceholder from '$lib/components/shared-components/empty-placeholder.svelte';
import LoadingSpinner from '$lib/components/shared-components/loading-spinner.svelte'; import LoadingSpinner from '$lib/components/shared-components/loading-spinner.svelte';
import { import {
notificationController, notificationController,
NotificationType, NotificationType,
} from '$lib/components/shared-components/notification/notification'; } from '$lib/components/shared-components/notification/notification';
import { locale } from '$lib/stores/preferences.store';
import { ByteUnit, getBytesWithUnit } from '$lib/utils/byte-units'; import { ByteUnit, getBytesWithUnit } from '$lib/utils/byte-units';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { import {
@ -26,15 +29,12 @@
type LibraryStatsResponseDto, type LibraryStatsResponseDto,
type UserResponseDto, type UserResponseDto,
} from '@immich/sdk'; } from '@immich/sdk';
import { Button } 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 { fade, slide } from 'svelte/transition';
import LinkButton from '../../../lib/components/elements/buttons/link-button.svelte';
import type { PageData } from './$types';
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
import { t } from 'svelte-i18n'; import { t } from 'svelte-i18n';
import ButtonContextMenu from '$lib/components/shared-components/context-menu/button-context-menu.svelte'; import { fade, slide } from 'svelte/transition';
import { locale } from '$lib/stores/preferences.store'; import type { PageData } from './$types';
interface Props { interface Props {
data: PageData; data: PageData;
@ -220,19 +220,19 @@
{#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}
<LinkButton onclick={() => handleScanAll()}> <Button onclick={handleScanAll} size="small" variant="ghost" color="secondary">
<div class="flex gap-1 text-sm"> <div class="flex gap-1 text-sm">
<Icon path={mdiSync} size="18" /> <Icon path={mdiSync} size="18" />
<span>{$t('scan_all_libraries')}</span> <span>{$t('scan_all_libraries')}</span>
</div> </div>
</LinkButton> </Button>
{/if} {/if}
<LinkButton onclick={() => (toCreateLibrary = true)}> <Button onclick={() => (toCreateLibrary = true)} size="small" variant="ghost" color="secondary">
<div class="flex gap-1 text-sm"> <div class="flex gap-1 text-sm">
<Icon path={mdiPlusBoxOutline} size="18" /> <Icon path={mdiPlusBoxOutline} size="18" />
<span>{$t('create_library')}</span> <span>{$t('create_library')}</span>
</div> </div>
</LinkButton> </Button>
</div> </div>
{/snippet} {/snippet}
<section class="my-4"> <section class="my-4">

View file

@ -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 LinkButton from '$lib/components/elements/buttons/link-button.svelte';
import Icon from '$lib/components/elements/icon.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';
@ -10,14 +9,15 @@
notificationController, notificationController,
} from '$lib/components/shared-components/notification/notification'; } from '$lib/components/shared-components/notification/notification';
import { downloadManager } from '$lib/stores/download'; import { downloadManager } from '$lib/stores/download';
import { locale } from '$lib/stores/preferences.store';
import { copyToClipboard } from '$lib/utils'; import { copyToClipboard } from '$lib/utils';
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 { mdiCheckAll, mdiContentCopy, mdiDownload, mdiRefresh, mdiWrench } from '@mdi/js'; import { mdiCheckAll, mdiContentCopy, mdiDownload, mdiRefresh, mdiWrench } from '@mdi/js';
import type { PageData } from './$types';
import { t } from 'svelte-i18n'; import { t } from 'svelte-i18n';
import { locale } from '$lib/stores/preferences.store'; import type { PageData } from './$types';
interface Props { interface Props {
data: PageData; data: PageData;
@ -185,32 +185,42 @@
<UserPageLayout title={data.meta.title} admin> <UserPageLayout title={data.meta.title} admin>
{#snippet buttons()} {#snippet buttons()}
<div class="flex justify-end gap-2"> <HStack gap={0}>
<LinkButton onclick={() => handleRepair()} disabled={matches.length === 0 || repairing}> <Button
<div class="flex place-items-center gap-2 text-sm"> onclick={() => handleRepair()}
<Icon path={mdiWrench} size="18" /> disabled={matches.length === 0 || repairing}
{$t('admin.repair_all')} size="small"
</div> variant="ghost"
</LinkButton> color="secondary"
<LinkButton onclick={() => handleCheckAll()} disabled={extras.length === 0 || checking}> >
<div class="flex place-items-center gap-2 text-sm"> <Icon path={mdiWrench} />
<Icon path={mdiCheckAll} size="18" /> {$t('admin.repair_all')}
{$t('admin.check_all')} </Button>
</div> <Button
</LinkButton> onclick={() => handleCheckAll()}
<LinkButton onclick={() => handleDownload()} disabled={extras.length + orphans.length === 0}> disabled={extras.length === 0 || checking}
<div class="flex place-items-center gap-2 text-sm"> size="small"
<Icon path={mdiDownload} size="18" /> variant="ghost"
{$t('export')} color="secondary"
</div> >
</LinkButton> <Icon path={mdiCheckAll} />
<LinkButton onclick={() => handleRefresh()}> {$t('admin.check_all')}
<div class="flex place-items-center gap-2 text-sm"> </Button>
<Icon path={mdiRefresh} size="18" /> <Button
{$t('refresh')} onclick={() => handleDownload()}
</div> disabled={extras.length + orphans.length === 0}
</LinkButton> size="small"
</div> variant="ghost"
color="secondary"
>
<Icon path={mdiDownload} />
{$t('export')}
</Button>
<Button onclick={() => handleRefresh()} size="small" variant="ghost" color="secondary">
<Icon path={mdiRefresh} />
{$t('refresh')}
</Button>
</HStack>
{/snippet} {/snippet}
<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-[850px]"> <section class="w-full pb-28 sm:w-5/6 md:w-[850px]">

View file

@ -17,7 +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 LinkButton from '$lib/components/elements/buttons/link-button.svelte'; import { Button, HStack } from '@immich/ui';
import Icon from '$lib/components/elements/icon.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 SettingAccordionState from '$lib/components/shared-components/settings/setting-accordion-state.svelte'; import SettingAccordionState from '$lib/components/shared-components/settings/setting-accordion-state.svelte';
@ -255,31 +255,30 @@
<UserPageLayout title={data.meta.title} admin> <UserPageLayout title={data.meta.title} admin>
{#snippet buttons()} {#snippet buttons()}
<div class="flex justify-end gap-2"> <HStack gap={1}>
<div class="hidden lg:block"> <div class="hidden lg:block">
<SearchBar placeholder={$t('search_settings')} bind:name={searchQuery} showLoadingSpinner={false} /> <SearchBar placeholder={$t('search_settings')} bind:name={searchQuery} showLoadingSpinner={false} />
</div> </div>
<LinkButton onclick={() => copyToClipboard(JSON.stringify(config, jsonReplacer, 2))}> <Button
<div class="flex place-items-center gap-2 text-sm"> onclick={() => copyToClipboard(JSON.stringify(config, jsonReplacer, 2))}
<Icon path={mdiContentCopy} size="18" /> size="small"
{$t('copy_to_clipboard')} variant="ghost"
</div> color="secondary"
</LinkButton> >
<LinkButton onclick={() => downloadConfig()}> <Icon path={mdiContentCopy} />
<div class="flex place-items-center gap-2 text-sm"> {$t('copy_to_clipboard')}
<Icon path={mdiDownload} size="18" /> </Button>
{$t('export_as_json')} <Button onclick={() => downloadConfig()} size="small" variant="ghost" color="secondary">
</div> <Icon path={mdiDownload} />
</LinkButton> {$t('export_as_json')}
</Button>
{#if !$featureFlags.configFile} {#if !$featureFlags.configFile}
<LinkButton onclick={() => inputElement?.click()}> <Button onclick={() => inputElement?.click()} size="small" variant="ghost" color="secondary">
<div class="flex place-items-center gap-2 text-sm"> <Icon path={mdiUpload} />
<Icon path={mdiUpload} size="18" /> {$t('import_from_json')}
{$t('import_from_json')} </Button>
</div>
</LinkButton>
{/if} {/if}
</div> </HStack>
{/snippet} {/snippet}
<AdminSettings bind:config bind:this={adminSettingElement}> <AdminSettings bind:config bind:this={adminSettingElement}>