removing unused imports

This commit is contained in:
Achintya Rajan
2025-10-10 10:24:57 -07:00
parent d944717d4b
commit 5fca481ebb
108 changed files with 169 additions and 508 deletions
+5 -1
View File
@@ -1,3 +1,7 @@
{
"extends": "next/core-web-vitals"
"extends": "next/core-web-vitals",
"plugins": ["unused-imports"],
"rules": {
"unused-imports/no-unused-imports": "error"
}
}
+16
View File
@@ -56,6 +56,7 @@
"autoprefixer": "^10.4.17",
"eslint": "^8",
"eslint-config-next": "14.2.32",
"eslint-plugin-unused-imports": "^4.2.0",
"jsdom": "^27.0.0",
"postcss": "^8.4.33",
"prettier": "3.2.5",
@@ -10702,6 +10703,21 @@
"semver": "bin/semver.js"
}
},
"node_modules/eslint-plugin-unused-imports": {
"version": "4.2.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.2.0.tgz",
"integrity": "sha512-hLbJ2/wnjKq4kGA9AUaExVFIbNzyxYdVo49QZmKCnhk5pc9wcYRbfgLHvWJ8tnsdcseGhoUAddm9gn/lt+d74w==",
"dev": true,
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "^8.0.0-0 || ^7.0.0 || ^6.0.0 || ^5.0.0",
"eslint": "^9.0.0 || ^8.0.0"
},
"peerDependenciesMeta": {
"@typescript-eslint/eslint-plugin": {
"optional": true
}
}
},
"node_modules/eslint-scope": {
"version": "7.2.2",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz",
+1
View File
@@ -61,6 +61,7 @@
"autoprefixer": "^10.4.17",
"eslint": "^8",
"eslint-config-next": "14.2.32",
"eslint-plugin-unused-imports": "^4.2.0",
"jsdom": "^27.0.0",
"postcss": "^8.4.33",
"prettier": "3.2.5",
@@ -9,7 +9,6 @@ import {
Text,
Badge,
Icon,
Button,
Card,
} from "@tremor/react";
import { Tooltip } from "antd";
@@ -1,4 +1,4 @@
import { teamListCall, DEFAULT_ORGANIZATION, Organization } from "../networking";
import { teamListCall, Organization } from "../networking";
export const fetchTeams = async (
accessToken: string,
@@ -1,6 +1,6 @@
import React from "react";
import { Select, TextInput } from "@tremor/react";
import { Form, Radio, Select as AntSelect } from "antd";
import { Form, Select as AntSelect } from "antd";
import TeamDropdown from "./team_dropdown";
import { getPossibleUserRoles } from "../networking";
import TextArea from "antd/es/input/TextArea";
@@ -2,7 +2,6 @@ import { useState, useCallback } from "react";
import { Modal, Form, Button, Select, Tooltip } from "antd";
import debounce from "lodash/debounce";
import { userFilterUICall } from "@/components/networking";
import { InfoCircleOutlined } from "@ant-design/icons";
interface User {
user_id: string;
user_email: string;
@@ -1,6 +1,5 @@
import React, { useState, useEffect } from "react";
import { useRouter } from "next/navigation";
import { Button, Modal, Form, Input, message, Select, InputNumber, Select as Select2 } from "antd";
import { Button, Modal, Form, Input, Select, Select as Select2 } from "antd";
import {
Button as Button2,
Text,
@@ -3,7 +3,7 @@
import React, { useState } from "react";
import { Grid, Col, Icon } from "@tremor/react";
import { Title } from "@tremor/react";
import { Modal, message } from "antd";
import { Modal } from "antd";
import { modelDeleteCall } from "./networking";
import { TrashIcon } from "@heroicons/react/outline";
import NotificationsManager from "./molecules/notifications_manager";
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from "react";
import { Modal, Form, Button, Select as AntdSelect, message } from "antd";
import { Modal, Form, Button, Select as AntdSelect } from "antd";
import { Text, TextInput } from "@tremor/react";
import { modelAvailableCall, modelPatchUpdateCall } from "../networking";
import { fetchAvailableModels, ModelGroup } from "../chat_ui/llm_calls/fetch_models";
@@ -1,5 +1,5 @@
import React from "react";
import { Modal, Form, InputNumber, message } from "antd";
import { Modal, Form, InputNumber } from "antd";
import { TextInput } from "@tremor/react";
import { Button as Button2 } from "antd";
import { modelUpdateCall } from "../networking";
@@ -1,7 +1,7 @@
import { useEffect, useState } from "react";
import { Dialog, DialogPanel, TextInput, Button, Select, SelectItem, Text, Title, Subtitle } from "@tremor/react";
import { TextInput, SelectItem } from "@tremor/react";
import { Button as Button2, Modal, Form, Input, Select as Select2, message, InputNumber } from "antd";
import { Button as Button2, Modal, Form, Select as Select2, InputNumber } from "antd";
import NumericalInput from "./shared/numerical_input";
import BudgetDurationDropdown from "./common_components/budget_duration_dropdown";
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react";
import { Card, Text, Grid, Button } from "@tremor/react";
import { Card, Text, Button } from "@tremor/react";
import { Typography, Divider, Spin, Checkbox } from "antd";
import NotificationsManager from "../molecules/notifications_manager";
import { getEmailEventSettings, updateEmailEventSettings, resetEmailEventSettings } from "../networking";
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import React from "react";
import { Card, Text, Grid, Button, TextInput, TableCell } from "@tremor/react";
import { Typography } from "antd";
import NotificationManager from "./molecules/notifications_manager";
@@ -2,7 +2,6 @@ import React, { useState, useEffect } from "react";
import {
Card,
Title,
Subtitle,
Table,
TableHead,
TableRow,
@@ -10,7 +9,6 @@ import {
TableHeaderCell,
TableCell,
TableBody,
Metric,
Text,
Grid,
Button,
@@ -21,33 +19,20 @@ import {
Accordion,
AccordionBody,
AccordionHeader,
AccordionList,
} from "@tremor/react";
import { TabPanel, TabPanels, TabGroup, TabList, Tab, Icon } from "@tremor/react";
import {
getCallbacksCall,
setCallbacksCall,
getGeneralSettingsCall,
serviceHealthCheck,
updateConfigFieldSetting,
deleteConfigFieldSetting,
} from "./networking";
import { Modal, Form, Input, Select, Button as Button2, message, InputNumber } from "antd";
import {
InformationCircleIcon,
PencilAltIcon,
PencilIcon,
StatusOnlineIcon,
TrashIcon,
RefreshIcon,
CheckCircleIcon,
XCircleIcon,
QuestionMarkCircleIcon,
} from "@heroicons/react/outline";
import { Form, InputNumber } from "antd";
import { TrashIcon, CheckCircleIcon } from "@heroicons/react/outline";
import AddFallbacks from "./add_fallbacks";
import openai from "openai";
import Paragraph from "antd/es/skeleton/Paragraph";
import NotificationsManager from "./molecules/notifications_manager";
interface GeneralSettingsPageProps {
accessToken: string | null;
@@ -1,7 +1,6 @@
import React, { useState, useEffect, useCallback } from "react";
import React, { useState, useCallback } from "react";
import { Card, Title, Text, Table, TableHead, TableRow, TableHeaderCell, TableCell, TableBody } from "@tremor/react";
import { message, Input } from "antd";
import { EditOutlined, DeleteOutlined, SaveOutlined, CloseOutlined } from "@ant-design/icons";
import { Input } from "antd";
import { ChevronDownIcon, ChevronRightIcon, PlusCircleIcon } from "@heroicons/react/outline";
import NotificationManager from "./molecules/notifications_manager";
@@ -1,7 +1,6 @@
import React, { useState, useEffect } from "react";
import { Card, Text, Button, Icon, TextInput } from "@tremor/react";
import { PlusIcon } from "@heroicons/react/outline";
import { Modal, message } from "antd";
import { Button } from "@tremor/react";
import { Modal } from "antd";
import { getGuardrailsList, deleteGuardrailCall } from "./networking";
import AddGuardrailForm from "./guardrails/add_guardrail_form";
import GuardrailTable from "./guardrails/guardrail_table";
@@ -1,6 +1,5 @@
import React, { useEffect, useState } from "react";
import { Select, Typography, Tooltip } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import { Select } from "antd";
import { Guardrail } from "./types";
import { getGuardrailsList } from "../networking";
@@ -1,24 +1,7 @@
import React, { useState, useEffect } from "react";
import {
Card,
Form,
Typography,
Select,
Input,
Switch,
Tooltip,
Modal,
message,
Divider,
Space,
Tag,
Image,
Steps,
} from "antd";
import { Form, Typography, Select, Modal, Tag, Steps } from "antd";
import { Button, TextInput } from "@tremor/react";
import type { FormInstance } from "antd";
import {
GuardrailProviders,
guardrail_provider_map,
shouldRenderPIIConfigSettings,
guardrailLogoMap,
@@ -1,7 +1,6 @@
import React, { useState } from "react";
import { Button, Space, Card, message } from "antd";
import { Button, Space, Card } from "antd";
import AzureTextModerationConfiguration from "./azure_text_moderation_configuration";
import { AZURE_TEXT_MODERATION_CATEGORIES } from "./azure_text_moderation_types";
import NotificationsManager from "../molecules/notifications_manager";
/**
@@ -1,12 +1,7 @@
import React, { useState, useEffect } from "react";
import { Form, Typography, Select, Input, Switch, Modal, message, Divider } from "antd";
import { Form, Typography, Select, Input, Switch, Modal } from "antd";
import { Button, TextInput } from "@tremor/react";
import {
GuardrailProviders,
guardrail_provider_map,
guardrailLogoMap,
getGuardrailProviders,
} from "./guardrail_info_helpers";
import { guardrail_provider_map, guardrailLogoMap, getGuardrailProviders } from "./guardrail_info_helpers";
import { getGuardrailUISettings } from "../networking";
import PiiConfiguration from "./pii_configuration";
import NotificationsManager from "../molecules/notifications_manager";
@@ -13,8 +13,7 @@ import {
TabPanels,
TextInput,
} from "@tremor/react";
import { Button, Form, Input, Select, message, Tooltip, Divider } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import { Button, Form, Input, Select, Divider } from "antd";
import {
getGuardrailInfo,
updateGuardrailCall,
@@ -2,7 +2,6 @@ import React, { useState, useEffect } from "react";
import { Form, Select, Spin } from "antd";
import { TextInput } from "@tremor/react";
import {
GuardrailProviders,
guardrail_provider_map,
populateGuardrailProviders,
populateGuardrailProviderMap,
@@ -2,7 +2,6 @@ import React, { useState, useEffect } from "react";
import { Form, Select, Spin } from "antd";
import { TextInput } from "@tremor/react";
import {
GuardrailProviders,
guardrail_provider_map,
populateGuardrailProviders,
populateGuardrailProviderMap,
@@ -1,7 +1,7 @@
import React, { useState } from "react";
import { Typography, Badge } from "antd";
import { PiiConfigurationProps } from "./types";
import { CategoryFilter, QuickActions, PiiEntityList, formatEntityName, getActionIcon } from "./pii_components";
import { CategoryFilter, QuickActions, PiiEntityList } from "./pii_components";
const { Title, Text } = Typography;
@@ -4,7 +4,6 @@ import { keyListCall, Organization } from "../networking";
import { Team } from "../key_team_helpers/key_list";
import { useQuery } from "@tanstack/react-query";
import { fetchAllKeyAliases, fetchAllOrganizations, fetchAllTeams } from "./filter_helpers";
import { Setter } from "@/types";
import { debounce } from "lodash";
import { defaultPageSize } from "../constants";
@@ -1,8 +1,7 @@
import React, { useState } from "react";
import { Form, Input, Button, Space } from "antd";
import { Button, Space } from "antd";
import { MinusCircleOutlined, PlusOutlined } from "@ant-design/icons";
import { TextInput, Grid, Col } from "@tremor/react";
import { TrashIcon } from "@heroicons/react/outline";
import { TextInput } from "@tremor/react";
interface KeyValueInputProps {
value?: Record<string, string>;
@@ -1,8 +1,4 @@
import { Layout, Menu } from "antd";
import Link from "next/link";
import { List } from "postcss/lib/list";
import { Text, Button } from "@tremor/react";
import { useState } from "react";
import {
KeyOutlined,
PlayCircleOutlined,
@@ -16,27 +12,14 @@ import {
AppstoreOutlined,
DatabaseOutlined,
FileTextOutlined,
LineOutlined,
LineChartOutlined,
SafetyOutlined,
ExperimentOutlined,
ThunderboltOutlined,
LockOutlined,
ToolOutlined,
TagsOutlined,
BgColorsOutlined,
MenuFoldOutlined,
MenuUnfoldOutlined,
} from "@ant-design/icons";
import {
old_admin_roles,
v2_admin_role_names,
all_admin_roles,
rolesAllowedToSeeUsage,
rolesWithWriteAccess,
internalUserRoles,
isAdminRole,
} from "../utils/roles";
import { all_admin_roles, rolesWithWriteAccess, internalUserRoles, isAdminRole } from "../utils/roles";
import UsageIndicator from "./usage_indicator";
import { ConfigProvider } from "antd";
const { Sider } = Layout;
@@ -1,5 +1,5 @@
import React, { useState, useCallback, useEffect } from "react";
import { Modal, Form, Steps, Button, message, Checkbox } from "antd";
import { Modal, Form, Steps, Button, Checkbox } from "antd";
import { Text, Title, Badge } from "@tremor/react";
import { makeModelGroupPublic } from "./networking";
import ModelFilters from "./model_filters";
@@ -1,5 +1,5 @@
import React from "react";
import { Typography, Space, Button, Divider, message } from "antd";
import { Typography, Space, Button, Divider } from "antd";
import { WarningOutlined, InfoCircleOutlined, CopyOutlined } from "@ant-design/icons";
import { testMCPConnectionRequest } from "./networking";
import NotificationsManager from "./molecules/notifications_manager";
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import React, { useEffect } from "react";
import { Form, Select, Tooltip, Collapse } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import { MCPServer } from "./types";
@@ -1,8 +1,8 @@
import React from "react";
import { Button, Callout, TextInput } from "@tremor/react";
import { Button, TextInput } from "@tremor/react";
import { MCPTool, InputSchema } from "./types";
import { Form, Tooltip, message } from "antd";
import { InfoCircleOutlined, ClockCircleOutlined } from "@ant-design/icons";
import { Form, Tooltip } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import NotificationsManager from "../molecules/notifications_manager";
export function ToolTestPanel({
@@ -1,5 +1,5 @@
import React, { useState } from "react";
import { Modal, Tooltip, Form, Select, message, Button as AntdButton, Input } from "antd";
import { Modal, Tooltip, Form, Select } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import { Button, TextInput } from "@tremor/react";
import { createMCPServer } from "../networking";
@@ -1,20 +1,9 @@
/* eslint-disable react/no-unescaped-entities */
import React, { useState } from "react";
import { Card, Typography, Space, Alert, Button, message, Switch, Input, Form, Collapse } from "antd";
import { Card, Typography, Space, Alert, Button, Switch, Form, Collapse } from "antd";
import { TabPanel, TabPanels, TabGroup, TabList, Tab, Title as TremorTitle, Text as TremorText } from "@tremor/react";
import {
CopyIcon,
Code,
Terminal,
Globe,
CheckIcon,
ExternalLinkIcon,
ShieldAlertIcon,
KeyIcon,
ServerIcon,
Zap,
} from "lucide-react";
import { CopyIcon, Code, Terminal, Globe, CheckIcon, ExternalLinkIcon, KeyIcon, ServerIcon, Zap } from "lucide-react";
import { getProxyBaseUrl } from "../networking";
import { copyToClipboard as utilCopyToClipboard } from "../../utils/dataUtils";
@@ -1,12 +1,11 @@
import React, { useState, useEffect } from "react";
import { Form, Select, Button as AntdButton, message, Input, Space, Tooltip } from "antd";
import { Form, Select, Button as AntdButton } from "antd";
import { Button, TextInput, TabGroup, TabList, Tab, TabPanels, TabPanel } from "@tremor/react";
import { MCPServer, MCPServerCostInfo } from "./types";
import { updateMCPServer, testMCPToolsListRequest } from "../networking";
import MCPServerCostConfig from "./mcp_server_cost_config";
import MCPPermissionManagement from "./MCPPermissionManagement";
import MCPToolConfiguration from "./mcp_tool_configuration";
import { MinusCircleOutlined, PlusOutlined, InfoCircleOutlined } from "@ant-design/icons";
import { validateMCPServerUrl, validateMCPServerName } from "./utils";
import NotificationsManager from "../molecules/notifications_manager";
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from "react";
import { useQuery } from "@tanstack/react-query";
import { Modal, message, Select, Tooltip } from "antd";
import { Modal, Select, Tooltip } from "antd";
import { TabPanel, TabPanels, TabGroup, TabList, Tab, Button } from "@tremor/react";
import { Grid, Col, Title, Text } from "@tremor/react";
import { DataTable } from "../view_logs/table";
@@ -3,11 +3,11 @@ import { useQuery, useMutation } from "@tanstack/react-query";
import { ToolTestPanel } from "./ToolTestPanel";
import { MCPTool, MCPToolsViewerProps, CallMCPToolResponse, mcpServerHasAuth } from "./types";
import { listMCPTools, callMCPTool } from "../networking";
import { getMCPAuthToken, setMCPAuthToken, removeMCPAuthToken, hasMCPAuthToken } from "./mcp_auth_storage";
import { getMCPAuthToken, setMCPAuthToken, removeMCPAuthToken } from "./mcp_auth_storage";
import { Modal, Input, Form, message } from "antd";
import { Modal, Input, Form } from "antd";
import { Button, Card, Title, Text } from "@tremor/react";
import { RobotOutlined, ApiOutlined, KeyOutlined, SafetyOutlined, ToolOutlined } from "@ant-design/icons";
import { RobotOutlined, SafetyOutlined, ToolOutlined } from "@ant-design/icons";
import { AUTH_TYPE } from "./types";
import NotificationsManager from "../molecules/notifications_manager";
@@ -1,8 +1,7 @@
import React, { useEffect, useState } from "react";
import { Card, Form, Button, Tooltip, Typography, Select as AntdSelect, Input, Switch, Modal } from "antd";
import { Form, Button, Tooltip, Typography, Select as AntdSelect, Modal } from "antd";
import type { UploadProps } from "antd/es/upload";
import { Providers, providerLogoMap } from "../provider_info_helpers";
import type { FormInstance } from "antd";
import ProviderSpecificFields from "../add_model/provider_specific_fields";
import { TextInput } from "@tremor/react";
import { CredentialItem } from "../networking";
@@ -11,27 +11,17 @@ import {
Badge,
Button,
} from "@tremor/react";
import {
InformationCircleIcon,
PencilAltIcon,
PencilIcon,
RefreshIcon,
StatusOnlineIcon,
TrashIcon,
} from "@heroicons/react/outline";
import { PencilAltIcon, TrashIcon } from "@heroicons/react/outline";
import { UploadProps } from "antd/es/upload";
import { PlusIcon } from "@heroicons/react/solid";
import {
credentialListCall,
credentialCreateCall,
credentialDeleteCall,
credentialUpdateCall,
CredentialItem,
CredentialsResponse,
} from "@/components/networking"; // Assume this is your networking function
import AddCredentialsTab from "./add_credentials_tab";
import CredentialDeleteModal from "./CredentialDeleteModal";
import { Form, message } from "antd";
import { Form } from "antd";
import NotificationsManager from "../molecules/notifications_manager";
interface CredentialsPanelProps {
accessToken: string | null;
@@ -1,5 +1,5 @@
import React from "react";
import { Form, Input } from "antd";
import { Form } from "antd";
import { TextInput } from "@tremor/react";
interface Field {
field_name: string;
@@ -1,9 +1,5 @@
import React, { useState } from "react";
import { Card, Form, Button, Tooltip, Typography, Select as AntdSelect, Input, Switch, Modal } from "antd";
import type { UploadProps } from "antd/es/upload";
import { Providers, providerLogoMap } from "../provider_info_helpers";
import type { FormInstance } from "antd";
import ProviderSpecificFields from "../add_model/provider_specific_fields";
import React from "react";
import { Form, Button, Tooltip, Typography, Modal } from "antd";
import { TextInput } from "@tremor/react";
import { CredentialItem } from "../networking";
const { Title, Link } = Typography;
@@ -1,6 +1,6 @@
import React, { useState, useEffect, useRef } from "react";
import { Title, Text, Button, Badge } from "@tremor/react";
import { Modal, message } from "antd";
import { Modal } from "antd";
import { Button as AntdButton } from "antd";
import { ModelDataTable } from "./table";
import { healthCheckColumns } from "./health_check_columns";
@@ -1,5 +1,4 @@
import { ColumnDef } from "@tanstack/react-table";
import { Button, Badge } from "@tremor/react";
import { Tooltip, Checkbox } from "antd";
import { Text } from "@tremor/react";
import { InformationCircleIcon, PlayIcon, RefreshIcon } from "@heroicons/react/outline";
@@ -1,4 +1,3 @@
import { Fragment } from "react";
import {
ColumnDef,
flexRender,
@@ -8,7 +7,6 @@ import {
useReactTable,
ColumnResizeMode,
VisibilityState,
PaginationState,
} from "@tanstack/react-table";
import React from "react";
import { Table, TableHead, TableHeaderCell, TableBody, TableRow, TableCell } from "@tremor/react";
@@ -1,5 +1,4 @@
import React, { useState, useEffect } from "react";
import { message } from "antd";
import { PlusCircleIcon, PencilIcon, TrashIcon, ChevronDownIcon, ChevronRightIcon } from "@heroicons/react/outline";
import { setCallbacksCall } from "./networking";
import { Card, Title, Text, Table, TableHead, TableHeaderCell, TableBody, TableRow, TableCell } from "@tremor/react";
@@ -1,15 +1,15 @@
import React, { useEffect, useState, useRef, useCallback } from "react";
import { useRouter, useSearchParams } from "next/navigation";
import { modelHubCall, makeModelGroupPublic, modelHubPublicModelsCall, getProxyBaseUrl } from "./networking";
import { getConfigFieldSetting, updateConfigFieldSetting } from "./networking";
import { useRouter } from "next/navigation";
import { modelHubCall, modelHubPublicModelsCall, getProxyBaseUrl } from "./networking";
import { getConfigFieldSetting } from "./networking";
import { ModelDataTable } from "./model_dashboard/table";
import { modelHubColumns } from "./model_hub_table_columns";
import PublicModelHub from "./public_model_hub";
import MakeModelPublicForm from "./make_model_public_form";
import ModelFilters from "./model_filters";
import UsefulLinksManagement from "./useful_links_management";
import { Card, Text, Title, Button, Badge, Flex } from "@tremor/react";
import { Modal, message, Tooltip } from "antd";
import { Card, Text, Title, Button, Badge } from "@tremor/react";
import { Modal } from "antd";
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
import { Table as TableInstance } from "@tanstack/react-table";
import { Copy } from "lucide-react";
@@ -9,7 +9,6 @@ import {
TabPanel,
TabPanels,
Grid,
Badge,
Button as TremorButton,
TextInput,
} from "@tremor/react";
@@ -17,22 +16,17 @@ import NumericalInput from "./shared/numerical_input";
import { ArrowLeftIcon, TrashIcon, KeyIcon } from "@heroicons/react/outline";
import {
modelDeleteCall,
modelUpdateCall,
CredentialItem,
credentialGetCall,
credentialCreateCall,
modelInfoCall,
modelInfoV1Call,
modelPatchUpdateCall,
getGuardrailsList,
} from "./networking";
import { Button, Form, Input, InputNumber, message, Select, Modal, Tooltip } from "antd";
import { Button, Form, Input, Select, Modal, Tooltip } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import EditModelModal from "./edit_model/edit_model_modal";
import { handleEditModelSubmit } from "./edit_model/edit_model_modal";
import { getProviderLogoAndName } from "./provider_info_helpers";
import { getDisplayModelName } from "./view_model/model_name_display";
import AddCredentialsModal from "./model_add/add_credentials_tab";
import ReuseCredentialsModal from "./model_add/reuse_credentials";
import CacheControlSettings from "./add_model/cache_control_settings";
import { CheckIcon, CopyIcon } from "lucide-react";
@@ -1,5 +1,5 @@
import React from "react";
import { LineChart, Callout, Button } from "@tremor/react";
import { LineChart } from "@tremor/react";
interface TimeToFirstTokenProps {
modelMetrics: any[];
modelMetricsCategories: string[];
@@ -3,9 +3,7 @@ import { Button, Badge, Icon } from "@tremor/react";
import { Tooltip } from "antd";
import { getProviderLogoAndName } from "../../provider_info_helpers";
import { ModelData } from "../../model_dashboard/types";
import { TrashIcon, PencilIcon, PencilAltIcon, KeyIcon } from "@heroicons/react/outline";
import DeleteModelButton from "../../delete_model_button";
import { useState } from "react";
import { TrashIcon, KeyIcon } from "@heroicons/react/outline";
export const columns = (
userRole: string,
@@ -2,13 +2,10 @@ import Link from "next/link";
import React, { useState, useEffect } from "react";
import type { MenuProps } from "antd";
import { Dropdown, Tooltip, Switch } from "antd";
import { getProxyBaseUrl, Organization } from "@/components/networking";
import { defaultOrg } from "@/components/common_components/default_org";
import { getProxyBaseUrl } from "@/components/networking";
import {
UserOutlined,
LogoutOutlined,
LoginOutlined,
BgColorsOutlined,
CrownOutlined,
MailOutlined,
SafetyOutlined,
@@ -44,7 +41,7 @@ const Navbar: React.FC<NavbarProps> = ({
accessToken,
isPublicPage = false,
sidebarCollapsed = false,
onToggleSidebar
onToggleSidebar,
}) => {
const baseUrl = getProxyBaseUrl();
const [logoutUrl, setLogoutUrl] = useState("");
@@ -8,17 +8,9 @@ export const formatDate = (date: Date) => {
/**
* Helper file for calls being made to proxy
*/
import { all_admin_roles } from "@/utils/roles";
import { message } from "antd";
import { clearTokenCookies } from "@/utils/cookieUtils";
import {
TagNewRequest,
TagUpdateRequest,
TagDeleteRequest,
TagInfoRequest,
TagListResponse,
TagInfoResponse,
} from "./tag_management/types";
import { TagNewRequest, TagUpdateRequest, TagListResponse, TagInfoResponse } from "./tag_management/types";
import { Team } from "./key_team_helpers/key_list";
import { UserInfo } from "./view_users/types";
import { EmailEventSettingsResponse, EmailEventSettingsUpdateRequest } from "./email_events/types";
@@ -3125,9 +3117,7 @@ export const keyListCall = async (
}
};
export const keyAliasesCall = async (
accessToken: String
): Promise<{ aliases: string[] }> => {
export const keyAliasesCall = async (accessToken: String): Promise<{ aliases: string[] }> => {
/**
* Get all key aliases from proxy
*/
@@ -3159,7 +3149,6 @@ export const keyAliasesCall = async (
}
};
export const spendUsersCall = async (accessToken: String, userID: String) => {
try {
const url = proxyBaseUrl ? `${proxyBaseUrl}/spend/users` : `/spend/users`;
@@ -26,13 +26,9 @@ import {
TableHeaderCell,
TableBody,
TableCell,
Subtitle,
DateRangePicker,
DateRangePickerValue,
Button,
} from "@tremor/react";
import AdvancedDatePicker from "./shared/advanced_date_picker";
import { AreaChart } from "@tremor/react";
import { userDailyActivityCall, userDailyActivityAggregatedCall, tagListCall } from "./networking";
import { Tag } from "./tag_management/types";
@@ -40,16 +36,9 @@ import ViewUserSpend from "./view_user_spend";
import TopKeyView from "./top_key_view";
import { ActivityMetrics, processActivityData } from "./activity_metrics";
import UserAgentActivity from "./user_agent_activity";
import { SpendMetrics, DailyData, ModelActivityData, MetricWithMetadata, KeyMetricWithMetadata } from "./usage/types";
import { DailyData, MetricWithMetadata, KeyMetricWithMetadata } from "./usage/types";
import EntityUsage from "./entity_usage";
import {
old_admin_roles,
v2_admin_role_names,
all_admin_roles,
rolesAllowedToSeeUsage,
rolesWithWriteAccess,
internalUserRoles,
} from "../utils/roles";
import { all_admin_roles } from "../utils/roles";
import { Team } from "./key_team_helpers/key_list";
import { EntityList } from "./entity_usage";
import { formatNumberWithCommas } from "@/utils/dataUtils";
@@ -1,5 +1,5 @@
import React from "react";
import { Modal, message, Typography } from "antd";
import { Modal, Typography } from "antd";
import { CopyToClipboard } from "react-copy-to-clipboard";
import { Text, Button } from "@tremor/react";
import NotificationsManager from "./molecules/notifications_manager";
@@ -1,15 +1,14 @@
"use client";
import React, { useState, useEffect, useRef, useCallback } from "react";
import { Button, TextInput, Grid, Col, Select as TremorSelect, SelectItem } from "@tremor/react";
import { Card, Metric, Text, Title, Subtitle, Accordion, AccordionHeader, AccordionBody } from "@tremor/react";
import React, { useState, useEffect, useCallback } from "react";
import { Button, TextInput, Grid, Col } from "@tremor/react";
import { Text, Title, Accordion, AccordionHeader, AccordionBody } from "@tremor/react";
import { CopyToClipboard } from "react-copy-to-clipboard";
import { Button as Button2, Modal, Form, Input, Select, message, Radio } from "antd";
import { Button as Button2, Modal, Form, Input, Select, Radio } from "antd";
import NumericalInput from "../shared/numerical_input";
import { unfurlWildcardModelsInList, getModelDisplayName } from "../key_team_helpers/fetch_available_models_team_key";
import { getModelDisplayName } from "../key_team_helpers/fetch_available_models_team_key";
import SchemaFormFields from "../common_components/check_openapi_schema";
import {
keyCreateCall,
slackBudgetAlertsHealthCheck,
modelAvailableCall,
getGuardrailsList,
proxyBaseUrl,
@@ -30,7 +29,7 @@ import debounce from "lodash/debounce";
import { rolesWithWriteAccess } from "../../utils/roles";
import BudgetDurationDropdown from "../common_components/budget_duration_dropdown";
import { formatNumberWithCommas } from "@/utils/dataUtils";
import { callback_map, mapDisplayToInternalNames } from "../callback_info_helpers";
import { mapDisplayToInternalNames } from "../callback_info_helpers";
import MCPServerSelector from "../mcp_server_management/MCPServerSelector";
import MCPToolPermissions from "../mcp_server_management/MCPToolPermissions";
import ModelAliasManager from "../common_components/ModelAliasManager";
@@ -390,7 +389,6 @@ const CreateKey: React.FC<CreateKeyProps> = ({
formValues.aliases = JSON.stringify(modelAliases);
}
let response;
if (keyOwner === "service_account") {
response = await keyCreateServiceAccountCall(accessToken, formValues);
@@ -1007,9 +1005,9 @@ const CreateKey: React.FC<CreateKeyProps> = ({
<Input type="hidden" />
</Form.Item>
<Form.Item
<Form.Item
noStyle
shouldUpdate={(prevValues, currentValues) =>
shouldUpdate={(prevValues, currentValues) =>
prevValues.allowed_mcp_servers_and_groups !== currentValues.allowed_mcp_servers_and_groups ||
prevValues.mcp_tool_permissions !== currentValues.mcp_tool_permissions
}
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react";
import { Button, Text, TextInput, Title, Grid, Col } from "@tremor/react";
import { Modal, Form, InputNumber, message } from "antd";
import { Modal, Form, InputNumber } from "antd";
import { add } from "date-fns";
import { regenerateKeyCall } from "../networking";
import { KeyResponse } from "../key_team_helpers/key_list";
@@ -2,7 +2,7 @@
* This component is used to add an admin to an organization.
*/
import React, { FC } from "react";
import { Button, Select, Col, Text } from "@tremor/react";
import { Button, Col, Text } from "@tremor/react";
import { Button as Button2, Select as Select2, Modal, Form, Input } from "antd";
import { Organization } from "@/components/organization/types";
interface AddOrgAdminProps {
@@ -21,8 +21,7 @@ import {
Icon,
} from "@tremor/react";
import NumericalInput from "../shared/numerical_input";
import { Button, Form, Input, Select, message, Tooltip } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import { Button, Form, Input, Select } from "antd";
import { ArrowLeftIcon, PencilAltIcon, TrashIcon } from "@heroicons/react/outline";
import { getModelDisplayName } from "../key_team_helpers/fetch_available_models_team_key";
import {
@@ -1,5 +1,3 @@
import { Member } from "../networking";
export interface EditModalProps {
visible: boolean;
onCancel: () => void;
@@ -1,18 +1,7 @@
import React, { FC } from "react";
import { Organization, EditModalProps, OrganizationMember } from "./types";
import {
TextInput,
Button,
Card,
Col,
Table,
TableHead,
TableHeaderCell,
TableBody,
TableRow,
TableCell,
} from "@tremor/react";
import { Card, Col, Table, TableHead, TableHeaderCell, TableBody, TableRow, TableCell } from "@tremor/react";
interface Member {
user_email?: string;
@@ -26,7 +26,6 @@ import { InfoCircleOutlined } from "@ant-design/icons";
import { PencilAltIcon, TrashIcon, RefreshIcon, ChevronDownIcon, ChevronRightIcon } from "@heroicons/react/outline";
import { TextInput } from "@tremor/react";
import { getModelDisplayName } from "./key_team_helpers/fetch_available_models_team_key";
import { message } from "antd";
import OrganizationInfoView from "./organization/organization_view";
import { Organization, organizationListCall, organizationCreateCall, organizationDeleteCall } from "./networking";
import VectorStoreSelector from "./vector_store_management/VectorStoreSelector";
@@ -1,4 +1,4 @@
import React, { useState, useEffect } from "react";
import React, { useState } from "react";
import {
Card,
Title,
@@ -13,7 +13,7 @@ import {
TabPanels,
TextInput,
} from "@tremor/react";
import { Button, Form, Input, Switch, message, InputNumber } from "antd";
import { Button, Form, Input, Switch, InputNumber } from "antd";
import { updatePassThroughEndpoint, deletePassThroughEndpointsCall } from "./networking";
import { Eye, EyeOff } from "lucide-react";
import RoutePreview from "./route_preview";
@@ -1,32 +1,7 @@
import React, { useState, useEffect } from "react";
import {
Badge,
Metric,
Text,
Grid,
Button,
TextInput,
Select as Select2,
SelectItem,
Col,
Accordion,
AccordionBody,
AccordionHeader,
AccordionList,
Icon,
Title,
} from "@tremor/react";
import {
getCallbacksCall,
setCallbacksCall,
getGeneralSettingsCall,
deletePassThroughEndpointsCall,
getPassThroughEndpointsCall,
serviceHealthCheck,
updateConfigFieldSetting,
deleteConfigFieldSetting,
} from "./networking";
import { Modal, Form, Input, Select, Button as Button2, message, InputNumber, Tooltip } from "antd";
import { Text, Button, Icon, Title } from "@tremor/react";
import { deletePassThroughEndpointsCall, getPassThroughEndpointsCall } from "./networking";
import { Tooltip } from "antd";
import { PencilAltIcon, TrashIcon } from "@heroicons/react/outline";
import AddPassThroughEndpoint from "./add_pass_through";
import PassThroughInfoView from "./pass_through_info";
@@ -1,6 +1,5 @@
import React, { useState, useEffect } from "react";
import {
Card,
Title,
Subtitle,
Table,
@@ -19,7 +18,6 @@ import {
TabPanels,
} from "@tremor/react";
import { perUserAnalyticsCall } from "./networking";
import { DateRangePickerValue } from "@tremor/react";
interface PerUserMetrics {
user_id: string;
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react";
import { Button, Popconfirm, message, Modal, InputNumber, Space, Typography, Tag, Card } from "antd";
import { Button, Popconfirm, Modal, InputNumber, Space, Typography, Tag, Card } from "antd";
import { ReloadOutlined, ClockCircleOutlined, StopOutlined } from "@ant-design/icons";
import {
reloadModelCostMap,
@@ -1,7 +1,7 @@
import React, { useState, useEffect } from "react";
import { Card, Text, Button } from "@tremor/react";
import { Modal, message } from "antd";
import { Button } from "@tremor/react";
import { Modal } from "antd";
import { getPromptsList, PromptSpec, ListPromptsResponse, deletePromptCall } from "./networking";
import PromptTable from "./prompts/prompt_table";
import PromptInfoView from "./prompts/prompt_info";
@@ -1,5 +1,5 @@
import React, { useState } from "react";
import { Modal, Form, Select, Upload, Button, message, Divider } from "antd";
import { Modal, Form, Select, Upload, Button, Divider } from "antd";
import { TextInput } from "@tremor/react";
import { UploadOutlined } from "@ant-design/icons";
import type { UploadFile, UploadProps } from "antd";
@@ -12,15 +12,9 @@ import {
TabPanel,
TabPanels,
} from "@tremor/react";
import { Button, message, Tooltip, Modal } from "antd";
import { Button, Modal } from "antd";
import { ArrowLeftIcon, TrashIcon } from "@heroicons/react/outline";
import {
getPromptInfo,
PromptInfoResponse,
PromptSpec,
PromptTemplateBase,
deletePromptCall,
} from "@/components/networking";
import { getPromptInfo, PromptSpec, PromptTemplateBase, deletePromptCall } from "@/components/networking";
import { copyToClipboard as utilCopyToClipboard } from "@/utils/dataUtils";
import { CheckIcon, CopyIcon } from "lucide-react";
import NotificationsManager from "../molecules/notifications_manager";
@@ -1,7 +1,3 @@
import OpenAI from "openai";
import React from "react";
import NotificationManager from "./molecules/notifications_manager";
export enum Providers {
AIML = "AI/ML API",
Bedrock = "Amazon Bedrock",
@@ -1,15 +1,14 @@
import React, { useEffect, useState, useRef, useMemo } from "react";
import { modelHubPublicModelsCall, proxyBaseUrl, getUiConfig, getPublicModelHubInfo } from "./networking";
import { modelHubPublicModelsCall, getPublicModelHubInfo } from "./networking";
import { ModelDataTable } from "./model_dashboard/table";
import { ColumnDef } from "@tanstack/react-table";
import { Card, Text, Title, Button } from "@tremor/react";
import { message, Tag, Tooltip, Modal, Select } from "antd";
import { CopyOutlined } from "@ant-design/icons";
import { ExternalLinkIcon, SearchIcon, EyeIcon, CogIcon } from "@heroicons/react/outline";
import { Tag, Tooltip, Modal, Select } from "antd";
import { ExternalLinkIcon, SearchIcon } from "@heroicons/react/outline";
import { Copy, Info } from "lucide-react";
import { Table as TableInstance } from "@tanstack/react-table";
import { generateCodeSnippet } from "./chat_ui/CodeSnippets";
import { EndpointType, getEndpointType } from "./chat_ui/mode_endpoint_mapping";
import { getEndpointType } from "./chat_ui/mode_endpoint_mapping";
import { MessageType } from "./chat_ui/types";
import { getProviderLogoAndName } from "./provider_info_helpers";
import Navbar from "./navbar";
@@ -1,6 +1,6 @@
import React from "react";
import { ColumnDef } from "@tanstack/react-table";
import { Badge, Text } from "@tremor/react";
import { Text } from "@tremor/react";
import { EyeIcon, CogIcon } from "@heroicons/react/outline";
import { Tag } from "antd";
@@ -1,7 +1,7 @@
"use client";
import React, { useState, useEffect, useRef } from "react";
import { Modal, Form, Input, Select, InputNumber, message } from "antd";
import React, { useState } from "react";
import { Modal, Form, Input, Select } from "antd";
import { Button } from "@tremor/react";
import { userRequestModelCall } from "./networking";
import NotificationsManager from "./molecules/notifications_manager";
@@ -1,9 +1,8 @@
import React, { useState, useEffect } from "react";
import { Card, Icon, Button, Col, Text, Grid, TextInput } from "@tremor/react";
import { InformationCircleIcon, RefreshIcon } from "@heroicons/react/outline";
import { Modal, Form, Select as Select2, message, Tooltip, Input } from "antd";
import { Icon, Button, Col, Text, Grid, TextInput } from "@tremor/react";
import { RefreshIcon } from "@heroicons/react/outline";
import { Modal, Form, Select as Select2, Tooltip, Input } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import NumericalInput from "../shared/numerical_input";
import TagInfoView from "./tag_info";
import { modelInfoCall } from "../networking";
import { tagCreateCall, tagListCall, tagDeleteCall } from "../networking";
@@ -1,11 +1,11 @@
import React, { useState, useEffect } from "react";
import { Card, Text, Title, Button, Badge } from "@tremor/react";
import { Form, Input, Select as Select2, message, Tooltip } from "antd";
import { Form, Input, Select as Select2, Tooltip } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import { fetchUserModels } from "../organisms/create_key_button";
import { getModelDisplayName } from "../key_team_helpers/fetch_available_models_team_key";
import { tagInfoCall, tagUpdateCall } from "../networking";
import { Tag, TagInfoResponse } from "./types";
import { Tag } from "./types";
import NotificationsManager from "../molecules/notifications_manager";
interface TagInfoViewProps {
@@ -1,11 +1,11 @@
/* eslint-disable @next/next/no-img-element */
/* eslint-disable react/no-unescaped-entities */
import React, { useState } from "react";
import { Form, Select, Space, Tooltip, Divider } from "antd";
import React from "react";
import { Select, Tooltip, Divider } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import { Button, Card, TextInput } from "@tremor/react";
import { PlusIcon, TrashIcon, CogIcon, BanIcon } from "@heroicons/react/outline";
import { callbackInfo, Callbacks, callback_map, mapDisplayToInternalNames } from "../callback_info_helpers";
import { callbackInfo, callback_map, mapDisplayToInternalNames } from "../callback_info_helpers";
import NumericalInput from "../shared/numerical_input";
const { Option } = Select;
@@ -11,7 +11,6 @@ import {
Text,
Badge,
} from "@tremor/react";
import { message } from "antd";
import { availableTeamListCall, teamMemberAddCall } from "../networking";
import NotificationsManager from "../molecules/notifications_manager";
@@ -1,8 +1,7 @@
import React, { useState, useEffect } from "react";
import { Modal, Form, Button as AntButton, message } from "antd";
import React, { useEffect } from "react";
import { Modal, Form, Button as AntButton } from "antd";
import { Select, SelectItem, TextInput } from "@tremor/react";
import { Card, Text } from "@tremor/react";
import NotificationsManager from "../molecules/notifications_manager";
import { Text } from "@tremor/react";
import NumericalInput from "../shared/numerical_input";
interface BaseMember {
@@ -11,7 +11,7 @@ import {
TableRow,
TableCell,
} from "@tremor/react";
import { Button, message, Checkbox, Empty } from "antd";
import { Button, Checkbox, Empty } from "antd";
import { ReloadOutlined, SaveOutlined } from "@ant-design/icons";
import { getTeamPermissionsCall, teamPermissionsUpdateCall } from "@/components/networking";
import { getPermissionInfo } from "./permission_definitions";
@@ -12,13 +12,6 @@ import {
Grid,
Badge,
Button as TremorButton,
TableRow,
TableCell,
TableHead,
TableHeaderCell,
TableBody,
Table,
Icon,
TextInput,
} from "@tremor/react";
import TeamMembersComponent from "./team_member_view";
@@ -34,12 +27,10 @@ import {
} from "@/components/networking";
import { Button, Form, Input, Select, message, Tooltip } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import { Select as Select2 } from "antd";
import { ArrowLeftIcon, PencilAltIcon, PlusIcon, TrashIcon } from "@heroicons/react/outline";
import { ArrowLeftIcon } from "@heroicons/react/outline";
import MemberModal from "./edit_membership";
import UserSearchModal from "@/components/common_components/user_search_modal";
import { getModelDisplayName } from "../key_team_helpers/fetch_available_models_team_key";
import { isAdminRole } from "@/utils/roles";
import ObjectPermissionsView from "../object_permissions_view";
import VectorStoreSelector from "../vector_store_management/VectorStoreSelector";
import MCPServerSelector from "../mcp_server_management/MCPServerSelector";
@@ -351,8 +342,12 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
accessGroups: [],
};
const mcpToolPermissions = values.mcp_tool_permissions || {};
if ((servers && servers.length > 0) || (accessGroups && accessGroups.length > 0) || Object.keys(mcpToolPermissions).length > 0) {
if (
(servers && servers.length > 0) ||
(accessGroups && accessGroups.length > 0) ||
Object.keys(mcpToolPermissions).length > 0
) {
updateData.object_permission = {};
if (servers && servers.length > 0) {
updateData.object_permission.mcp_servers = servers;
@@ -686,9 +681,9 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
<Input type="hidden" />
</Form.Item>
<Form.Item
<Form.Item
noStyle
shouldUpdate={(prevValues, currentValues) =>
shouldUpdate={(prevValues, currentValues) =>
prevValues.mcp_servers_and_groups !== currentValues.mcp_servers_and_groups ||
prevValues.mcp_tool_permissions !== currentValues.mcp_tool_permissions
}
@@ -15,7 +15,7 @@ import {
import { InfoCircleOutlined } from "@ant-design/icons";
import { Tooltip } from "antd";
import { TeamData } from "./team_info";
import { PencilAltIcon, PlusIcon, TrashIcon } from "@heroicons/react/outline";
import { PencilAltIcon, TrashIcon } from "@heroicons/react/outline";
import { formatNumberWithCommas } from "@/utils/dataUtils";
interface TeamMembersComponentProps {
@@ -1,4 +1,3 @@
// KeyInfoView.premium-guard.test.tsx
import React from "react";
import { describe, it, expect, beforeEach, vi } from "vitest";
import { render, screen, fireEvent, waitFor } from "@testing-library/react";
@@ -11,7 +11,7 @@ import MCPToolPermissions from "../mcp_server_management/MCPToolPermissions";
import EditLoggingSettings from "../team/EditLoggingSettings";
import { extractLoggingSettings, formatMetadataForDisplay } from "../key_info_utils";
import { fetchMCPAccessGroups } from "../networking";
import { mapInternalToDisplayNames, mapDisplayToInternalNames } from "../callback_info_helpers";
import { mapInternalToDisplayNames } from "../callback_info_helpers";
import GuardrailSelector from "@/components/guardrails/GuardrailSelector";
import KeyLifecycleSettings from "../common_components/KeyLifecycleSettings";
import RateLimitTypeFormItem from "../common_components/RateLimitTypeFormItem";
@@ -299,9 +299,9 @@ export function KeyEditView({
<Input type="hidden" />
</Form.Item>
<Form.Item
<Form.Item
noStyle
shouldUpdate={(prevValues, currentValues) =>
shouldUpdate={(prevValues, currentValues) =>
prevValues.mcp_servers_and_groups !== currentValues.mcp_servers_and_groups ||
prevValues.mcp_tool_permissions !== currentValues.mcp_tool_permissions
}
@@ -1,24 +1,9 @@
import React, { useEffect, useState } from "react";
import {
Card,
Text,
Button,
Grid,
Col,
Tab,
TabList,
TabGroup,
TabPanel,
TabPanels,
Title,
Badge,
TextInput,
Select as TremorSelect,
} from "@tremor/react";
import { Card, Text, Button, Grid, Tab, TabList, TabGroup, TabPanel, TabPanels, Title, Badge } from "@tremor/react";
import { ArrowLeftIcon, TrashIcon, RefreshIcon } from "@heroicons/react/outline";
import { keyDeleteCall, keyUpdateCall } from "../networking";
import { KeyResponse } from "../key_team_helpers/key_list";
import { Form, Input, InputNumber, Select, Tooltip, Button as AntdButton } from "antd";
import { Form, Tooltip, Button as AntdButton } from "antd";
import NotificationManager from "../molecules/notifications_manager";
import { KeyEditView } from "./key_edit_view";
import { RegenerateKeyModal } from "../organisms/regenerate_key_modal";
@@ -28,7 +13,7 @@ import LoggingSettingsView from "../logging_settings_view";
import { copyToClipboard as utilCopyToClipboard, formatNumberWithCommas } from "@/utils/dataUtils";
import { extractLoggingSettings, formatMetadataForDisplay } from "../key_info_utils";
import { CopyIcon, CheckIcon } from "lucide-react";
import { callback_map, mapInternalToDisplayNames, mapDisplayToInternalNames } from "../callback_info_helpers";
import { mapInternalToDisplayNames, mapDisplayToInternalNames } from "../callback_info_helpers";
import { parseErrorMessage } from "../shared/errorUtils";
import AutoRotationView from "../common_components/AutoRotationView";
@@ -12,8 +12,6 @@ import {
Text,
Grid,
Col,
DateRangePicker,
TextInput,
} from "@tremor/react";
import { CredentialItem, credentialListCall, CredentialsResponse } from "../networking";
@@ -26,7 +24,6 @@ import { Select, SelectItem, DateRangePickerValue } from "@tremor/react";
import UsageDatePicker from "../shared/usage_date_picker";
import {
modelInfoCall,
Model,
modelCostMap,
healthCheckCall,
modelMetricsCall,
@@ -41,7 +38,7 @@ import {
allEndUsersCall,
} from "../networking";
import { BarChart, AreaChart } from "@tremor/react";
import { Popover, Form, InputNumber, message } from "antd";
import { Popover, Form, InputNumber } from "antd";
import { Button } from "@tremor/react";
import { Typography } from "antd";
import { RefreshIcon, FilterIcon } from "@heroicons/react/outline";
@@ -1,64 +1,12 @@
"use client";
import React, { useEffect, useState, useMemo } from "react";
import { keyDeleteCall, modelAvailableCall, getGuardrailsList, Organization } from "../networking";
import React, { useEffect, useState } from "react";
import { keyDeleteCall, Organization } from "../networking";
import { add } from "date-fns";
import {
InformationCircleIcon,
StatusOnlineIcon,
TrashIcon,
PencilAltIcon,
RefreshIcon,
} from "@heroicons/react/outline";
import {
keySpendLogsCall,
PredictedSpendLogsCall,
keyUpdateCall,
modelInfoCall,
regenerateKeyCall,
} from "../networking";
import {
Badge,
Card,
Table,
Grid,
Col,
Button,
TableBody,
TableCell,
TableHead,
TableHeaderCell,
TableRow,
Dialog,
DialogPanel,
Text,
Title,
Subtitle,
Icon,
BarChart,
TextInput,
Textarea,
Select,
SelectItem,
} from "@tremor/react";
import { InfoCircleOutlined } from "@ant-design/icons";
import {
fetchAvailableModelsForTeamOrKey,
getModelDisplayName,
} from "../key_team_helpers/fetch_available_models_team_key";
import { MultiSelect, MultiSelectItem } from "@tremor/react";
import {
Button as Button2,
Modal,
Form,
Input,
Select as Select2,
InputNumber,
message,
Tooltip,
DatePicker,
} from "antd";
import { regenerateKeyCall } from "../networking";
import { Grid, Col, Button, Text, Title, TextInput } from "@tremor/react";
import { fetchAvailableModelsForTeamOrKey } from "../key_team_helpers/fetch_available_models_team_key";
import { Modal, Form, InputNumber } from "antd";
import { CopyToClipboard } from "react-copy-to-clipboard";
import TextArea from "antd/es/input/TextArea";
import useKeyList from "../key_team_helpers/key_list";
import { KeyResponse } from "../key_team_helpers/key_list";
import { AllKeysTable } from "../all_keys_table";
@@ -1,5 +1,5 @@
import React, { useState } from "react";
import { Button, Select, Tabs, message } from "antd";
import { Button } from "antd";
import { CopyOutlined } from "@ant-design/icons";
import { Title } from "@tremor/react";
import { transformRequestCall } from "./networking";
@@ -1,6 +1,5 @@
import React, { useState, useEffect } from "react";
import { Card, Title, Text, TextInput, Button } from "@tremor/react";
import { message } from "antd";
import { useTheme } from "@/contexts/ThemeContext";
import { getProxyBaseUrl } from "@/components/networking";
import NotificationsManager from "./molecules/notifications_manager";
@@ -9,7 +9,6 @@ import {
TableRow,
TableCell,
TableBody,
Metric,
Subtitle,
} from "@tremor/react";
@@ -22,7 +21,6 @@ import {
Grid,
Col,
Text,
LineChart,
TabPanel,
TabPanels,
TabGroup,
@@ -30,21 +28,15 @@ import {
Tab,
Select,
SelectItem,
DateRangePicker,
DateRangePickerValue,
DonutChart,
AreaChart,
Callout,
Button,
MultiSelect,
MultiSelectItem,
} from "@tremor/react";
import { Select as Select2 } from "antd";
import {
userSpendLogsCall,
keyInfoCall,
adminSpendLogsCall,
adminTopKeysCall,
adminTopModelsCall,
@@ -52,14 +44,11 @@ import {
teamSpendLogsCall,
tagsSpendLogsCall,
allTagNamesCall,
modelMetricsCall,
modelAvailableCall,
adminspendByProvider,
adminGlobalActivity,
adminGlobalActivityPerModel,
getProxyUISettings,
} from "./networking";
import { start } from "repl";
import TopKeyView from "./top_key_view";
import { formatNumberWithCommas } from "@/utils/dataUtils";
console.log("process.env.NODE_ENV", process.env.NODE_ENV);
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react";
import { message, Modal } from "antd";
import { Modal } from "antd";
import { PlusCircleIcon, PencilIcon, TrashIcon, ChevronDownIcon, ChevronRightIcon } from "@heroicons/react/outline";
import { isAdminRole } from "../utils/roles";
import { getPublicModelHubInfo, updateUsefulLinksCall, getProxyBaseUrl } from "./networking";
@@ -4,18 +4,9 @@ import {
Title,
Text,
Grid,
Col,
Table,
TableHead,
TableRow,
TableHeaderCell,
TableBody,
TableCell,
BarChart,
DonutChart,
Metric,
Subtitle,
Button,
Tab,
TabGroup,
TabList,
@@ -23,7 +14,6 @@ import {
TabPanels,
} from "@tremor/react";
import { Select, Tooltip } from "antd";
import { formatNumberWithCommas } from "@/utils/dataUtils";
import { userAgentSummaryCall, tagDauCall, tagWauCall, tagMauCall, tagDistinctCall } from "./networking";
import AdvancedDatePicker from "./shared/advanced_date_picker";
import PerUserUsage from "./per_user_usage";
@@ -3,29 +3,21 @@ import React, { useState, useEffect } from "react";
import {
userInfoCall,
modelAvailableCall,
getTotalSpendCall,
getProxyUISettings,
Organization,
organizationListCall,
DEFAULT_ORGANIZATION,
keyInfoCall,
getProxyBaseUrl,
} from "./networking";
import { fetchTeams } from "./common_components/fetch_teams";
import { Grid, Col, Card, Text, Title } from "@tremor/react";
import { Grid, Col } from "@tremor/react";
import CreateKey from "./organisms/create_key_button";
import ViewKeyTable from "./templates/view_key_table";
import ViewUserSpend from "./view_user_spend";
import ViewUserTeam from "./view_user_team";
import DashboardTeam from "./dashboard_default_team";
import Onboarding from "../app/onboarding/page";
import { useSearchParams, useRouter } from "next/navigation";
import { useSearchParams } from "next/navigation";
import { KeyResponse, Team } from "./key_team_helpers/key_list";
import { jwtDecode } from "jwt-decode";
import { Typography } from "antd";
import { clearTokenCookies } from "@/utils/cookieUtils";
import { clearMCPAuthTokens } from "./mcp_tools/mcp_auth_storage";
import { Setter } from "@/types";
export interface ProxySettings {
PROXY_BASE_URL: string | null;
@@ -1,5 +1,5 @@
import React from "react";
import { Form, InputNumber, Select, Tooltip } from "antd";
import { Form, Select, Tooltip } from "antd";
import NumericalInput from "./shared/numerical_input";
import { TextInput, Textarea, SelectItem } from "@tremor/react";
import { Button } from "@tremor/react";
@@ -1,6 +1,6 @@
import React, { useState } from "react";
import { TextInput, Icon, Button as TremorButton, Text } from "@tremor/react";
import { Modal, Form, Select, message, Tooltip, Input, Alert } from "antd";
import { TextInput, Button as TremorButton } from "@tremor/react";
import { Modal, Form, Select, Tooltip, Input, Alert } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import { CredentialItem, vectorStoreCreateCall } from "../networking";
import {
@@ -1,6 +1,5 @@
import React, { useEffect, useState } from "react";
import { Select, Typography, Tooltip } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import { Select } from "antd";
import { VectorStore } from "./types";
import { vectorStoreListCall } from "../networking";
interface VectorStoreSelectorProps {
@@ -1,5 +1,5 @@
import React from "react";
import { Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Icon, Text, Badge } from "@tremor/react";
import { Table, TableBody, TableCell, TableHead, TableHeaderCell, TableRow, Icon } from "@tremor/react";
import { TrashIcon, PencilAltIcon, SwitchVerticalIcon, ChevronUpIcon, ChevronDownIcon } from "@heroicons/react/outline";
import { Tooltip } from "antd";
import {
@@ -1,7 +1,6 @@
import React, { useState, useEffect } from "react";
import { Card, Icon, Button as TremorButton, Col, Text, Grid } from "@tremor/react";
import { InformationCircleIcon, RefreshIcon } from "@heroicons/react/outline";
import { message } from "antd";
import { Icon, Button as TremorButton, Col, Text, Grid } from "@tremor/react";
import { RefreshIcon } from "@heroicons/react/outline";
import { vectorStoreListCall, vectorStoreDeleteCall, credentialListCall, CredentialItem } from "../networking";
import { VectorStore } from "./types";
import VectorStoreTable from "./VectorStoreTable";
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from "react";
import { Card, Text, Title, Button, Badge, TabGroup, TabList, Tab, TabPanels, TabPanel } from "@tremor/react";
import { Form, Input, Select as Select2, message, Tooltip, Button as AntButton } from "antd";
import { Form, Input, Select as Select2, Tooltip, Button as AntButton } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons";
import { ArrowLeftIcon } from "@heroicons/react/outline";
import { vectorStoreInfoCall, vectorStoreUpdateCall, credentialListCall, CredentialItem } from "../networking";
@@ -1,5 +1,4 @@
import { LogEntry } from "./columns";
import { message } from "antd";
import NotificationsManager from "../molecules/notifications_manager";
interface RequestResponsePanelProps {
@@ -2,7 +2,7 @@ import React, { useState } from "react";
import { LogEntry } from "./columns";
import { DataTable } from "./table";
import { columns } from "./columns";
import { Card, Title, Text, Metric, AreaChart, Button as TremorButton } from "@tremor/react";
import { Card, Title, Text, Metric, Button as TremorButton } from "@tremor/react";
import { RequestViewer } from "./index";
import { formatNumberWithCommas } from "@/utils/dataUtils";
import { ArrowLeftIcon } from "@heroicons/react/outline";
@@ -4,7 +4,6 @@ import { getProviderLogoAndName } from "../provider_info_helpers";
import { Tooltip } from "antd";
import { TimeCell } from "./time_cell";
import { Button, Badge } from "@tremor/react";
import { Eye, EyeOff } from "lucide-react";
import { formatNumberWithCommas } from "@/utils/dataUtils";
// Helper to get the appropriate logo URL

Some files were not shown because too many files have changed in this diff Show More