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
8a08ba07
Commit
8a08ba07
authored
Mar 09, 2024
by
Timothy J. Baek
Browse files
refac: settings save
parent
c6667510
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
14 additions
and
36 deletions
+14
-36
src/lib/components/chat/Settings/Account.svelte
src/lib/components/chat/Settings/Account.svelte
+1
-1
src/lib/components/chat/Settings/Audio.svelte
src/lib/components/chat/Settings/Audio.svelte
+1
-1
src/lib/components/chat/Settings/Connections.svelte
src/lib/components/chat/Settings/Connections.svelte
+1
-1
src/lib/components/chat/Settings/General.svelte
src/lib/components/chat/Settings/General.svelte
+1
-1
src/lib/components/chat/Settings/Images.svelte
src/lib/components/chat/Settings/Images.svelte
+1
-1
src/lib/components/chat/Settings/Interface.svelte
src/lib/components/chat/Settings/Interface.svelte
+3
-25
src/lib/components/chat/SettingsModal.svelte
src/lib/components/chat/SettingsModal.svelte
+6
-6
No files found.
src/lib/components/chat/Settings/Account.svelte
View file @
8a08ba07
...
@@ -271,7 +271,7 @@
...
@@ -271,7 +271,7 @@
<div class="flex justify-end pt-3 text-sm font-medium">
<div class="flex justify-end pt-3 text-sm font-medium">
<button
<button
class=" px-4 py-2 bg-emerald-
6
00 hover:bg-emerald-
7
00 text-gray-100 transition rounded"
class="
px-4 py-2 bg-emerald-
7
00 hover:bg-emerald-
8
00 text-gray-100 transition rounded
-lg
"
on:click={async () => {
on:click={async () => {
const res = await submitHandler();
const res = await submitHandler();
...
...
src/lib/components/chat/Settings/Audio.svelte
View file @
8a08ba07
...
@@ -251,7 +251,7 @@
...
@@ -251,7 +251,7 @@
<div class="flex justify-end pt-3 text-sm font-medium">
<div class="flex justify-end pt-3 text-sm font-medium">
<button
<button
class=" px-4 py-2 bg-emerald-
6
00 hover:bg-emerald-
7
00 text-gray-100 transition rounded"
class=" px-4 py-2 bg-emerald-
7
00 hover:bg-emerald-
8
00 text-gray-100 transition rounded
-lg
"
type="submit"
type="submit"
>
>
Save
Save
...
...
src/lib/components/chat/Settings/Connections.svelte
View file @
8a08ba07
...
@@ -247,7 +247,7 @@
...
@@ -247,7 +247,7 @@
<div class="flex justify-end pt-3 text-sm font-medium">
<div class="flex justify-end pt-3 text-sm font-medium">
<button
<button
class=" px-4 py-2 bg-emerald-
6
00 hover:bg-emerald-
7
00 text-gray-100 transition rounded"
class="
px-4 py-2 bg-emerald-
7
00 hover:bg-emerald-
8
00 text-gray-100 transition rounded
-lg
"
type="submit"
type="submit"
>
>
Save
Save
...
...
src/lib/components/chat/Settings/General.svelte
View file @
8a08ba07
...
@@ -262,7 +262,7 @@
...
@@ -262,7 +262,7 @@
<div class="flex justify-end pt-3 text-sm font-medium">
<div class="flex justify-end pt-3 text-sm font-medium">
<button
<button
class=" px-4 py-2 bg-emerald-
6
00 hover:bg-emerald-
7
00 text-gray-100 transition rounded"
class="
px-4 py-2 bg-emerald-
7
00 hover:bg-emerald-
8
00 text-gray-100 transition rounded
-lg
"
on:click={() => {
on:click={() => {
saveSettings({
saveSettings({
system: system !== '' ? system : undefined,
system: system !== '' ? system : undefined,
...
...
src/lib/components/chat/Settings/Images.svelte
View file @
8a08ba07
...
@@ -297,7 +297,7 @@
...
@@ -297,7 +297,7 @@
<div class="flex justify-end pt-3 text-sm font-medium">
<div class="flex justify-end pt-3 text-sm font-medium">
<button
<button
class=" px-4 py-2 bg-emerald-
6
00 hover:bg-emerald-
7
00 text-gray-100 transition rounded flex flex-row space-x-1 items-center {loading
class=" px-4 py-2 bg-emerald-
7
00 hover:bg-emerald-
8
00 text-gray-100 transition rounded
-lg
flex flex-row space-x-1 items-center {loading
? ' cursor-not-allowed'
? ' cursor-not-allowed'
: ''}"
: ''}"
type="submit"
type="submit"
...
...
src/lib/components/chat/Settings/Interface.svelte
View file @
8a08ba07
...
@@ -63,6 +63,7 @@
...
@@ -63,6 +63,7 @@
}
}
saveSettings({
saveSettings({
titleAutoGenerateModel: titleAutoGenerateModel !== '' ? titleAutoGenerateModel : undefined,
titleGenerationPrompt: titleGenerationPrompt ? titleGenerationPrompt : undefined
titleGenerationPrompt: titleGenerationPrompt ? titleGenerationPrompt : undefined
});
});
};
};
...
@@ -200,31 +201,8 @@
...
@@ -200,31 +201,8 @@
{/each}
{/each}
</select>
</select>
</div>
</div>
<button
class="px-2.5 bg-gray-200 hover:bg-gray-300 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-100 rounded-lg transition"
on:click={() => {
saveSettings({
titleAutoGenerateModel:
titleAutoGenerateModel !== '' ? titleAutoGenerateModel : undefined
});
}}
type="button"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 16 16"
fill="currentColor"
class="w-4 h-4"
>
<path
fill-rule="evenodd"
d="M12.416 3.376a.75.75 0 0 1 .208 1.04l-5 7.5a.75.75 0 0 1-1.154.114l-3-3a.75.75 0 0 1 1.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 0 1 1.04-.207Z"
clip-rule="evenodd"
/>
</svg>
</button>
</div>
</div>
<div class="mt-3">
<div class="mt-3
mr-2
">
<div class=" mb-2.5 text-sm font-medium">Title Generation Prompt</div>
<div class=" mb-2.5 text-sm font-medium">Title Generation Prompt</div>
<textarea
<textarea
bind:value={titleGenerationPrompt}
bind:value={titleGenerationPrompt}
...
@@ -321,7 +299,7 @@
...
@@ -321,7 +299,7 @@
<div class="flex justify-end pt-3 text-sm font-medium">
<div class="flex justify-end pt-3 text-sm font-medium">
<button
<button
class=" px-4 py-2 bg-emerald-
6
00 hover:bg-emerald-
7
00 text-gray-100 transition rounded"
class=" px-4 py-2 bg-emerald-
7
00 hover:bg-emerald-
8
00 text-gray-100 transition rounded
-lg
"
type="submit"
type="submit"
>
>
Save
Save
...
...
src/lib/components/chat/SettingsModal.svelte
View file @
8a08ba07
...
@@ -326,7 +326,7 @@
...
@@ -326,7 +326,7 @@
{getModels}
{getModels}
{saveSettings}
{saveSettings}
on:save={() => {
on:save={() => {
show = false
;
toast.success('Settings saved successfully!')
;
}}
}}
/>
/>
{:else if selectedTab === 'models'}
{:else if selectedTab === 'models'}
...
@@ -335,28 +335,28 @@
...
@@ -335,28 +335,28 @@
<Connections
<Connections
{getModels}
{getModels}
on:save={() => {
on:save={() => {
show = false
;
toast.success('Settings saved successfully!')
;
}}
}}
/>
/>
{:else if selectedTab === 'interface'}
{:else if selectedTab === 'interface'}
<Interface
<Interface
{saveSettings}
{saveSettings}
on:save={() => {
on:save={() => {
show = false
;
toast.success('Settings saved successfully!')
;
}}
}}
/>
/>
{:else if selectedTab === 'audio'}
{:else if selectedTab === 'audio'}
<Audio
<Audio
{saveSettings}
{saveSettings}
on:save={() => {
on:save={() => {
show = false
;
toast.success('Settings saved successfully!')
;
}}
}}
/>
/>
{:else if selectedTab === 'images'}
{:else if selectedTab === 'images'}
<Images
<Images
{saveSettings}
{saveSettings}
on:save={() => {
on:save={() => {
show = false
;
toast.success('Settings saved successfully!')
;
}}
}}
/>
/>
{:else if selectedTab === 'chats'}
{:else if selectedTab === 'chats'}
...
@@ -364,7 +364,7 @@
...
@@ -364,7 +364,7 @@
{:else if selectedTab === 'account'}
{:else if selectedTab === 'account'}
<Account
<Account
saveHandler={() => {
saveHandler={() => {
show = false
;
toast.success('Settings saved successfully!')
;
}}
}}
/>
/>
{:else if selectedTab === 'about'}
{:else if selectedTab === 'about'}
...
...
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