mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
fix(ui): keep Activity views within dashboard lint limits
This commit is contained in:
parent
e3f60de20f
commit
8e1223e39a
3 changed files with 30 additions and 22 deletions
|
|
@ -208,7 +208,7 @@ export default function ModelsAndEndpointsPage() {
|
|||
|
||||
{!isViewOnly && <DecisionModelsBanner />}
|
||||
|
||||
{activityModel ? (
|
||||
{activityModel && (
|
||||
<div className="space-y-4">
|
||||
<Button variant="ghost" onClick={() => void setActivityModel(null)}>
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
|
|
@ -217,7 +217,8 @@ export default function ModelsAndEndpointsPage() {
|
|||
<h2 className="text-lg font-semibold">{activityModel}</h2>
|
||||
<EntityActivity scope="model" id={activityModel} />
|
||||
</div>
|
||||
) : modelId ? (
|
||||
)}
|
||||
{!activityModel && modelId && (
|
||||
<ModelInfoView
|
||||
modelId={modelId}
|
||||
onClose={close}
|
||||
|
|
@ -228,7 +229,8 @@ export default function ModelsAndEndpointsPage() {
|
|||
onModelUpdate={invalidateModels}
|
||||
modelAccessGroups={availableModelAccessGroups}
|
||||
/>
|
||||
) : (
|
||||
)}
|
||||
{!activityModel && !modelId && (
|
||||
<Tabs value={activeKey} onValueChange={handleTabChange}>
|
||||
<div className="flex min-w-0 flex-nowrap items-center gap-3 border-b">
|
||||
<div className="no-scrollbar scroll-fade-e -mb-1.5 min-w-0 flex-1 overflow-x-auto pb-1.5">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
import type { UserInfoV2Response } from "@/components/networking";
|
||||
|
||||
/** Build the legacy-compatible shape consumed by UserEditView. */
|
||||
export function toUserEditData(userData: UserInfoV2Response) {
|
||||
return {
|
||||
user_id: userData.user_id,
|
||||
user_info: {
|
||||
user_email: userData.user_email,
|
||||
user_alias: userData.user_alias,
|
||||
user_role: userData.user_role,
|
||||
models: userData.models,
|
||||
max_budget: userData.max_budget,
|
||||
tpm_limit: userData.tpm_limit,
|
||||
rpm_limit: userData.rpm_limit,
|
||||
budget_duration: userData.budget_duration,
|
||||
metadata: userData.metadata,
|
||||
// Without these the per-model budget editor mounts empty and a save
|
||||
// replaces the user's existing budgets with whatever was typed.
|
||||
model_max_budget: userData.model_max_budget,
|
||||
model_max_budget_usage: userData.model_max_budget_usage,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
@ -36,6 +36,7 @@ import { hasProxyWideSpendView, rolesWithWriteAccess } from "@/utils/roles";
|
|||
import { teamDetailHref } from "@/utils/entityLinks";
|
||||
import { BadgeLink } from "@/components/shared/BadgeLink";
|
||||
import { UserEditView } from "../user_edit_view";
|
||||
import { toUserEditData } from "../user_edit_data";
|
||||
import OnboardingModal, { InvitationLink } from "@/components/onboarding_link";
|
||||
import { formatNumberWithCommas, copyToClipboard as utilCopyToClipboard } from "@/utils/dataUtils";
|
||||
import { ArrowLeft, CheckIcon, CopyIcon, Plus, RefreshCw, Trash2 } from "lucide-react";
|
||||
|
|
@ -410,25 +411,7 @@ export default function UserInfoView({
|
|||
userData.max_budget !== null ? `$${formatNumberWithCommas(userData.max_budget, 2)}` : unlimitedLabel;
|
||||
const teamPickerPlaceholder = t("users.userInfo.addTeamDialog.teamPlaceholder");
|
||||
|
||||
// Build a legacy-compatible shape for UserEditView
|
||||
const userDataForEdit = {
|
||||
user_id: userData.user_id,
|
||||
user_info: {
|
||||
user_email: userData.user_email,
|
||||
user_alias: userData.user_alias,
|
||||
user_role: userData.user_role,
|
||||
models: userData.models,
|
||||
max_budget: userData.max_budget,
|
||||
tpm_limit: userData.tpm_limit,
|
||||
rpm_limit: userData.rpm_limit,
|
||||
budget_duration: userData.budget_duration,
|
||||
metadata: userData.metadata,
|
||||
// Without these the per-model budget editor mounts empty and a save
|
||||
// replaces the user's existing budgets with whatever was typed.
|
||||
model_max_budget: userData.model_max_budget,
|
||||
model_max_budget_usage: userData.model_max_budget_usage,
|
||||
},
|
||||
};
|
||||
const userDataForEdit = toUserEditData(userData);
|
||||
|
||||
return (
|
||||
<div className="p-4">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue