mirror of
https://github.com/immich-app/immich.git
synced 2025-12-29 01:11:52 +03:00
chore(web): change license wording and other things (#11309)
This commit is contained in:
@@ -1,41 +1,42 @@
|
||||
<script lang="ts">
|
||||
import { goto } from '$app/navigation';
|
||||
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
||||
import LicenseActivationSuccess from '$lib/components/shared-components/license/license-activation-success.svelte';
|
||||
import LicenseContent from '$lib/components/shared-components/license/license-content.svelte';
|
||||
import LicenseActivationSuccess from '$lib/components/shared-components/purchasing/purchase-activation-success.svelte';
|
||||
import LicenseContent from '$lib/components/shared-components/purchasing/purchase-content.svelte';
|
||||
import { AppRoute } from '$lib/constants';
|
||||
import { user } from '$lib/stores/user.store';
|
||||
import { t } from 'svelte-i18n';
|
||||
import type { PageData } from './$types';
|
||||
import Icon from '$lib/components/elements/icon.svelte';
|
||||
import { mdiAlertCircleOutline, mdiLicense } from '@mdi/js';
|
||||
import { licenseStore } from '$lib/stores/license.store';
|
||||
import { mdiAlertCircleOutline } from '@mdi/js';
|
||||
import { purchaseStore } from '$lib/stores/purchase.store';
|
||||
import ImmichLogo from '$lib/components/shared-components/immich-logo.svelte';
|
||||
|
||||
export let data: PageData;
|
||||
let showLicenseActivated = false;
|
||||
const { isLicenseActivated } = licenseStore;
|
||||
const { isPurchased } = purchaseStore;
|
||||
</script>
|
||||
|
||||
<UserPageLayout title={$t('buy')}>
|
||||
<section class="mx-4 flex place-content-center">
|
||||
<div class={`w-full ${$user.isAdmin ? 'max-w-3xl' : 'max-w-xl'}`}>
|
||||
<div class="w-full max-w-3xl">
|
||||
{#if data.isActivated === false}
|
||||
<div
|
||||
class="bg-red-100 text-red-700 px-4 py-3 rounded-md flex place-items-center place-content-center gap-2"
|
||||
role="alert"
|
||||
>
|
||||
<Icon path={mdiAlertCircleOutline} size="18" />
|
||||
<p>{$t('license_failed_activation')}</p>
|
||||
<p>{$t('purchase_failed_activation')}</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if $isLicenseActivated}
|
||||
{#if $isPurchased}
|
||||
<div
|
||||
class="bg-immich-primary/10 text-immich-primary px-4 py-3 rounded-md flex place-items-center place-content-center gap-2 mb-5 dark:text-black dark:bg-immich-dark-primary"
|
||||
role="alert"
|
||||
class="flex gap-1 mt-2 place-items-center place-content-center dark:bg-immich-dark-primary/10 bg-gray-200/50 p-2 border rounded-lg dark:text-white supporter-effect"
|
||||
>
|
||||
<Icon path={mdiLicense} size="24" />
|
||||
<p>{$t('license_account_info')}</p>
|
||||
<div class="h-8 w-8">
|
||||
<ImmichLogo noText />
|
||||
</div>
|
||||
<p>{$t('purchase_account_info')}</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { licenseStore } from '$lib/stores/license.store';
|
||||
import { purchaseStore } from '$lib/stores/purchase.store';
|
||||
import { authenticate } from '$lib/utils/auth';
|
||||
import { getFormatter } from '$lib/utils/i18n';
|
||||
import { activateLicense, getActivationKey } from '$lib/utils/license-utils';
|
||||
import { activateProduct, getActivationKey } from '$lib/utils/license-utils';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ url }) => {
|
||||
@@ -18,10 +18,10 @@ export const load = (async ({ url }) => {
|
||||
}
|
||||
|
||||
if (licenseKey && activationKey) {
|
||||
const response = await activateLicense(licenseKey, activationKey);
|
||||
const response = await activateProduct(licenseKey, activationKey);
|
||||
if (response.activatedAt !== '') {
|
||||
isActivated = true;
|
||||
licenseStore.setLicenseStatus(true);
|
||||
purchaseStore.setPurchaseStatus(true);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user