AccountPending.svelte 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <script lang="ts">
  2. import { getAdminDetails } from '$lib/apis/auths';
  3. import { onMount, tick, getContext } from 'svelte';
  4. const i18n = getContext('i18n');
  5. let adminDetails = null;
  6. onMount(async () => {
  7. adminDetails = await getAdminDetails(localStorage.token).catch((err) => {
  8. console.error(err);
  9. return null;
  10. });
  11. });
  12. </script>
  13. <div class="fixed w-full h-full flex z-[999]">
  14. <div
  15. class="absolute w-full h-full backdrop-blur-lg bg-white/10 dark:bg-gray-900/50 flex justify-center"
  16. >
  17. <div class="m-auto pb-10 flex flex-col justify-center">
  18. <div class="max-w-md">
  19. <div class="text-center dark:text-white text-2xl font-medium z-50">
  20. {$i18n.t('Account Activation Pending')}<br />
  21. {$i18n.t('Contact Admin for WebUI Access')}
  22. </div>
  23. <div class=" mt-4 text-center text-sm dark:text-gray-200 w-full">
  24. {$i18n.t('Your account status is currently pending activation.')}<br />
  25. {$i18n.t(
  26. 'To access the WebUI, please reach out to the administrator. Admins can manage user statuses from the Admin Panel.'
  27. )}
  28. </div>
  29. {#if adminDetails}
  30. <div class="mt-4 text-sm font-medium text-center">
  31. <div>{$i18n.t('Admin')}: {adminDetails.name} ({adminDetails.email})</div>
  32. </div>
  33. {/if}
  34. <div class=" mt-6 mx-auto relative group w-fit">
  35. <button
  36. class="relative z-20 flex px-5 py-2 rounded-full bg-white border border-gray-100 dark:border-none hover:bg-gray-100 text-gray-700 transition font-medium text-sm"
  37. on:click={async () => {
  38. location.href = '/';
  39. }}
  40. >
  41. {$i18n.t('Check Again')}
  42. </button>
  43. <button
  44. class="text-xs text-center w-full mt-2 text-gray-400 underline"
  45. on:click={async () => {
  46. localStorage.removeItem('token');
  47. location.href = '/auth';
  48. }}>{$i18n.t('Sign Out')}</button
  49. >
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>