mirror of
https://github.com/coder/coder.git
synced 2026-10-25 09:42:55 +08:00
fix: display health alert in DeploymentBannerView (#10193)
This commit is contained in:
+13
-10
@@ -1516,14 +1516,17 @@ export const getInsightsTemplate = async (
|
||||
return response.data;
|
||||
};
|
||||
|
||||
export const getHealth = () => {
|
||||
return axios.get<{
|
||||
healthy: boolean;
|
||||
time: string;
|
||||
coder_version: string;
|
||||
derp: { healthy: boolean };
|
||||
access_url: { healthy: boolean };
|
||||
websocket: { healthy: boolean };
|
||||
database: { healthy: boolean };
|
||||
}>("/api/v2/debug/health");
|
||||
export interface Health {
|
||||
healthy: boolean;
|
||||
time: string;
|
||||
coder_version: string;
|
||||
access_url: { healthy: boolean };
|
||||
database: { healthy: boolean };
|
||||
derp: { healthy: boolean };
|
||||
websocket: { healthy: boolean };
|
||||
}
|
||||
|
||||
export const getHealth = async () => {
|
||||
const response = await axios.get<Health>("/api/v2/debug/health");
|
||||
return response.data;
|
||||
};
|
||||
|
||||
@@ -17,6 +17,13 @@ export const deploymentDAUs = () => {
|
||||
export const deploymentStats = () => {
|
||||
return {
|
||||
queryKey: ["deployment", "stats"],
|
||||
queryFn: () => API.getDeploymentStats(),
|
||||
queryFn: API.getDeploymentStats,
|
||||
};
|
||||
};
|
||||
|
||||
export const health = () => {
|
||||
return {
|
||||
queryKey: ["deployment", "health"],
|
||||
queryFn: API.getHealth,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user