mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-28 06:23:07 +00:00
fix(ui): update tag spend formatting and mock
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
3c26fd6bf8
commit
b35edcd0ab
2 changed files with 6 additions and 12 deletions
|
|
@ -4,10 +4,7 @@ import React, { useEffect, useMemo, useState } from "react";
|
|||
|
||||
import { DataTable, DataTablePagination } from "@/components/shared/DataTable";
|
||||
import { MoneyCell } from "@/components/shared/table_cells";
|
||||
import type {
|
||||
DailyActivityTagPageResponse,
|
||||
DailyActivityTagSpendRow,
|
||||
} from "@/components/UsagePage/dailyActivityApi";
|
||||
import type { DailyActivityTagPageResponse, DailyActivityTagSpendRow } from "@/components/UsagePage/dailyActivityApi";
|
||||
|
||||
import { Panel } from "../overview/Primitives";
|
||||
|
||||
|
|
@ -78,12 +75,7 @@ const columns: ColumnDef<DailyActivityTagSpendRow>[] = [
|
|||
},
|
||||
];
|
||||
|
||||
const useTeamTagSpendPage = ({
|
||||
accessToken,
|
||||
startTime,
|
||||
endTime,
|
||||
teamId,
|
||||
}: TeamTagSpendCardProps): TeamTagSpendPage => {
|
||||
const useTeamTagSpendPage = ({ accessToken, startTime, endTime, teamId }: TeamTagSpendCardProps): TeamTagSpendPage => {
|
||||
const startTimestamp = startTime?.getTime();
|
||||
const endTimestamp = endTime?.getTime();
|
||||
const requestScope = useMemo(
|
||||
|
|
@ -110,7 +102,8 @@ const useTeamTagSpendPage = ({
|
|||
limit: PAGE_SIZE,
|
||||
signal: controller.signal,
|
||||
};
|
||||
void ENTITY_API.team.tagPage(tagPageRequest)
|
||||
void ENTITY_API.team
|
||||
.tagPage(tagPageRequest)
|
||||
.then((response) => {
|
||||
if (controller.signal.aborted) return;
|
||||
const nextPageState: TagPageState = { scope: requestScope, page, response, failed: false };
|
||||
|
|
@ -131,7 +124,7 @@ const useTeamTagSpendPage = ({
|
|||
|
||||
const loading = enabled && currentPageState === null;
|
||||
const failed = currentPageState?.failed ?? false;
|
||||
const rows = failed ? [] : (currentPageState?.response?.tags ?? []);
|
||||
const rows = failed ? [] : currentPageState?.response?.tags ?? [];
|
||||
const totalTags = currentScopeState?.response?.total_tags ?? 0;
|
||||
const onPageChange = (nextPage: number) => setPageState({ scope: requestScope, page: nextPage });
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ beforeAll(() => {
|
|||
vi.mock("@/components/networking", () => ({
|
||||
dailyActivityAggregatedCall: vi.fn(),
|
||||
dailyActivityKeyPageCall: vi.fn(),
|
||||
dailyActivityTagPageCall: vi.fn(),
|
||||
userDailyActivityUserPageCall: vi.fn(),
|
||||
dailyActivityKeySearchCall: vi.fn(),
|
||||
dailyActivityModelTopKeysCall: vi.fn(),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue