switch off prod logs on ui

This commit is contained in:
Ishaan Jaff 2024-07-30 13:23:45 -07:00
parent c2289afee8
commit f9e6ac0542
15 changed files with 48 additions and 11 deletions

View file

@ -91,7 +91,7 @@ const AdminPanel: React.FC<AdminPanelProps> = ({
>>(null);
const isLocal = process.env.NODE_ENV === "development";
if (isLocal === true) {
if (isLocal != true) {
console.log = function() {};
}
const [baseUrl, setBaseUrl] = useState(

View file

@ -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);

View file

@ -43,7 +43,7 @@ const Createuser: React.FC<CreateuserProps> = ({
useState<InvitationLink | null>(null);
const router = useRouter();
const isLocal = process.env.NODE_ENV === "development";
if (isLocal === true) {
if (isLocal != true) {
console.log = function() {};
}
const [baseUrl, setBaseUrl] = useState(

View file

@ -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);

View file

@ -43,7 +43,7 @@ const Navbar: React.FC<NavbarProps> = ({
// 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;

View file

@ -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() {};
}

View file

@ -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<string, any>): void {
// This function does nothing for now
}

View file

@ -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,

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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;

View file

@ -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 {

View file

@ -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;

View file

@ -52,6 +52,11 @@ interface ViewUserDashboardProps {
teams: any[] | null;
setKeys: React.Dispatch<React.SetStateAction<Object[] | null>>;
}
const isLocal = process.env.NODE_ENV === "development";
const proxyBaseUrl = isLocal ? "http://localhost:4000" : null;
if (isLocal != true) {
console.log = function() {};
}
const ViewUserDashboard: React.FC<ViewUserDashboardProps> = ({
accessToken,