File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
src/routes/settings/(nav)/application Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 1010 import { base } from " $app/paths" ;
1111 import { page } from " $app/state" ;
1212 import { usePublicConfig } from " $lib/utils/PublicConfig.svelte" ;
13- import { useAPIClient } from " $lib/APIClient" ;
13+ import { useAPIClient , handleResponse } from " $lib/APIClient" ;
14+ import { onMount } from " svelte" ;
1415
1516 const publicConfig = usePublicConfig ();
1617 let settings = useSettingsStore ();
1718
1819 const client = useAPIClient ();
20+
21+ let OPENAI_BASE_URL: string | null = null ;
22+ onMount (async () => {
23+ try {
24+ const cfg = await client .debug .config .get ().then (handleResponse );
25+ OPENAI_BASE_URL = (cfg as { OPENAI_BASE_URL? : string }).OPENAI_BASE_URL || null ;
26+ } catch (e ) {
27+ // ignore if debug endpoint is unavailable
28+ }
29+ });
1930 </script >
2031
2132<div class =" flex w-full flex-col gap-4" >
2233 <h2 class =" text-center text-lg font-semibold text-gray-800 md:text-left" >Application Settings</h2 >
34+
35+ {#if OPENAI_BASE_URL !== null }
36+ <div
37+ class =" mt-1 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2 text-[12px] text-gray-700"
38+ >
39+ <span class =" font-medium" >API Base URL:</span >
40+ <code class ="ml-1 break-all font-mono text-[12px] text-gray-800" >{OPENAI_BASE_URL }</code >
41+ </div >
42+ {/if }
2343 {#if !! publicConfig .PUBLIC_COMMIT_SHA }
2444 <div class =" flex flex-col items-start justify-between text-xl font-semibold text-gray-800" >
2545 <a
You can’t perform that action at this time.
0 commit comments