From 7b2e210c7b6d8b1433244e1ab0e0acc737c8f500 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 16 May 2024 13:29:17 -0700 Subject: [PATCH 1/2] ui - fix end user timezone diff --- ui/litellm-dashboard/src/components/usage.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ui/litellm-dashboard/src/components/usage.tsx b/ui/litellm-dashboard/src/components/usage.tsx index 6f03c296031..54383376737 100644 --- a/ui/litellm-dashboard/src/components/usage.tsx +++ b/ui/litellm-dashboard/src/components/usage.tsx @@ -142,6 +142,12 @@ const UsagePage: React.FC = ({ return; } + // the endTime put it to the last hour of the selected date + endTime.setHours(23, 59, 59, 999); + + // startTime put it to the first hour of the selected date + startTime.setHours(0, 0, 0, 0); + console.log("uiSelectedKey", uiSelectedKey); let newTopUserData = await adminTopEndUsersCall( @@ -160,6 +166,12 @@ const UsagePage: React.FC = ({ return; } + // the endTime put it to the last hour of the selected date + endTime.setHours(23, 59, 59, 999); + + // startTime put it to the first hour of the selected date + startTime.setHours(0, 0, 0, 0); + let top_tags = await tagsSpendLogsCall(accessToken, startTime.toISOString(), endTime.toISOString()); setTopTagsData(top_tags.spend_per_tag); console.log("Tag spend data updated successfully"); From 0fbe12ef3d2ec51e26c7e5df5745effe70f549f4 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Thu, 16 May 2024 13:37:38 -0700 Subject: [PATCH 2/2] fix don't let tag spend logs raise an error on usage tab --- ui/litellm-dashboard/src/components/networking.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx index a405d4440b8..bb7899755b9 100644 --- a/ui/litellm-dashboard/src/components/networking.tsx +++ b/ui/litellm-dashboard/src/components/networking.tsx @@ -675,7 +675,6 @@ export const tagsSpendLogsCall = async ( }); if (!response.ok) { const errorData = await response.text(); - message.error(errorData, 10); throw new Error("Network response was not ok"); }