mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
style(usage): prettier-format touched dashboard files
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
dd0358ea03
commit
8d5499bced
4 changed files with 19 additions and 13 deletions
|
|
@ -168,8 +168,7 @@ const EntityUsage: React.FC<EntityUsageProps> = ({
|
|||
const spendData = loadedPages?.base === spendDataBase ? loadedPages.merged : spendDataBase;
|
||||
const apiKeyTruncation = getApiKeyTruncation(spendData.metadata?.api_key_limit, spendData.metadata?.total_api_keys);
|
||||
|
||||
const keyPageWindow =
|
||||
accessToken && startTime && endTime ? { accessToken, startTime, endTime } : null;
|
||||
const keyPageWindow = accessToken && startTime && endTime ? { accessToken, startTime, endTime } : null;
|
||||
const loadMoreKeys =
|
||||
aggregatedFetchFn && keyPageWindow && spendData.metadata?.next_cursor
|
||||
? () =>
|
||||
|
|
|
|||
|
|
@ -151,7 +151,11 @@ describe("KeyActivityPanel", () => {
|
|||
it("calls loadMoreKeys when the button is clicked", async () => {
|
||||
const loadMoreKeys = vi.fn<() => Promise<void>>().mockResolvedValue(undefined);
|
||||
render(
|
||||
<KeyActivityPanel keyMetrics={keyMetrics} apiKeyTruncation={{ limit: 2, total: 3 }} loadMoreKeys={loadMoreKeys} />,
|
||||
<KeyActivityPanel
|
||||
keyMetrics={keyMetrics}
|
||||
apiKeyTruncation={{ limit: 2, total: 3 }}
|
||||
loadMoreKeys={loadMoreKeys}
|
||||
/>,
|
||||
);
|
||||
|
||||
fireEvent.click(screen.getByRole("button", { name: "Load more keys" }));
|
||||
|
|
@ -163,7 +167,11 @@ describe("KeyActivityPanel", () => {
|
|||
it("shows a pending status while loadMoreKeys is in flight", async () => {
|
||||
const loadMoreKeys = vi.fn<() => Promise<void>>().mockReturnValue(new Promise(() => {}));
|
||||
render(
|
||||
<KeyActivityPanel keyMetrics={keyMetrics} apiKeyTruncation={{ limit: 2, total: 3 }} loadMoreKeys={loadMoreKeys} />,
|
||||
<KeyActivityPanel
|
||||
keyMetrics={keyMetrics}
|
||||
apiKeyTruncation={{ limit: 2, total: 3 }}
|
||||
loadMoreKeys={loadMoreKeys}
|
||||
/>,
|
||||
);
|
||||
|
||||
fireEvent.click(screen.getByRole("button", { name: "Load more keys" }));
|
||||
|
|
@ -175,7 +183,11 @@ describe("KeyActivityPanel", () => {
|
|||
it("reports a failed key page load", async () => {
|
||||
const loadMoreKeys = vi.fn<() => Promise<void>>().mockRejectedValue(new Error("boom"));
|
||||
render(
|
||||
<KeyActivityPanel keyMetrics={keyMetrics} apiKeyTruncation={{ limit: 2, total: 3 }} loadMoreKeys={loadMoreKeys} />,
|
||||
<KeyActivityPanel
|
||||
keyMetrics={keyMetrics}
|
||||
apiKeyTruncation={{ limit: 2, total: 3 }}
|
||||
loadMoreKeys={loadMoreKeys}
|
||||
/>,
|
||||
);
|
||||
|
||||
fireEvent.click(screen.getByRole("button", { name: "Load more keys" }));
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ const KeyActivityPanel: React.FC<KeyActivityPanelProps> = ({
|
|||
)}
|
||||
{apiKeyTruncation !== undefined && (
|
||||
<span className="text-sm text-muted-foreground" role="note">
|
||||
Only the {totalKeys.toLocaleString()} highest-spend keys of{" "}
|
||||
{apiKeyTruncation.total.toLocaleString()} are loaded
|
||||
Only the {totalKeys.toLocaleString()} highest-spend keys of {apiKeyTruncation.total.toLocaleString()} are
|
||||
loaded
|
||||
</span>
|
||||
)}
|
||||
{loadMoreKeys !== undefined && (
|
||||
|
|
|
|||
|
|
@ -2525,12 +2525,7 @@ export const userDailyActivityAggregatedCall = async (
|
|||
accessToken: string,
|
||||
startTime: Date,
|
||||
endTime: Date,
|
||||
...options: [
|
||||
userId?: string | null,
|
||||
includeCurrentUtcDay?: boolean,
|
||||
apiKey?: string | null,
|
||||
cursor?: string | null,
|
||||
]
|
||||
...options: [userId?: string | null, includeCurrentUtcDay?: boolean, apiKey?: string | null, cursor?: string | null]
|
||||
) => {
|
||||
/**
|
||||
* Get aggregated daily user activity (no pagination)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue