From 79859f6a823de38176a10e8e1db41caedd3cad6f Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Mon, 3 Jun 2024 17:43:56 -0700 Subject: [PATCH] ui - basic filter by api key, --- ui/litellm-dashboard/src/app/page.tsx | 1 + .../src/components/model_dashboard.tsx | 73 ++++++++++++++++++- 2 files changed, 70 insertions(+), 4 deletions(-) diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx index 9c56abdf73c..c218a8aad60 100644 --- a/ui/litellm-dashboard/src/app/page.tsx +++ b/ui/litellm-dashboard/src/app/page.tsx @@ -138,6 +138,7 @@ const CreateKeyPage = () => { userID={userID} userRole={userRole} token={token} + keys={keys} accessToken={accessToken} modelData={modelData} setModelData={setModelData} diff --git a/ui/litellm-dashboard/src/components/model_dashboard.tsx b/ui/litellm-dashboard/src/components/model_dashboard.tsx index 1504e251a96..8a7c3980cb2 100644 --- a/ui/litellm-dashboard/src/components/model_dashboard.tsx +++ b/ui/litellm-dashboard/src/components/model_dashboard.tsx @@ -56,6 +56,7 @@ import { BarChart, AreaChart } from "@tremor/react"; import { Button as Button2, Modal, + Popover, Form, Input, Select as Select2, @@ -80,6 +81,7 @@ import { RefreshIcon, CheckCircleIcon, XCircleIcon, + FilterIcon, } from "@heroicons/react/outline"; import DeleteModelButton from "./delete_model_button"; const { Title: Title2, Link } = Typography; @@ -96,6 +98,7 @@ interface ModelDashboardProps { userRole: string | null; userID: string | null; modelData: any; + keys: any[] | null; setModelData: any; premiumUser: boolean; } @@ -260,6 +263,7 @@ const ModelDashboard: React.FC = ({ userRole, userID, modelData = { data: [] }, + keys, setModelData, premiumUser, }) => { @@ -313,6 +317,8 @@ const ModelDashboard: React.FC = ({ const [globalExceptionData, setGlobalExceptionData] = useState({} as GlobalExceptionActivityData); const [globalExceptionPerDeployment, setGlobalExceptionPerDeployment] = useState([]); + const [showAdvancedFilters, setShowAdvancedFilters] = useState(false); + function formatCreatedAt(createdAt: string | null) { if (createdAt) { const date = new Date(createdAt); @@ -969,6 +975,53 @@ const ModelDashboard: React.FC = ({ } }; + + const FilterByContent = ( +
+ Select API Key Name + + + + + {/* Select Customer + */} + +
+ + ); + const customTooltip = (props: any) => { const { payload, active } = props; if (!active || !payload) return null; @@ -1722,9 +1775,7 @@ const ModelDashboard: React.FC = ({ - {/*

View how requests were load balanced within a model group

*/} - - + Select Time Range = ({ ))} + + + + + + @@ -2035,7 +2100,7 @@ const ModelDashboard: React.FC = ({
- + ); };