"...git@developer.sourcefind.cn:chenpangpang/open-webui.git" did not exist on "1d1b945483ad00847d471d6df441fc088a31ad6f"
Unverified Commit 47203a70 authored by Timothy Jaeryang Baek's avatar Timothy Jaeryang Baek Committed by GitHub
Browse files

Merge pull request #661 from jnkstr/username_option

Added the option to show the username in the chat in settings -> interface
parents af1cc7a6 783d8cf7
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
import { tick } from 'svelte'; import { tick } from 'svelte';
import Name from './Name.svelte'; import Name from './Name.svelte';
import ProfileImage from './ProfileImage.svelte'; import ProfileImage from './ProfileImage.svelte';
import { modelfiles } from '$lib/stores'; import { modelfiles, settings } from '$lib/stores';
export let user; export let user;
export let message; export let message;
...@@ -60,6 +60,8 @@ ...@@ -60,6 +60,8 @@
{:else} {:else}
You <span class=" text-gray-500 text-sm font-medium">{message?.user ?? ''}</span> You <span class=" text-gray-500 text-sm font-medium">{message?.user ?? ''}</span>
{/if} {/if}
{:else if $settings.showUsername}
{user.name}
{:else} {:else}
You You
{/if} {/if}
......
...@@ -16,6 +16,13 @@ ...@@ -16,6 +16,13 @@
// Interface // Interface
let promptSuggestions = []; let promptSuggestions = [];
let showUsername = false;
const toggleShowUsername = async () => {
showUsername = !showUsername;
saveSettings({ showUsername: showUsername });
};
const toggleSpeechAutoSend = async () => { const toggleSpeechAutoSend = async () => {
speechAutoSend = !speechAutoSend; speechAutoSend = !speechAutoSend;
...@@ -64,7 +71,7 @@ ...@@ -64,7 +71,7 @@
titleAutoGenerate = settings.titleAutoGenerate ?? true; titleAutoGenerate = settings.titleAutoGenerate ?? true;
speechAutoSend = settings.speechAutoSend ?? false; speechAutoSend = settings.speechAutoSend ?? false;
responseAutoCopy = settings.responseAutoCopy ?? false; responseAutoCopy = settings.responseAutoCopy ?? false;
showUsername = settings.showUsername ?? false;
titleAutoGenerateModel = settings.titleAutoGenerateModel ?? ''; titleAutoGenerateModel = settings.titleAutoGenerateModel ?? '';
}); });
</script> </script>
...@@ -139,6 +146,25 @@ ...@@ -139,6 +146,25 @@
</button> </button>
</div> </div>
</div> </div>
<div>
<div class=" py-0.5 flex w-full justify-between">
<div class=" self-center text-xs font-medium">Display the username instead of "You" in the Chat</div>
<button
class="p-1 px-3 text-xs flex rounded transition"
on:click={() => {
toggleShowUsername();
}}
type="button"
>
{#if showUsername === true}
<span class="ml-2 self-center">On</span>
{:else}
<span class="ml-2 self-center">Off</span>
{/if}
</button>
</div>
</div>
</div> </div>
<hr class=" dark:border-gray-700" /> <hr class=" dark:border-gray-700" />
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment