forked from open-webui/open-webui
feat: changelog.md
This commit is contained in:
parent
9b27d952f8
commit
9f950aea9c
13 changed files with 237 additions and 154 deletions
|
@ -21,3 +21,25 @@ export const getBackendConfig = async () => {
|
|||
|
||||
return res;
|
||||
};
|
||||
|
||||
export const getChangelog = async () => {
|
||||
let error = null;
|
||||
|
||||
const res = await fetch(`${WEBUI_BASE_URL}/api/changelog`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (!res.ok) throw await res.json();
|
||||
return res.json();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
error = err;
|
||||
return null;
|
||||
});
|
||||
|
||||
return res;
|
||||
};
|
||||
|
|
90
src/lib/components/ChangelogModal.svelte
Normal file
90
src/lib/components/ChangelogModal.svelte
Normal file
|
@ -0,0 +1,90 @@
|
|||
<script lang="ts">
|
||||
import Modal from './common/Modal.svelte';
|
||||
import { Confetti } from 'svelte-confetti';
|
||||
import { WEBUI_NAME, WEB_UI_VERSION } from '$lib/constants';
|
||||
import { onMount } from 'svelte';
|
||||
import { getChangelog } from '$lib/apis';
|
||||
|
||||
export let show = false;
|
||||
|
||||
let changelog = null;
|
||||
|
||||
onMount(async () => {
|
||||
const res = await getChangelog();
|
||||
changelog = res;
|
||||
});
|
||||
</script>
|
||||
|
||||
<Modal bind:show>
|
||||
<div class="px-5 py-4 dark:text-gray-300">
|
||||
<div class="flex justify-between items-start">
|
||||
<div class="text-xl font-bold">
|
||||
{WEBUI_NAME}
|
||||
<!-- <Confetti x={[-1, -0.25]} y={[0, 0.5]} /> -->
|
||||
</div>
|
||||
<button
|
||||
class="self-center"
|
||||
on:click={() => {
|
||||
show = false;
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor"
|
||||
class="w-5 h-5"
|
||||
>
|
||||
<path
|
||||
d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class=" pb-3 flex items-center mt-2">
|
||||
<div class="text-sm dark:text-gray-200">Release Notes</div>
|
||||
<div class="flex self-center w-[1px] h-6 mx-2.5 bg-gray-200 dark:bg-gray-700" />
|
||||
<div class="text-sm dark:text-gray-200">
|
||||
v{WEB_UI_VERSION}
|
||||
</div>
|
||||
</div>
|
||||
<hr class=" dark:border-gray-800" />
|
||||
<div class=" overflow-y-scroll max-h-80">
|
||||
<div class="my-3">
|
||||
{#if changelog}
|
||||
{#each Object.keys(changelog) as version}
|
||||
<div class="font-bold text-xl mb-1">
|
||||
v{version} - {changelog[version].date}
|
||||
</div>
|
||||
|
||||
{#each Object.keys(changelog[version]).filter((section) => section !== 'date') as section}
|
||||
<div class="text-lg">
|
||||
<div class="font-bold capitalize">{section}</div>
|
||||
|
||||
<div class="my-2">
|
||||
{#each Object.keys(changelog[version][section]) as item}
|
||||
<div class="text-sm mb-2">
|
||||
<div class="font-semibold">
|
||||
{changelog[version][section][item].title}
|
||||
</div>
|
||||
<div class="my-1.5">{changelog[version][section][item].content}</div>
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end pt-3 text-sm font-medium">
|
||||
<button
|
||||
on:click={() => {
|
||||
show = false;
|
||||
}}
|
||||
class=" px-4 py-2 bg-emerald-600 hover:bg-emerald-700 text-gray-100 transition rounded"
|
||||
>
|
||||
<span class="relative">Ok, let's go!</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
|
@ -1,7 +1,7 @@
|
|||
<script lang="ts">
|
||||
import { getBackendConfig } from '$lib/apis';
|
||||
import { setDefaultPromptSuggestions } from '$lib/apis/configs';
|
||||
import { config, models, user, showWhatsChanged } from '$lib/stores';
|
||||
import { config, models, user } from '$lib/stores';
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import toast from 'svelte-french-toast';
|
||||
const dispatch = createEventDispatcher();
|
||||
|
@ -18,7 +18,6 @@
|
|||
// Interface
|
||||
let promptSuggestions = [];
|
||||
let showUsername = false;
|
||||
let enableWhatsChanged = true;
|
||||
|
||||
const toggleFullScreenMode = async () => {
|
||||
fullScreenMode = !fullScreenMode;
|
||||
|
@ -30,14 +29,6 @@
|
|||
saveSettings({ showUsername: showUsername });
|
||||
};
|
||||
|
||||
const toggleenableWhatsChanged = async () => {
|
||||
enableWhatsChanged = !enableWhatsChanged;
|
||||
if (enableWhatsChanged) {
|
||||
showWhatsChanged.update((value) => true);
|
||||
}
|
||||
saveSettings({ enableWhatsChanged: enableWhatsChanged });
|
||||
};
|
||||
|
||||
const toggleTitleAutoGenerate = async () => {
|
||||
titleAutoGenerate = !titleAutoGenerate;
|
||||
saveSettings({ titleAutoGenerate: titleAutoGenerate });
|
||||
|
@ -86,7 +77,6 @@
|
|||
titleAutoGenerate = settings.titleAutoGenerate ?? true;
|
||||
responseAutoCopy = settings.responseAutoCopy ?? false;
|
||||
showUsername = settings.showUsername ?? false;
|
||||
enableWhatsChanged = settings.enableWhatsChanged ?? true;
|
||||
fullScreenMode = settings.fullScreenMode ?? false;
|
||||
titleAutoGenerateModel = settings.titleAutoGenerateModel ?? '';
|
||||
titleGenerationPrompt =
|
||||
|
@ -187,25 +177,6 @@
|
|||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class=" py-0.5 flex w-full justify-between">
|
||||
<div class=" self-center text-xs font-medium">Show "WhatsChanged" Modal on Startup</div>
|
||||
|
||||
<button
|
||||
class="p-1 px-3 text-xs flex rounded transition"
|
||||
on:click={() => {
|
||||
toggleenableWhatsChanged();
|
||||
}}
|
||||
type="button"
|
||||
>
|
||||
{#if enableWhatsChanged === true}
|
||||
<span class="ml-2 self-center">On</span>
|
||||
{:else}
|
||||
<span class="ml-2 self-center">Off</span>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class=" dark:border-gray-700" />
|
||||
|
|
|
@ -1,79 +0,0 @@
|
|||
<script lang="ts">
|
||||
import Modal from '../common/Modal.svelte';
|
||||
import { Confetti } from 'svelte-confetti';
|
||||
import { WEBUI_NAME, WEB_UI_VERSION, RELEASE_NOTES } from '$lib/constants';
|
||||
import { config, showWhatsChanged } from '$lib/stores';
|
||||
|
||||
export let show = false;
|
||||
|
||||
function toggleVisibility() {
|
||||
showWhatsChanged.update((value) => !value);
|
||||
}
|
||||
|
||||
function handleClick() {
|
||||
toggleVisibility();
|
||||
}
|
||||
|
||||
let hasValidNotes = Array.isArray(RELEASE_NOTES) && RELEASE_NOTES.length > 0;
|
||||
</script>
|
||||
|
||||
<Modal bind:show>
|
||||
<div class="px-5 py-4 dark:text-gray-300">
|
||||
<div class="flex justify-between items-start">
|
||||
<div class="text-xl font-bold">
|
||||
{WEBUI_NAME}
|
||||
<Confetti x={[-1, -0.25]} y={[0, 0.5]} />
|
||||
</div>
|
||||
<button class="self-center" on:click={handleClick}>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 20 20"
|
||||
fill="currentColor"
|
||||
class="w-5 h-5"
|
||||
>
|
||||
<path
|
||||
d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"
|
||||
/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<div class=" pb-3 flex items-center mt-2">
|
||||
<div class="text-sm dark:text-gray-200">Release Notes</div>
|
||||
<div class="flex self-center w-[1px] h-6 mx-2.5 bg-gray-200 dark:bg-gray-700" />
|
||||
<div class="text-sm dark:text-gray-200">
|
||||
{$config && $config.version ? $config.version : WEB_UI_VERSION}
|
||||
</div>
|
||||
</div>
|
||||
<hr class=" dark:border-gray-800" />
|
||||
<div class="p-4 overflow-y-scroll max-h-80">
|
||||
{#if !hasValidNotes}
|
||||
<div class="pt-10 text-center font-bold">There are no notes given.</div>
|
||||
|
||||
<div class="pb-10 text-center">
|
||||
Check
|
||||
<a class="text-blue-500" href="https://github.com/open-webui/open-webui" target="_blank">
|
||||
Open WebUI on GitHub</a
|
||||
> for more information.
|
||||
</div>
|
||||
{:else}
|
||||
{#each RELEASE_NOTES as { title, description }}
|
||||
<div class="mt-4">
|
||||
<div class="font-bold">{title}</div>
|
||||
<div>{description}</div>
|
||||
</div>
|
||||
{/each}
|
||||
{/if}
|
||||
</div>
|
||||
<div class="m-4 flex justify-end pt-3 text-sm font-medium">
|
||||
<button
|
||||
on:click={handleClick}
|
||||
class=" rounded px-4 py-2 overflow-hidden group bg-green-600 relative hover:bg-gradient-to-r hover:from-green-600 hover:to-green-500 text-white hover:ring-2 hover:ring-offset-2 hover:ring-green-500 transition-all ease-out duration-300"
|
||||
>
|
||||
<span
|
||||
class="absolute right-0 w-8 h-32 -mt-12 transition-all duration-1000 transform translate-x-12 bg-white opacity-10 rotate-12 group-hover:-translate-x-40 ease"
|
||||
/>
|
||||
<span class="relative">Ok, let's go!</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
|
@ -12,29 +12,6 @@ export const IMAGES_API_BASE_URL = `${WEBUI_BASE_URL}/images/api/v1`;
|
|||
export const RAG_API_BASE_URL = `${WEBUI_BASE_URL}/rag/api/v1`;
|
||||
|
||||
export const WEB_UI_VERSION = APP_VERSION;
|
||||
export const RELEASE_NOTES = [
|
||||
{
|
||||
title: ' 🖼️ Image Generation',
|
||||
description:
|
||||
'Generate Images using the stable-difusion-webui API. You can set this up in settings -> images.'
|
||||
},
|
||||
{
|
||||
title: ' 📝 Change title generation prompt',
|
||||
description:
|
||||
'Change the promt used to generate titles for your chats. You can set this up in the settings -> interface.'
|
||||
},
|
||||
{
|
||||
title: ' 🤖 Change embedding model',
|
||||
description:
|
||||
'Change the embedding model used to generate embeddings for your chats in the Dockerfile. Use any sentence transformer model from huggingface.co.'
|
||||
},
|
||||
{
|
||||
title: ' 📢 This Whats Changed Popup',
|
||||
description:
|
||||
'This popup will show you the latest changes. You can edit it in the constants.ts file.'
|
||||
}
|
||||
//...
|
||||
];
|
||||
export const REQUIRED_OLLAMA_VERSION = '0.1.16';
|
||||
|
||||
export const SUPPORTED_FILE_TYPE = [
|
||||
|
|
|
@ -32,16 +32,3 @@ export const documents = writable([
|
|||
|
||||
export const settings = writable({});
|
||||
export const showSettings = writable(false);
|
||||
function createLocalStorageStore(key, startValue) {
|
||||
const storedValue = localStorage.getItem(key);
|
||||
const initialValue = storedValue ? JSON.parse(storedValue) : startValue;
|
||||
|
||||
const store = writable(initialValue);
|
||||
|
||||
store.subscribe((value) => {
|
||||
localStorage.setItem(key, JSON.stringify(value));
|
||||
});
|
||||
|
||||
return store;
|
||||
}
|
||||
export const showWhatsChanged = createLocalStorageStore('showWhatsChanged', true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue