chore: use new buttons for admin pages

pull/24205/head
izzy 2025-12-17 15:46:06 +00:00
parent 05acf74626
commit 16c2082721
No known key found for this signature in database
2 changed files with 27 additions and 38 deletions

View File

@ -12,10 +12,10 @@
MaintenanceAction,
ManualJobName,
setMaintenanceMode,
type MaintenanceIntegrityReportSummaryResponseDto,
type IntegrityReportSummaryResponseDto,
type QueuesResponseLegacyDto,
} from '@immich/sdk';
import { Button, HStack, Text, toastManager } from '@immich/ui';
import { Button, HStack, toastManager } from '@immich/ui';
import { mdiProgressWrench } from '@mdi/js';
import { onDestroy, onMount } from 'svelte';
import { t } from 'svelte-i18n';
@ -27,7 +27,7 @@
let { data }: Props = $props();
let integrityReport: MaintenanceIntegrityReportSummaryResponseDto = $state(data.integrityReport);
let integrityReport: IntegrityReportSummaryResponseDto = $state(data.integrityReport);
const TYPES: IntegrityReportType[] = [
IntegrityReportType.OrphanFile,
@ -98,21 +98,16 @@
});
</script>
<AdminPageLayout breadcrumbs={[{ title: data.meta.title }]}>
{#snippet buttons()}
<HStack gap={1}>
<Button
leadingIcon={mdiProgressWrench}
size="small"
variant="ghost"
color="secondary"
onclick={switchToMaintenance}
>
<Text class="hidden md:block">{$t('admin.maintenance_start')}</Text>
</Button>
</HStack>
{/snippet}
<AdminPageLayout
breadcrumbs={[{ title: data.meta.title }]}
actions={[
{
title: $t('admin.maintenance_start'),
onAction: switchToMaintenance,
icon: mdiProgressWrench,
},
]}
>
<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]">
<p class="text-sm dark:text-immich-dark-fg uppercase">{$t('admin.maintenance_integrity_report')}</p>

View File

@ -4,12 +4,9 @@
import { handleError } from '$lib/utils/handle-error';
import { createJob, deleteIntegrityReport, getBaseUrl, IntegrityReportType, ManualJobName } from '@immich/sdk';
import {
Button,
HStack,
IconButton,
menuManager,
modalManager,
Text,
toastManager,
type ContextMenuBaseProps,
type MenuItems,
@ -121,24 +118,21 @@
{ title: $t('admin.maintenance_integrity_report') },
{ title: data.meta.title },
]}
actions={[
{
title: 'Download CSV',
icon: mdiDownload,
onAction: () => {
location.href = `${getBaseUrl()}/admin/maintenance/integrity/report/${data.type}/csv`;
},
},
{
title: 'Delete All',
onAction: removeAll,
icon: mdiTrashCanOutline,
},
]}
>
{#snippet buttons()}
<HStack gap={1}>
<Button
size="small"
variant="ghost"
color="secondary"
leadingIcon={mdiDownload}
href={`${getBaseUrl()}/admin/maintenance/integrity/report/${data.type}/csv`}
>
<Text class="hidden md:block">Download CSV</Text>
</Button>
<Button size="small" variant="ghost" color="danger" leadingIcon={mdiTrashCanOutline} onclick={removeAll}>
<Text class="hidden md:block">Delete All</Text>
</Button>
</HStack>
{/snippet}
<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]">
<table class="mt-5 w-full text-start">