|
122 | 122 | <div class="flex justify-center py-8"><Spinner size={16} /></div> |
123 | 123 | {:else} |
124 | 124 | <!-- Search --> |
125 | | - <h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2">Search</h3> |
| 125 | + <h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2">{$t('admin.webSearch')}</h3> |
126 | 126 |
|
127 | 127 | <div class="flex flex-col gap-2.5"> |
128 | 128 | <label class="flex items-center justify-between cursor-pointer"> |
|
207 | 207 | </div> |
208 | 208 |
|
209 | 209 | <!-- Browser --> |
210 | | - <h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2 mt-5">Browser</h3> |
| 210 | + <h3 class="text-xs text-gray-400 dark:text-gray-600 mb-2 mt-5">{$t('admin.browser')}</h3> |
211 | 211 |
|
212 | 212 | <div class="flex flex-col gap-2.5"> |
213 | 213 | <label class="flex items-center justify-between cursor-pointer"> |
214 | | - <span class="text-xs text-gray-600 dark:text-gray-400">Browser tools</span> |
| 214 | + <span class="text-xs text-gray-600 dark:text-gray-400">{$t('admin.browserTools')}</span> |
215 | 215 | <ToggleSwitch value={browserEnabled} onchange={(v) => { browserEnabled = v; }} /> |
216 | 216 | </label> |
217 | 217 | <p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1"> |
218 | | - Give the AI access to a web browser for navigating pages, clicking elements, and taking screenshots. |
| 218 | + {$t('admin.browserHint')} |
219 | 219 | </p> |
220 | 220 |
|
221 | 221 | {#if browserEnabled} |
222 | 222 | <div class="flex items-center justify-between"> |
223 | | - <span class="text-xs text-gray-600 dark:text-gray-400">Provider</span> |
| 223 | + <span class="text-xs text-gray-600 dark:text-gray-400">{$t('admin.browserProvider')}</span> |
224 | 224 | <select |
225 | 225 | bind:value={browserProvider} |
226 | 226 | class="bg-transparent text-xs text-gray-600 dark:text-gray-400 outline-none cursor-pointer" |
227 | 227 | > |
228 | | - <option value="local">Local CDP</option> |
229 | | - <option value="firecrawl">Firecrawl</option> |
230 | | - <option value="browser_use">Browser-Use</option> |
| 228 | + <option value="local">{$t('admin.browserLocalCdp')}</option> |
| 229 | + <option value="firecrawl">{$t('admin.browserFirecrawl')}</option> |
| 230 | + <option value="browser_use">{$t('admin.browserBrowserUse')}</option> |
231 | 231 | </select> |
232 | 232 | </div> |
233 | 233 | <p class="text-[11px] text-gray-400 dark:text-gray-600 -mt-1"> |
234 | 234 | {#if browserProvider === 'local'} |
235 | | - Connects to Chrome via DevTools Protocol. Full interactive browsing with clicking, typing, and screenshots. |
| 235 | + {$t('admin.browserLocalHint')} |
236 | 236 | {:else if browserProvider === 'firecrawl'} |
237 | | - Cloud API that converts web pages to markdown. Fast extraction, no interactive browsing. |
| 237 | + {$t('admin.browserFirecrawlHint')} |
238 | 238 | {:else} |
239 | | - Cloud API for LLM-driven browser tasks. Describe what you need in natural language. |
| 239 | + {$t('admin.browserBrowserUseHint')} |
240 | 240 | {/if} |
241 | 241 | </p> |
242 | 242 |
|
243 | 243 | {#if browserProvider === 'local'} |
244 | 244 | <label class="flex items-center justify-between cursor-pointer"> |
245 | 245 | <div> |
246 | | - <span class="text-xs text-gray-600 dark:text-gray-400">Auto-launch Chrome</span> |
247 | | - <p class="text-[10px] text-gray-400 dark:text-gray-600">Start a headless Chrome if none is running</p> |
| 246 | + <span class="text-xs text-gray-600 dark:text-gray-400">{$t('admin.browserAutoLaunch')}</span> |
| 247 | + <p class="text-[10px] text-gray-400 dark:text-gray-600">{$t('admin.browserAutoLaunchHint')}</p> |
248 | 248 | </div> |
249 | 249 | <ToggleSwitch value={autoLaunch} onchange={(v) => { autoLaunch = v; }} /> |
250 | 250 | </label> |
251 | 251 |
|
252 | 252 | <div> |
253 | | - <label class="text-xs text-gray-600 dark:text-gray-400" for="cdp-url">CDP URL</label> |
| 253 | + <label class="text-xs text-gray-600 dark:text-gray-400" for="cdp-url">{$t('admin.browserCdpUrl')}</label> |
254 | 254 | <div class="flex gap-1.5 mt-1"> |
255 | 255 | <input id="cdp-url" type="text" bind:value={cdpUrl} placeholder="http://localhost:9222" |
256 | 256 | class="flex-1 h-7 px-2 rounded-lg text-xs bg-gray-100 dark:bg-white/6 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-white/8 outline-none focus:border-blue-400 dark:focus:border-blue-500 transition-colors" /> |
257 | 257 | <button |
258 | 258 | class="h-7 px-2.5 rounded-lg text-xs bg-gray-200/50 dark:bg-white/8 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white transition-colors disabled:opacity-50" |
259 | 259 | onclick={() => testConnection()} |
260 | 260 | disabled={testing} |
261 | | - >{testing ? '...' : 'Test'}</button> |
| 261 | + >{testing ? '...' : $t('admin.browserTest')}</button> |
262 | 262 | </div> |
263 | 263 | {#if testResult} |
264 | 264 | <p class="text-[11px] mt-1 {testResult.ok ? 'text-emerald-600 dark:text-emerald-400' : 'text-red-500'}"> |
|
268 | 268 | </div> |
269 | 269 |
|
270 | 270 | <div> |
271 | | - <label class="text-xs text-gray-600 dark:text-gray-400" for="session-timeout">Session timeout</label> |
| 271 | + <label class="text-xs text-gray-600 dark:text-gray-400" for="session-timeout">{$t('admin.browserSessionTimeout')}</label> |
272 | 272 | <div class="flex items-center gap-1.5 mt-1"> |
273 | 273 | <input id="session-timeout" type="number" bind:value={sessionTimeout} min="1" max="120" |
274 | 274 | class="w-16 h-7 px-2 rounded-lg text-xs bg-gray-100 dark:bg-white/6 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-white/8 outline-none focus:border-blue-400 dark:focus:border-blue-500 transition-colors" /> |
275 | | - <span class="text-[11px] text-gray-400 dark:text-gray-600">minutes</span> |
| 275 | + <span class="text-[11px] text-gray-400 dark:text-gray-600">{$t('admin.browserMinutes')}</span> |
276 | 276 | </div> |
277 | 277 | </div> |
278 | 278 | {:else if browserProvider === 'firecrawl'} |
279 | 279 | <div> |
280 | | - <label class="text-xs text-gray-600 dark:text-gray-400" for="fc-key">API Key</label> |
| 280 | + <label class="text-xs text-gray-600 dark:text-gray-400" for="fc-key">{$t('admin.browserApiKey')}</label> |
281 | 281 | <input id="fc-key" type="password" bind:value={firecrawlApiKey} placeholder="fc-..." |
282 | 282 | class="w-full mt-1 h-7 px-2 rounded-lg text-xs bg-gray-100 dark:bg-white/6 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-white/8 outline-none focus:border-blue-400 dark:focus:border-blue-500 transition-colors" /> |
283 | 283 | </div> |
284 | 284 | <div> |
285 | | - <label class="text-xs text-gray-600 dark:text-gray-400" for="fc-url">Base URL</label> |
| 285 | + <label class="text-xs text-gray-600 dark:text-gray-400" for="fc-url">{$t('admin.browserBaseUrl')}</label> |
286 | 286 | <input id="fc-url" type="text" bind:value={firecrawlBaseUrl} placeholder="https://api.firecrawl.dev" |
287 | 287 | class="w-full mt-1 h-7 px-2 rounded-lg text-xs bg-gray-100 dark:bg-white/6 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-white/8 outline-none focus:border-blue-400 dark:focus:border-blue-500 transition-colors" /> |
288 | | - <p class="text-[11px] text-gray-400 dark:text-gray-600 mt-0.5">Change for self-hosted Firecrawl instances</p> |
| 288 | + <p class="text-[11px] text-gray-400 dark:text-gray-600 mt-0.5">{$t('admin.browserFirecrawlBaseUrlHint')}</p> |
289 | 289 | </div> |
290 | 290 | {:else if browserProvider === 'browser_use'} |
291 | 291 | <div> |
292 | | - <label class="text-xs text-gray-600 dark:text-gray-400" for="bu-key">API Key</label> |
| 292 | + <label class="text-xs text-gray-600 dark:text-gray-400" for="bu-key">{$t('admin.browserApiKey')}</label> |
293 | 293 | <input id="bu-key" type="password" bind:value={browserUseApiKey} placeholder="bu-..." |
294 | 294 | class="w-full mt-1 h-7 px-2 rounded-lg text-xs bg-gray-100 dark:bg-white/6 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-white/8 outline-none focus:border-blue-400 dark:focus:border-blue-500 transition-colors" /> |
295 | 295 | </div> |
296 | 296 | <div> |
297 | | - <label class="text-xs text-gray-600 dark:text-gray-400" for="bu-url">Base URL</label> |
| 297 | + <label class="text-xs text-gray-600 dark:text-gray-400" for="bu-url">{$t('admin.browserBaseUrl')}</label> |
298 | 298 | <input id="bu-url" type="text" bind:value={browserUseBaseUrl} placeholder="https://api.browser-use.com" |
299 | 299 | class="w-full mt-1 h-7 px-2 rounded-lg text-xs bg-gray-100 dark:bg-white/6 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-white/8 outline-none focus:border-blue-400 dark:focus:border-blue-500 transition-colors" /> |
300 | 300 | </div> |
|
0 commit comments