Spaces:
Build error
Build error
Make model branding customizable based on env var (#345)
Browse files* rm open assistant branding
* Update SettingsModal.svelte
* make settings work with a dynamic list of models
* fixed types
---------
Co-authored-by: Nathan Sarrazin <[email protected]>
src/lib/components/SettingsModal.svelte
CHANGED
@@ -8,8 +8,10 @@
|
|
8 |
import { enhance } from "$app/forms";
|
9 |
import { base } from "$app/paths";
|
10 |
import { PUBLIC_APP_DATA_SHARING } from "$env/static/public";
|
|
|
11 |
|
12 |
export let settings: Pick<Settings, "shareConversationsWithModelAuthors">;
|
|
|
13 |
|
14 |
let shareConversationsWithModelAuthors = settings.shareConversationsWithModelAuthors;
|
15 |
let isConfirmingDeletion = false;
|
@@ -52,22 +54,21 @@
|
|
52 |
<p class="text-gray-800">
|
53 |
You can change this setting at any time, it applies to all your conversations.
|
54 |
</p>
|
55 |
-
<
|
56 |
-
Read more about model authors
|
57 |
-
<
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
</p>
|
71 |
{/if}
|
72 |
<form
|
73 |
method="post"
|
|
|
8 |
import { enhance } from "$app/forms";
|
9 |
import { base } from "$app/paths";
|
10 |
import { PUBLIC_APP_DATA_SHARING } from "$env/static/public";
|
11 |
+
import type { Model } from "$lib/types/Model";
|
12 |
|
13 |
export let settings: Pick<Settings, "shareConversationsWithModelAuthors">;
|
14 |
+
export let models: Array<Model>;
|
15 |
|
16 |
let shareConversationsWithModelAuthors = settings.shareConversationsWithModelAuthors;
|
17 |
let isConfirmingDeletion = false;
|
|
|
54 |
<p class="text-gray-800">
|
55 |
You can change this setting at any time, it applies to all your conversations.
|
56 |
</p>
|
57 |
+
<div>
|
58 |
+
<p class="text-gray-800 ">Read more about model authors:</p>
|
59 |
+
<ul class="list-inside list-disc">
|
60 |
+
{#each models as model}
|
61 |
+
<li class="list-item">
|
62 |
+
<a
|
63 |
+
href={model["websiteUrl"]}
|
64 |
+
target="_blank"
|
65 |
+
rel="noreferrer"
|
66 |
+
class="underline decoration-gray-300 hover:decoration-gray-700">{model["name"]}</a
|
67 |
+
>
|
68 |
+
</li>
|
69 |
+
{/each}
|
70 |
+
</ul>
|
71 |
+
</div>
|
|
|
72 |
{/if}
|
73 |
<form
|
74 |
method="post"
|
src/routes/+layout.svelte
CHANGED
@@ -176,7 +176,11 @@
|
|
176 |
<Toast message={currentError} />
|
177 |
{/if}
|
178 |
{#if isSettingsOpen}
|
179 |
-
<SettingsModal
|
|
|
|
|
|
|
|
|
180 |
{/if}
|
181 |
{#if requiresLogin && data.messagesBeforeLogin === 0}
|
182 |
<LoginModal settings={data.settings} />
|
|
|
176 |
<Toast message={currentError} />
|
177 |
{/if}
|
178 |
{#if isSettingsOpen}
|
179 |
+
<SettingsModal
|
180 |
+
on:close={() => (isSettingsOpen = false)}
|
181 |
+
settings={data.settings}
|
182 |
+
models={data.models}
|
183 |
+
/>
|
184 |
{/if}
|
185 |
{#if requiresLogin && data.messagesBeforeLogin === 0}
|
186 |
<LoginModal settings={data.settings} />
|