fix: display health alert in DeploymentBannerView (#10193)

This commit is contained in:
Kayla Washburn
2023-10-13 10:39:20 -06:00
committed by GitHub
parent def980b973
commit cbc0c39792
12 changed files with 177 additions and 111 deletions
+13 -10
View File
@@ -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;
};
+8 -1
View File
@@ -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,
};
};