mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
Add UI Support for Admins to Call /cache/ping and View Cache Analytics (#8475) (#8519)
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 1m19s
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 1m19s
* [Bug] UI: Newly created key does not display on the View Key Page (#8039) - Fixed issue where all keys appeared blank for admin users. - Implemented filtering of data via team settings to ensure all keys are displayed correctly. * Fix: - Updated the validator to allow model editing when `keyTeam.team_alias === "Default Team"`. - Ensured other teams still follow the original validation rules. * - added some classes in global.css - added text wrap in output of request,response and metadata in index.tsx - fixed styles of table in table.tsx * - added full payload when we open single log entry - added Combined Info Card in index.tsx * fix: keys not showing on refresh for internal user * merge * main merge * cache page * ca remove * terms change * fix:places caching inside exp
This commit is contained in:
parent
2c8c1de948
commit
1d22052f47
3 changed files with 123 additions and 6 deletions
|
@ -3210,6 +3210,38 @@ export const healthCheckCall = async (accessToken: String) => {
|
|||
}
|
||||
};
|
||||
|
||||
export const cachingHealthCheckCall = async (accessToken: String) => {
|
||||
/**
|
||||
* Get all the models user has access to
|
||||
*/
|
||||
try {
|
||||
let url = proxyBaseUrl ? `${proxyBaseUrl}/cache/ping` : `/cache/ping`;
|
||||
|
||||
//message.info("Requesting model data");
|
||||
const response = await fetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
[globalLitellmHeaderName]: `Bearer ${accessToken}`,
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.text();
|
||||
handleError(errorData);
|
||||
throw new Error("Network response was not ok");
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
//message.info("Received model data");
|
||||
return data;
|
||||
// Handle success - you might want to update some state or UI based on the created key
|
||||
} catch (error) {
|
||||
console.error("Failed to call /cache/ping:", error);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
export const getProxyUISettings = async (
|
||||
accessToken: String,
|
||||
) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue