forked from phoenix/litellm-mirror
Merge pull request #3700 from BerriAI/litellm_ui_round_team_spend
[UI] Fix Round Team Spend, and Show Key Alias on Top API Keys
This commit is contained in:
commit
f3d340bd3a
1 changed files with 6 additions and 1 deletions
|
@ -212,7 +212,7 @@ const UsagePage: React.FC<UsagePageProps> = ({
|
||||||
setKeySpendData(overall_spend);
|
setKeySpendData(overall_spend);
|
||||||
const top_keys = await adminTopKeysCall(accessToken);
|
const top_keys = await adminTopKeysCall(accessToken);
|
||||||
const filtered_keys = top_keys.map((k: any) => ({
|
const filtered_keys = top_keys.map((k: any) => ({
|
||||||
key: (k["key_name"] || k["key_alias"] || k["api_key"]).substring(
|
key: (k["key_alias"] || k["key_name"] || k["api_key"]).substring(
|
||||||
0,
|
0,
|
||||||
10
|
10
|
||||||
),
|
),
|
||||||
|
@ -237,6 +237,11 @@ const UsagePage: React.FC<UsagePageProps> = ({
|
||||||
total_spend_per_team = total_spend_per_team.map((tspt: any) => {
|
total_spend_per_team = total_spend_per_team.map((tspt: any) => {
|
||||||
tspt["name"] = tspt["team_id"] || "";
|
tspt["name"] = tspt["team_id"] || "";
|
||||||
tspt["value"] = tspt["total_spend"] || 0;
|
tspt["value"] = tspt["total_spend"] || 0;
|
||||||
|
// round the value to 2 decimal places
|
||||||
|
|
||||||
|
tspt["value"] = tspt["value"].toFixed(2);
|
||||||
|
|
||||||
|
|
||||||
return tspt;
|
return tspt;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue