Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
05aea9ed
Commit
05aea9ed
authored
Feb 23, 2024
by
Timothy J. Baek
Browse files
feat: changelog modal auto popup
parent
a84070c6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
16 deletions
+24
-16
src/lib/components/ChangelogModal.svelte
src/lib/components/ChangelogModal.svelte
+8
-3
src/lib/components/common/Modal.svelte
src/lib/components/common/Modal.svelte
+2
-2
src/lib/components/layout/Sidebar.svelte
src/lib/components/layout/Sidebar.svelte
+1
-1
src/lib/stores/index.ts
src/lib/stores/index.ts
+1
-0
src/routes/(app)/+layout.svelte
src/routes/(app)/+layout.svelte
+12
-10
No files found.
src/lib/components/ChangelogModal.svelte
View file @
05aea9ed
<script lang="ts">
import
Modal from './common/Modal.
svelte';
import
{ onMount } from '
svelte';
import { Confetti } from 'svelte-confetti';
import { config } from '$lib/stores';
import { WEBUI_NAME, WEB_UI_VERSION } from '$lib/constants';
import { onMount } from 'svelte';
import { getChangelog } from '$lib/apis';
import Modal from './common/Modal.svelte';
export let show = false;
let changelog = null;
...
...
@@ -79,11 +83,12 @@
<div class="flex justify-end pt-3 text-sm font-medium">
<button
on:click={() => {
localStorage.version = $config.version;
show = false;
}}
class=" px-4 py-2 bg-emerald-600 hover:bg-emerald-700 text-gray-100 transition rounded"
>
<span class="relative">Ok,
l
et's
g
o!</span>
<span class="relative">Ok
ay
,
L
et's
G
o!</span>
</button>
</div>
</div>
...
...
src/lib/components/common/Modal.svelte
View file @
05aea9ed
...
...
@@ -35,13 +35,13 @@
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class=" fixed top-0 right-0 left-0 bottom-0 bg-black/60 w-full min-h-screen h-screen flex justify-center z-50 overflow-hidden overscroll-contain"
transitio
n:fade={{ duration:
5
0 }}
i
n:fade={{ duration:
1
0 }}
>
<div
class=" modal-content m-auto rounded-xl max-w-full {sizeToWidth(
size
)} mx-2 bg-gray-50 dark:bg-gray-900 shadow-3xl"
transitio
n:fade={{ duration:
5
0 }}
i
n:fade={{ duration:
1
0 }}
on:click={(e) => {
e.stopPropagation();
}}
...
...
src/lib/components/layout/Sidebar.svelte
View file @
05aea9ed
...
...
@@ -563,7 +563,7 @@
<div
id="dropdownDots"
class="absolute z-40 bottom-[70px] 4.5rem rounded-lg shadow w-[240px] bg-gray-900"
transitio
n:slide={{ duration:
30
0 }}
i
n:slide={{ duration:
15
0 }}
>
<div class="py-2 w-full">
{#if $user.role === 'admin'}
...
...
src/lib/stores/index.ts
View file @
05aea9ed
...
...
@@ -32,3 +32,4 @@ export const documents = writable([
export
const
settings
=
writable
({});
export
const
showSettings
=
writable
(
false
);
export
const
showChangelog
=
writable
(
false
);
src/routes/(app)/+layout.svelte
View file @
05aea9ed
<script lang="ts">
import toast from 'svelte-french-toast';
import { openDB, deleteDB } from 'idb';
import { onMount, tick } from 'svelte';
import { goto } from '$app/navigation';
import fileSaver from 'file-saver';
const { saveAs } = fileSaver;
import { onMount, tick } from 'svelte';
import { goto } from '$app/navigation';
import { getOllamaModels, getOllamaVersion } from '$lib/apis/ollama';
import { getModelfiles } from '$lib/apis/modelfiles';
import { getPrompts } from '$lib/apis/prompts';
import { getOpenAIModels } from '$lib/apis/openai';
import { getDocs } from '$lib/apis/documents';
import { getAllChatTags } from '$lib/apis/chats';
import {
user,
...
...
@@ -21,16 +22,16 @@
modelfiles,
prompts,
documents,
tags
tags,
showChangelog,
config
} from '$lib/stores';
import { REQUIRED_OLLAMA_VERSION, WEBUI_API_BASE_URL } from '$lib/constants';
import { checkVersion } from '$lib/utils';
import SettingsModal from '$lib/components/chat/SettingsModal.svelte';
import Sidebar from '$lib/components/layout/Sidebar.svelte';
import { checkVersion } from '$lib/utils';
import ShortcutsModal from '$lib/components/chat/ShortcutsModal.svelte';
import { getDocs } from '$lib/apis/documents';
import { getAllChatTags } from '$lib/apis/chats';
import ChangelogModal from '$lib/components/ChangelogModal.svelte';
let ollamaVersion = '';
...
...
@@ -183,6 +184,8 @@
}
});
showChangelog.set(localStorage.version !== $config.version);
await tick();
}
...
...
@@ -349,8 +352,6 @@
</div>
</div>
</div>
{:else}
<ChangelogModal show={true} />
{/if}
<div
...
...
@@ -358,6 +359,7 @@
>
<Sidebar />
<SettingsModal bind:show={$showSettings} />
<ChangelogModal bind:show={$showChangelog} />
<slot />
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment