revert(ui): remove NEXT_PUBLIC_LITELLM_PROXY_URL and getUiConfig changes from credential fix

These networking.tsx changes were only needed for the K8s port-forward
dev workflow. They are unrelated to the credential list staleness fix
and add unnecessary scope to this PR. Reverting to upstream baseline.

Co-Authored-By: Claude Sonnet 4 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bytechoreographer 2026-04-16 16:58:31 +08:00
parent 2a320b98a6
commit 32d93bb0ea

View file

@ -80,13 +80,10 @@ import NotificationsManager from "./molecules/notifications_manager";
const isLocal = process.env.NODE_ENV === "development";
// In dev, if NEXT_PUBLIC_USE_REWRITES=true the Next.js dev server proxies API calls
// to the backend — use relative URLs (null) so rewrites can intercept them.
// NEXT_PUBLIC_LITELLM_PROXY_URL overrides the hardcoded localhost:4000 default,
// which is useful when running the frontend against a port-forwarded K8s backend.
const defaultProxyBaseUrl =
process.env.NEXT_PUBLIC_LITELLM_PROXY_URL ??
(isLocal && process.env.NEXT_PUBLIC_USE_REWRITES !== "true"
isLocal && process.env.NEXT_PUBLIC_USE_REWRITES !== "true"
? "http://localhost:4000"
: null);
: null;
const defaultServerRootPath = "/";
export let serverRootPath = defaultServerRootPath;
const WORKER_URL_KEY = "litellm_worker_url";
@ -126,7 +123,10 @@ const updateProxyBaseUrl = (serverRootPath: string, receivedProxyBaseUrl: string
return;
}
const browserLocation = getWindowLocation();
const resolvedDefaultProxyBaseUrl = defaultProxyBaseUrl ?? browserLocation?.origin ?? null;
const resolvedDefaultProxyBaseUrl =
isLocal && process.env.NEXT_PUBLIC_USE_REWRITES !== "true"
? "http://localhost:4000"
: browserLocation?.origin ?? null;
let initialProxyBaseUrl = receivedProxyBaseUrl || resolvedDefaultProxyBaseUrl;
console.log("proxyBaseUrl:", proxyBaseUrl);
console.log("serverRootPath:", serverRootPath);