mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
(beta ui - spend logs view fixes & Improvements 1) (#8062)
* ui 1 - show correct msg on no logs * fix dup country col * backend - allow filtering by team_id and api_key * fix ui_view_spend_logs * ui update query params * working team id and key hash filters * fix filter ref - don't hold on them as they are * fix _model_custom_llm_provider_matches_wildcard_pattern * fix test test_stream_chunk_builder_openai_audio_output_usage - use direct dict comparison
This commit is contained in:
parent
311997ee40
commit
ae7b042bc2
6 changed files with 246 additions and 181 deletions
|
@ -1553,12 +1553,14 @@ export const userSpendLogsCall = async (
|
|||
export const uiSpendLogsCall = async (
|
||||
accessToken: String,
|
||||
api_key?: string,
|
||||
user_id?: string,
|
||||
team_id?: string,
|
||||
request_id?: string,
|
||||
start_date?: string,
|
||||
end_date?: string,
|
||||
page?: number,
|
||||
page_size?: number,
|
||||
min_spend?: number,
|
||||
max_spend?: number,
|
||||
) => {
|
||||
try {
|
||||
// Construct base URL
|
||||
|
@ -1567,7 +1569,9 @@ export const uiSpendLogsCall = async (
|
|||
// Add query parameters if they exist
|
||||
const queryParams = new URLSearchParams();
|
||||
if (api_key) queryParams.append('api_key', api_key);
|
||||
if (user_id) queryParams.append('user_id', user_id);
|
||||
if (team_id) queryParams.append('team_id', team_id);
|
||||
if (min_spend) queryParams.append('min_spend', min_spend.toString());
|
||||
if (max_spend) queryParams.append('max_spend', max_spend.toString());
|
||||
if (request_id) queryParams.append('request_id', request_id);
|
||||
if (start_date) queryParams.append('start_date', start_date);
|
||||
if (end_date) queryParams.append('end_date', end_date);
|
||||
|
@ -1595,7 +1599,7 @@ export const uiSpendLogsCall = async (
|
|||
}
|
||||
|
||||
const data = await response.json();
|
||||
console.log("Spend Logs UI Response:", data);
|
||||
console.log("Spend Logs Response:", data);
|
||||
return data;
|
||||
} catch (error) {
|
||||
console.error("Failed to fetch spend logs:", error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue