Skip to content

Commit 8f2b429

Browse files
committed
feat: add API Base URL display in Application Settings
1 parent 461d434 commit 8f2b429

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/routes/settings/(nav)/application/+page.svelte

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,36 @@
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

0 commit comments

Comments
 (0)