diff --git a/ui/litellm-dashboard/src/components/admins.tsx b/ui/litellm-dashboard/src/components/admins.tsx index af4a3bdd65..5388393ba1 100644 --- a/ui/litellm-dashboard/src/components/admins.tsx +++ b/ui/litellm-dashboard/src/components/admins.tsx @@ -91,7 +91,7 @@ const AdminPanel: React.FC = ({ >>(null); const isLocal = process.env.NODE_ENV === "development"; - if (isLocal === true) { + if (isLocal != true) { console.log = function() {}; } const [baseUrl, setBaseUrl] = useState( diff --git a/ui/litellm-dashboard/src/components/chat_ui.tsx b/ui/litellm-dashboard/src/components/chat_ui.tsx index e38c005c4b..8764dbb8c4 100644 --- a/ui/litellm-dashboard/src/components/chat_ui.tsx +++ b/ui/litellm-dashboard/src/components/chat_ui.tsx @@ -45,7 +45,7 @@ async function generateModelResponse( ) { // base url should be the current base_url const isLocal = process.env.NODE_ENV === "development"; - if (isLocal === true) { + if (isLocal != true) { console.log = function() {}; } console.log("isLocal:", isLocal); diff --git a/ui/litellm-dashboard/src/components/create_user_button.tsx b/ui/litellm-dashboard/src/components/create_user_button.tsx index 498d032f57..dc8298d380 100644 --- a/ui/litellm-dashboard/src/components/create_user_button.tsx +++ b/ui/litellm-dashboard/src/components/create_user_button.tsx @@ -43,7 +43,7 @@ const Createuser: React.FC = ({ useState(null); const router = useRouter(); const isLocal = process.env.NODE_ENV === "development"; - if (isLocal === true) { + if (isLocal != true) { console.log = function() {}; } const [baseUrl, setBaseUrl] = useState( diff --git a/ui/litellm-dashboard/src/components/general_settings.tsx b/ui/litellm-dashboard/src/components/general_settings.tsx index 1f7037b498..f80ca203ba 100644 --- a/ui/litellm-dashboard/src/components/general_settings.tsx +++ b/ui/litellm-dashboard/src/components/general_settings.tsx @@ -76,7 +76,7 @@ async function testFallbackModelResponse( ) { // base url should be the current base_url const isLocal = process.env.NODE_ENV === "development"; - if (isLocal === true) { + if (isLocal != true) { console.log = function() {}; } console.log("isLocal:", isLocal); diff --git a/ui/litellm-dashboard/src/components/navbar.tsx b/ui/litellm-dashboard/src/components/navbar.tsx index eba5cad78c..4d1e387717 100644 --- a/ui/litellm-dashboard/src/components/navbar.tsx +++ b/ui/litellm-dashboard/src/components/navbar.tsx @@ -43,7 +43,7 @@ const Navbar: React.FC = ({ // const userColors = require('./ui_colors.json') || {}; const isLocal = process.env.NODE_ENV === "development"; - if (isLocal === true) { + if (isLocal != true) { console.log = function() {}; } const proxyBaseUrl = isLocal ? "http://localhost:4000" : null; diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx index 7d68e7a9de..d85f73c3af 100644 --- a/ui/litellm-dashboard/src/components/networking.tsx +++ b/ui/litellm-dashboard/src/components/networking.tsx @@ -5,7 +5,7 @@ import { message } from "antd"; const isLocal = process.env.NODE_ENV === "development"; const proxyBaseUrl = isLocal ? "http://localhost:4000" : null; -if (isLocal === true) { +if (isLocal != true) { console.log = function() {}; } diff --git a/ui/litellm-dashboard/src/components/request_model_access.tsx b/ui/litellm-dashboard/src/components/request_model_access.tsx index c884d03b2c..22fcafa4e4 100644 --- a/ui/litellm-dashboard/src/components/request_model_access.tsx +++ b/ui/litellm-dashboard/src/components/request_model_access.tsx @@ -12,7 +12,11 @@ interface RequestAccessProps { accessToken: string; userID: string; } - +const isLocal = process.env.NODE_ENV === "development"; +const proxyBaseUrl = isLocal ? "http://localhost:4000" : null; +if (isLocal != true) { + console.log = function() {}; +} function onRequestAccess(formData: Record): void { // This function does nothing for now } diff --git a/ui/litellm-dashboard/src/components/settings.tsx b/ui/litellm-dashboard/src/components/settings.tsx index fe2735d4aa..482cfdd735 100644 --- a/ui/litellm-dashboard/src/components/settings.tsx +++ b/ui/litellm-dashboard/src/components/settings.tsx @@ -34,6 +34,11 @@ import { import { Modal, Typography, Form, Input, Select, Button as Button2, message } from "antd"; const { Title, Paragraph } = Typography; +const isLocal = process.env.NODE_ENV === "development"; +const proxyBaseUrl = isLocal ? "http://localhost:4000" : null; +if (isLocal != true) { + console.log = function() {}; +} import { getCallbacksCall, setCallbacksCall, diff --git a/ui/litellm-dashboard/src/components/teams.tsx b/ui/litellm-dashboard/src/components/teams.tsx index 8b4b803b56..bd8a8d095f 100644 --- a/ui/litellm-dashboard/src/components/teams.tsx +++ b/ui/litellm-dashboard/src/components/teams.tsx @@ -36,6 +36,11 @@ import { Grid, } from "@tremor/react"; import { CogIcon } from "@heroicons/react/outline"; +const isLocal = process.env.NODE_ENV === "development"; +const proxyBaseUrl = isLocal ? "http://localhost:4000" : null; +if (isLocal != true) { + console.log = function() {}; +} interface TeamProps { teams: any[] | null; searchParams: any; diff --git a/ui/litellm-dashboard/src/components/usage.tsx b/ui/litellm-dashboard/src/components/usage.tsx index 451eaefe67..15c991d80e 100644 --- a/ui/litellm-dashboard/src/components/usage.tsx +++ b/ui/litellm-dashboard/src/components/usage.tsx @@ -37,6 +37,12 @@ import { adminGlobalActivityPerModel, } from "./networking"; import { start } from "repl"; +console.log("process.env.NODE_ENV", process.env.NODE_ENV); +const isLocal = process.env.NODE_ENV === "development"; +const proxyBaseUrl = isLocal ? "http://localhost:4000" : null; +if (isLocal !== true) { + console.log = function() {}; +} interface UsagePageProps { accessToken: string | null; diff --git a/ui/litellm-dashboard/src/components/user_dashboard.tsx b/ui/litellm-dashboard/src/components/user_dashboard.tsx index f8326054c1..61ec058475 100644 --- a/ui/litellm-dashboard/src/components/user_dashboard.tsx +++ b/ui/litellm-dashboard/src/components/user_dashboard.tsx @@ -17,7 +17,7 @@ import { useSearchParams, useRouter } from "next/navigation"; import { jwtDecode } from "jwt-decode"; import { Typography } from "antd"; const isLocal = process.env.NODE_ENV === "development"; -if (isLocal === true) { +if (isLocal != true) { console.log = function() {}; } console.log("isLocal:", isLocal); diff --git a/ui/litellm-dashboard/src/components/view_key_table.tsx b/ui/litellm-dashboard/src/components/view_key_table.tsx index 3add65503b..93395c7ff1 100644 --- a/ui/litellm-dashboard/src/components/view_key_table.tsx +++ b/ui/litellm-dashboard/src/components/view_key_table.tsx @@ -34,7 +34,11 @@ import { } from "antd"; const { Option } = Select; - +const isLocal = process.env.NODE_ENV === "development"; +const proxyBaseUrl = isLocal ? "http://localhost:4000" : null; +if (isLocal != true) { + console.log = function() {}; +} interface EditKeyModalProps { visible: boolean; diff --git a/ui/litellm-dashboard/src/components/view_user_spend.tsx b/ui/litellm-dashboard/src/components/view_user_spend.tsx index 326dedee95..7879dfdb57 100644 --- a/ui/litellm-dashboard/src/components/view_user_spend.tsx +++ b/ui/litellm-dashboard/src/components/view_user_spend.tsx @@ -23,7 +23,11 @@ import { } from "@tremor/react"; import { Statistic } from "antd" import { spendUsersCall, modelAvailableCall } from "./networking"; - +const isLocal = process.env.NODE_ENV === "development"; +const proxyBaseUrl = isLocal ? "http://localhost:4000" : null; +if (isLocal != true) { + console.log = function() {}; +} // Define the props type interface UserSpendData { diff --git a/ui/litellm-dashboard/src/components/view_user_team.tsx b/ui/litellm-dashboard/src/components/view_user_team.tsx index cbc58e5f70..483420ccc0 100644 --- a/ui/litellm-dashboard/src/components/view_user_team.tsx +++ b/ui/litellm-dashboard/src/components/view_user_team.tsx @@ -21,7 +21,11 @@ import { } from "@tremor/react"; import { Statistic } from "antd" import { modelAvailableCall } from "./networking"; - +const isLocal = process.env.NODE_ENV === "development"; +const proxyBaseUrl = isLocal ? "http://localhost:4000" : null; +if (isLocal != true) { + console.log = function() {}; +} interface ViewUserTeamProps { userID: string | null; diff --git a/ui/litellm-dashboard/src/components/view_users.tsx b/ui/litellm-dashboard/src/components/view_users.tsx index 6b1deee6ef..75d2b2656a 100644 --- a/ui/litellm-dashboard/src/components/view_users.tsx +++ b/ui/litellm-dashboard/src/components/view_users.tsx @@ -52,6 +52,11 @@ interface ViewUserDashboardProps { teams: any[] | null; setKeys: React.Dispatch>; } +const isLocal = process.env.NODE_ENV === "development"; +const proxyBaseUrl = isLocal ? "http://localhost:4000" : null; +if (isLocal != true) { + console.log = function() {}; +} const ViewUserDashboard: React.FC = ({ accessToken,