Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ui/litellm-dashboard/src/components/BetaBadge.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Badge } from "antd";

export default function BetaBadge({ children, dot = false }: { children?: React.ReactNode; dot?: boolean }) {
return children ? (
<Badge color="gold" count={dot ? undefined : "Beta"} dot={dot}>
{children}
</Badge>
) : (
<Badge color="gold" count={dot ? undefined : "Beta"} dot={dot} />
);
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
3 changes: 2 additions & 1 deletion ui/litellm-dashboard/src/components/leftnav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
rolesAllowedToViewWriteScopedPages,
rolesWithWriteAccess,
} from "../utils/roles";
import BetaBadge from "./BetaBadge";
import NewBadge from "./common_components/NewBadge";
import type { Organization } from "./networking";
import SidebarAccountMenu from "./SidebarAccountMenu/SidebarAccountMenu";
Expand Down Expand Up @@ -211,7 +212,7 @@
page: "projects",
label: (
<span className="flex items-center gap-2">
Projects <NewBadge />
Projects <BetaBadge />
</span>
),
icon: <Folder {...ICON} />,
Expand Down Expand Up @@ -435,7 +436,7 @@
const isAdmin = isAdminRole(userRole);
return items
.map((item) => ({ ...item, children: item.children ? filterItemsByRole(item.children) : undefined }))
.filter((item) => {

Check warning on line 439 in ui/litellm-dashboard/src/components/leftnav.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Arrow function has a complexity of 29. Maximum allowed is 20
if (item.key === "organizations" || item.key === "users") {
const hasRoleAccess = !item.roles || item.roles.includes(userRole) || isOrgAdmin;
if (!hasRoleAccess) return false;
Expand All @@ -445,14 +446,14 @@
if (item.key === "projects" && !enableProjectsUI) return false;
if (item.key === "chat" && !enableChatUI) return false;
if (
!isAdmin &&

Check warning on line 449 in ui/litellm-dashboard/src/components/leftnav.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Boolean expression combines 4 conditions; extract it into a named variable
item.key === "agents" &&
disableAgentsForInternalUsers &&
!(allowAgentsForTeamAdmins && isTeamAdmin)
)
return false;
if (
!isAdmin &&

Check warning on line 456 in ui/litellm-dashboard/src/components/leftnav.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Boolean expression combines 4 conditions; extract it into a named variable
item.key === "vector-stores" &&
disableVectorStoresForInternalUsers &&
!(allowVectorStoresForTeamAdmins && isTeamAdmin)
Expand Down Expand Up @@ -491,7 +492,7 @@

const handleLeafClick = (e: React.MouseEvent, item: MenuItem) => {
if (item.external_url) return;
if (e.metaKey || e.ctrlKey || e.shiftKey || e.button === 1) return;

Check warning on line 495 in ui/litellm-dashboard/src/components/leftnav.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Boolean expression combines 4 conditions; extract it into a named variable
e.preventDefault();
setPage(item.page);
};
Expand Down Expand Up @@ -578,7 +579,7 @@
<div className="flex items-center justify-between gap-2 group-data-[collapsed=true]/sidebar:flex-col">
<div className="flex min-w-0 items-center gap-2">
<Link href={baseUrl || "/"} className="flex min-w-0 items-center" aria-label="LiteLLM home">
<img

Check warning on line 582 in ui/litellm-dashboard/src/components/leftnav.tsx

View workflow job for this annotation

GitHub Actions / frontend-lint

Using `<img>` could result in slower LCP and higher bandwidth. Consider using `<Image />` from `next/image` or a custom image loader to automatically optimize images. This may incur additional usage or cost from your provider. See: https://nextjs.org/docs/messages/no-img-element
src={logoSrc}
alt="LiteLLM"
className="h-7 w-auto max-w-[150px] object-contain group-data-[collapsed=true]/sidebar:w-7"
Expand Down
Loading