From 785db6738fa4646edd032d2aa3eb2e1ebb082187 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Sat, 28 Feb 2026 18:00:36 -0800 Subject: [PATCH] feat(ui): add RoutingGroupsView component --- .../routing_groups/RoutingGroupsView.tsx | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 ui/litellm-dashboard/src/components/routing_groups/RoutingGroupsView.tsx diff --git a/ui/litellm-dashboard/src/components/routing_groups/RoutingGroupsView.tsx b/ui/litellm-dashboard/src/components/routing_groups/RoutingGroupsView.tsx new file mode 100644 index 00000000000..3d620b5d340 --- /dev/null +++ b/ui/litellm-dashboard/src/components/routing_groups/RoutingGroupsView.tsx @@ -0,0 +1,112 @@ +"use client"; + +import React, { useState } from "react"; +import { Button, Divider, Typography } from "antd"; +import { PlusOutlined, CloseOutlined } from "@ant-design/icons"; +import RoutingGroupsTable from "./RoutingGroupsTable"; +import RoutingGroupBuilder from "./RoutingGroupBuilder"; +import LiveTester from "./LiveTester"; + +interface RoutingGroupsViewProps { + accessToken: string | null; + userRole: string; + userId: string; +} + +export default function RoutingGroupsView({ + accessToken, + userRole, + userId, +}: RoutingGroupsViewProps) { + const [createModalVisible, setCreateModalVisible] = useState(false); + const [editTarget, setEditTarget] = useState | null>(null); + const [refreshKey, setRefreshKey] = useState(0); + const [selectedGroup, setSelectedGroup] = useState | null>(null); + + const handleEdit = (group: Record) => { + setEditTarget(group); + setCreateModalVisible(true); + }; + + const handleTest = (group: Record) => { + setSelectedGroup(group); + }; + + const handleClose = () => { + setCreateModalVisible(false); + setEditTarget(null); + }; + + const handleSuccess = () => { + setCreateModalVisible(false); + setEditTarget(null); + setRefreshKey((k) => k + 1); + }; + + return ( +
+
+
+ + Routing Groups + + + Configure named routing pipelines with fallback strategies + +
+ +
+ + + + {selectedGroup && accessToken && ( + <> + +
+ + Testing:{" "} + + {selectedGroup.routing_group_name as string} + + + +
+ + + )} + + {createModalVisible && ( + + )} +
+ ); +}