Skip to content

Commit

Permalink
feat enforce viweing analytivs by service behing enterprise
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaan-jaff committed Jun 4, 2024
1 parent c1bac5e commit 3a6d5a2
Showing 1 changed file with 83 additions and 2 deletions.
85 changes: 83 additions & 2 deletions ui/litellm-dashboard/src/components/model_dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1025,9 +1025,11 @@ const ModelDashboard: React.FC<ModelDashboardProps> = ({
const FilterByContent = (
<div >
<Text className="mb-1">Select API Key Name</Text>


<Select defaultValue="all-keys">
{
premiumUser ? (
<div>
<Select defaultValue="all-keys">
<SelectItem
key="all-keys"
value="all-keys"
Expand Down Expand Up @@ -1092,6 +1094,85 @@ const ModelDashboard: React.FC<ModelDashboardProps> = ({
}
</Select>

</div>
): (
<div>

<Select defaultValue="all-keys">
<SelectItem
key="all-keys"
value="all-keys"
onClick={() => {
setSelectedAPIKey(null);
}}
>
All Keys
</SelectItem>
{keys?.map((key: any, index: number) => {
if (
key &&
key["key_alias"] !== null &&
key["key_alias"].length > 0
) {
return (

<SelectItem
key={index}
value={String(index)}
// @ts-ignore
disabled={true}
onClick={() => {
setSelectedAPIKey(key);
}}
>
{key["key_alias"]} (Enterpise only Feature)
</SelectItem>
);
}
return null; // Add this line to handle the case when the condition is not met
})}
</Select>


<Text className="mt-1">
Select Customer Name
</Text>

<Select defaultValue="all-customers">
<SelectItem
key="all-customers"
value="all-customers"
onClick={() => {
setSelectedCustomer(null);
}}
>
All Customers
</SelectItem>
{
allEndUsers?.map((user: any, index: number) => {
return (
<SelectItem
key={index}
value={user}
// @ts-ignore
disabled={true}
onClick={() => {
setSelectedCustomer(user);
}}
>
{user} (Enterpise only Feature)
</SelectItem>
);
})
}
</Select>

</div>
)
}





</div>
Expand Down

0 comments on commit 3a6d5a2

Please sign in to comment.