1
- import { createSignal , useContext } from "solid-js" ;
1
+ import { useContext } from "solid-js" ;
2
2
import { createToast } from "../../components/ShowToasts" ;
3
3
import { ApiRoutes } from "../../components/Routes" ;
4
4
import { DatasetContext } from "../../contexts/DatasetContext" ;
@@ -105,7 +105,7 @@ export const PublicPageSettings = () => {
105
105
</ label >
106
106
< input
107
107
placeholder = "https://cdn.trieve.ai/favicon.ico"
108
- value = { "" }
108
+ value = { extra_params . brandLogoImgSrcUrl || "" }
109
109
onInput = { ( e ) => {
110
110
setExtraParams ( "brandLogoImgSrcUrl" , e . currentTarget . value ) ;
111
111
} }
@@ -117,8 +117,8 @@ export const PublicPageSettings = () => {
117
117
Brand Name
118
118
</ label >
119
119
< input
120
- placeholder = "https://example.com/openapi.json "
121
- value = { "" }
120
+ placeholder = "Trieve "
121
+ value = { extra_params . brandName || "" }
122
122
onInput = { ( e ) => {
123
123
setExtraParams ( "brandName" , e . currentTarget . value ) ;
124
124
} }
@@ -131,9 +131,9 @@ export const PublicPageSettings = () => {
131
131
</ label >
132
132
< input
133
133
placeholder = "light"
134
- value = { "" }
134
+ value = { extra_params . theme || "" }
135
135
onInput = { ( e ) => {
136
- setExtraParams ( "theme" , e . currentTarget . value ) ;
136
+ setExtraParams ( "theme" , e . currentTarget . value === "dark" ? "dark" : "light" ) ;
137
137
} }
138
138
class = "block w-full rounded border border-neutral-300 px-3 py-1.5 shadow-sm placeholder:text-neutral-400 focus:outline-magenta-500 sm:text-sm sm:leading-6"
139
139
/>
@@ -144,7 +144,7 @@ export const PublicPageSettings = () => {
144
144
</ label >
145
145
< input
146
146
placeholder = "#CB53EB"
147
- value = { "" }
147
+ value = { extra_params . accentColor || "" }
148
148
onInput = { ( e ) => {
149
149
setExtraParams ( "accentColor" , e . currentTarget . value ) ;
150
150
} }
@@ -160,8 +160,8 @@ export const PublicPageSettings = () => {
160
160
Problem Link
161
161
</ label >
162
162
< input
163
- placeholder = "https://example.com/openapi.json "
164
- value = { "" }
163
+ placeholder = "mailto:[email protected] "
164
+ value = { extra_params . problemLink || "" }
165
165
onInput = { ( e ) => {
166
166
setExtraParams ( "problemLink" , e . currentTarget . value ) ;
167
167
} }
@@ -175,11 +175,10 @@ export const PublicPageSettings = () => {
175
175
Responsive View
176
176
</ label >
177
177
< input
178
- placeholder = "Search..."
179
- value = { "" }
178
+ checked = { extra_params . responsive || false }
180
179
type = "checkbox"
181
180
onInput = { ( e ) => {
182
- setExtraParams ( "responsive" , e . currentTarget . value ) ;
181
+ setExtraParams ( "responsive" , e . currentTarget . value === "true" ) ;
183
182
} }
184
183
class = "block w-4 rounded border border-neutral-300 px-3 py-1.5 shadow-sm placeholder:text-neutral-400 focus:outline-magenta-500 sm:text-sm sm:leading-6"
185
184
/>
@@ -189,11 +188,10 @@ export const PublicPageSettings = () => {
189
188
Analytics
190
189
</ label >
191
190
< input
192
- placeholder = "Search..."
193
- value = { "" }
191
+ checked = { extra_params . analytics || true }
194
192
type = "checkbox"
195
- onInput = { ( e ) => {
196
- setExtraParams ( "analytics" , e . currentTarget . value ) ;
193
+ onChange = { ( e ) => {
194
+ setExtraParams ( "analytics" , e . currentTarget . checked ) ;
197
195
} }
198
196
class = "block w-4 rounded border border-neutral-300 px-3 py-1.5 shadow-sm placeholder:text-neutral-400 focus:outline-magenta-500 sm:text-sm sm:leading-6"
199
197
/>
@@ -204,10 +202,10 @@ export const PublicPageSettings = () => {
204
202
</ label >
205
203
< input
206
204
placeholder = "Search..."
207
- value = { "" }
205
+ checked = { extra_params . suggestedQueries || true }
208
206
type = "checkbox"
209
- onInput = { ( e ) => {
210
- setExtraParams ( "suggestedQueries" , e . currentTarget . value ) ;
207
+ onChange = { ( e ) => {
208
+ setExtraParams ( "suggestedQueries" , e . currentTarget . checked ) ;
211
209
} }
212
210
class = "block w-4 rounded border border-neutral-300 px-3 py-1.5 shadow-sm placeholder:text-neutral-400 focus:outline-magenta-500 sm:text-sm sm:leading-6"
213
211
/>
@@ -218,10 +216,10 @@ export const PublicPageSettings = () => {
218
216
</ label >
219
217
< input
220
218
placeholder = "Search..."
221
- value = { "" }
219
+ checked = { extra_params . chat || true }
222
220
type = "checkbox"
223
- onInput = { ( e ) => {
224
- setExtraParams ( "chat" , e . currentTarget . value ) ;
221
+ onChange = { ( e ) => {
222
+ setExtraParams ( "chat" , e . currentTarget . checked ) ;
225
223
} }
226
224
class = "block w-4 rounded border border-neutral-300 px-3 py-1.5 shadow-sm placeholder:text-neutral-400 focus:outline-magenta-500 sm:text-sm sm:leading-6"
227
225
/>
@@ -239,7 +237,7 @@ export const PublicPageSettings = () => {
239
237
value = { ( ) => {
240
238
return extra_params ?. searchOptions || { }
241
239
} }
242
- onError = { ( error ) => { } }
240
+ onError = { ( _ ) => { } }
243
241
/>
244
242
</ div >
245
243
< div class = "p-2 space-y-1.5" >
@@ -287,6 +285,3 @@ export const PublicPageSettings = () => {
287
285
</ div >
288
286
) ;
289
287
} ;
290
- function useDatasetServerConfig ( ) {
291
- throw new Error ( "Function not implemented." ) ;
292
- }
0 commit comments