mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-02 02:11:58 +00:00
fix(ui): derive session total from accumulated rows when backend omits it
Compute the session total after all pages are fetched, falling back to the accumulated row count rather than the first page's. Guards the truncation note against a backend response that omits total but spans multiple pages.
This commit is contained in:
parent
7ee4833764
commit
64340226c5
1 changed files with 4 additions and 1 deletions
|
|
@ -129,7 +129,6 @@ export function LogDetailsDrawer({
|
|||
// than one page of logs are shown in full (capped for safety).
|
||||
const firstPage = await sessionSpendLogsCall(accessToken, sessionId, 1, SESSION_PAGE_SIZE);
|
||||
let rows: LogEntry[] = firstPage.data || firstPage || [];
|
||||
const total: number = firstPage.total ?? rows.length;
|
||||
const pagesToFetch = Math.min(firstPage.total_pages ?? 1, MAX_SESSION_PAGES);
|
||||
|
||||
if (pagesToFetch > 1) {
|
||||
|
|
@ -149,6 +148,10 @@ export function LogDetailsDrawer({
|
|||
}
|
||||
}
|
||||
|
||||
// Fall back to the accumulated row count (not just the first page) when the
|
||||
// backend omits total, so the truncation note reflects what was fetched.
|
||||
const total: number = firstPage.total ?? rows.length;
|
||||
|
||||
const logs = rows
|
||||
.map((row) => ({
|
||||
...row,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue