UpdateInfoToast.svelte 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <script lang="ts">
  2. import { getContext, createEventDispatcher } from 'svelte';
  3. const dispatch = createEventDispatcher();
  4. const i18n = getContext('i18n');
  5. import { WEBUI_VERSION } from '$lib/constants';
  6. import XMark from '../icons/XMark.svelte';
  7. export let version = {
  8. current: WEBUI_VERSION,
  9. latest: WEBUI_VERSION
  10. };
  11. </script>
  12. <div
  13. class="flex items-start bg-[#F1F8FE] dark:bg-[#020C1D] border border-[3371D5] dark:border-[#03113B] text-[#3371D5] dark:text-[#6795EC] rounded-lg px-3.5 py-3 text-xs max-w-80 pr-2 w-full shadow-lg"
  14. >
  15. <div class="flex-1 font-medium">
  16. {$i18n.t(`A new version (v{{LATEST_VERSION}}) is now available.`, {
  17. LATEST_VERSION: version.latest
  18. })}
  19. <a href="https://github.com/open-webui/open-webui/releases" target="_blank" class="underline">
  20. {$i18n.t('Update for the latest features and improvements.')}</a
  21. >
  22. </div>
  23. <div class=" flex-shrink-0 pr-1">
  24. <button
  25. class=" hover:text-blue-900 dark:hover:text-blue-300 transition"
  26. on:click={() => {
  27. dispatch('close');
  28. }}
  29. >
  30. <XMark />
  31. </button>
  32. </div>
  33. </div>