Skip to content

High performance self-hosted photo and video management solution.

727 B
Raw Blame
import { authenticate } from '#lib/utils/auth.ts';
import { getFormatter } from '#lib/utils/i18n.ts';
import { getIntegrityReportSummary, getServerVersion, listDatabaseBackups } from '@immich/sdk';
import type { PageLoad } from './$types';

export const load = (async ({ url }) => {
  await authenticate(url, { admin: true });

  const integrityReport = await getIntegrityReportSummary();
  const { major, minor, patch } = await getServerVersion();
  const { backups } = await listDatabaseBackups();

  const $t = await getFormatter();

  return {
    backups,
    integrityReport,
    expectedVersion: `${major}.${minor}.${patch}`,
    meta: {
      title: $t('admin.maintenance_settings'),
    },
  };
}) satisfies PageLoad;