|
@@ -46,6 +46,7 @@
|
|
import { compareVersion } from '$lib/utils';
|
|
import { compareVersion } from '$lib/utils';
|
|
|
|
|
|
import UpdateInfoToast from '$lib/components/layout/UpdateInfoToast.svelte';
|
|
import UpdateInfoToast from '$lib/components/layout/UpdateInfoToast.svelte';
|
|
|
|
+ import { fade } from 'svelte/transition';
|
|
|
|
|
|
const i18n = getContext('i18n');
|
|
const i18n = getContext('i18n');
|
|
|
|
|
|
@@ -53,6 +54,8 @@
|
|
let DB = null;
|
|
let DB = null;
|
|
let localDBChats = [];
|
|
let localDBChats = [];
|
|
|
|
|
|
|
|
+ let version;
|
|
|
|
+
|
|
const getModels = async () => {
|
|
const getModels = async () => {
|
|
return _getModels(localStorage.token);
|
|
return _getModels(localStorage.token);
|
|
};
|
|
};
|
|
@@ -216,28 +219,24 @@
|
|
});
|
|
});
|
|
|
|
|
|
const checkForVersionUpdates = async () => {
|
|
const checkForVersionUpdates = async () => {
|
|
- const version = await getVersionUpdates(localStorage.token).catch((error) => {
|
|
|
|
|
|
+ version = await getVersionUpdates(localStorage.token).catch((error) => {
|
|
return {
|
|
return {
|
|
current: WEBUI_VERSION,
|
|
current: WEBUI_VERSION,
|
|
latest: WEBUI_VERSION
|
|
latest: WEBUI_VERSION
|
|
};
|
|
};
|
|
});
|
|
});
|
|
-
|
|
|
|
- if (compareVersion(version.latest, version.current)) {
|
|
|
|
- toast.custom(UpdateInfoToast, {
|
|
|
|
- duration: Number.POSITIVE_INFINITY,
|
|
|
|
- position: 'bottom-right',
|
|
|
|
- componentProps: {
|
|
|
|
- version
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<SettingsModal bind:show={$showSettings} />
|
|
<SettingsModal bind:show={$showSettings} />
|
|
<ChangelogModal bind:show={$showChangelog} />
|
|
<ChangelogModal bind:show={$showChangelog} />
|
|
|
|
|
|
|
|
+{#if version && compareVersion(version.latest, version.current)}
|
|
|
|
+ <div class=" absolute bottom-8 right-8 z-50" in:fade={{ duration: 100 }}>
|
|
|
|
+ <UpdateInfoToast {version} />
|
|
|
|
+ </div>
|
|
|
|
+{/if}
|
|
|
|
+
|
|
<div class="app relative">
|
|
<div class="app relative">
|
|
<div
|
|
<div
|
|
class=" text-gray-700 dark:text-gray-100 bg-white dark:bg-gray-900 h-screen max-h-[100dvh] overflow-auto flex flex-row"
|
|
class=" text-gray-700 dark:text-gray-100 bg-white dark:bg-gray-900 h-screen max-h-[100dvh] overflow-auto flex flex-row"
|