File tree 3 files changed +42
-24
lines changed
3 files changed +42
-24
lines changed Original file line number Diff line number Diff line change @@ -1555,18 +1555,9 @@ export const getInsightsTemplate = async (
1555
1555
return response . data ;
1556
1556
} ;
1557
1557
1558
- export interface Health {
1559
- healthy : boolean ;
1560
- warning : boolean ;
1561
- time : string ;
1562
- coder_version : string ;
1563
- access_url : { healthy : boolean ; warning : boolean } ;
1564
- database : { healthy : boolean ; warning : boolean } ;
1565
- derp : { healthy : boolean ; warning : boolean } ;
1566
- websocket : { healthy : boolean ; warning : boolean } ;
1567
- }
1568
-
1569
1558
export const getHealth = async ( ) => {
1570
- const response = await axios . get < Health > ( "/api/v2/debug/health" ) ;
1559
+ const response = await axios . get < TypesGen . HealthcheckReport > (
1560
+ "/api/v2/debug/health" ,
1561
+ ) ;
1571
1562
return response . data ;
1572
1563
} ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
19
19
import { Stats , StatsItem } from "components/Stats/Stats" ;
20
20
import { createDayString } from "utils/createDayString" ;
21
21
import { DashboardFullPage } from "components/Dashboard/DashboardLayout" ;
22
+ import { DerphealthReport } from "api/typesGenerated"
22
23
23
24
const sections = {
24
25
derp : "DERP" ,
@@ -139,10 +140,12 @@ export function HealthPageView({
139
140
. map ( ( key ) => {
140
141
const label = sections [ key as keyof typeof sections ] ;
141
142
const isActive = tab . value === key ;
142
- const isHealthy =
143
- healthStatus [ key as keyof typeof sections ] . healthy ;
144
- const isWarning =
145
- healthStatus [ key as keyof typeof sections ] . warning ;
143
+ const healthSection = healthStatus [ key as keyof typeof sections ]
144
+ const isHealthy = healthSection . healthy ;
145
+ if ( healthSection instanceof DerphealthReport ) {
146
+
147
+ }
148
+ const isWarning = ( healthSection as DerphealthReport ) . warning ;
146
149
return (
147
150
< Box
148
151
component = "button"
@@ -221,7 +224,10 @@ export function HealthPageView({
221
224
</ Box >
222
225
</ DashboardFullPage >
223
226
) ;
224
- }
227
+ } ;
228
+
229
+ export const getValidationErrorMessage = ( error : unknown ) : string => {
230
+
225
231
226
232
const styles = {
227
233
stats : ( theme ) => ( {
Original file line number Diff line number Diff line change 1
1
import {
2
2
withDefaultFeatures ,
3
3
type GetLicensesResponse ,
4
- type DeploymentConfig ,
5
- type Health ,
4
+ type DeploymentConfig
6
5
} from "api/api" ;
7
6
import { FieldError } from "api/errors" ;
8
7
import * as TypesGen from "api/typesGenerated" ;
@@ -2809,12 +2808,34 @@ export const MockListeningPortsResponse: TypesGen.WorkspaceAgentListeningPortsRe
2809
2808
] ,
2810
2809
} ;
2811
2810
2812
- export const DeploymentHealthUnhealthy : Health = {
2811
+ export const DeploymentHealthUnhealthy : TypesGen . HealthcheckReport = {
2813
2812
healthy : false ,
2813
+ warning : false ,
2814
+ failing_sections : [ ] , // apparently this property is not used at all?
2814
2815
time : "2023-10-12T23:15:00.000000000Z" ,
2815
2816
coder_version : "v2.3.0-devel+8cca4915a" ,
2816
- access_url : { healthy : true } ,
2817
- database : { healthy : false } ,
2818
- derp : { healthy : false } ,
2819
- websocket : { healthy : false } ,
2817
+ access_url : {
2818
+ healthy : true ,
2819
+ access_url : "" ,
2820
+ healthz_response : "" ,
2821
+ reachable : true ,
2822
+ status_code : 0 ,
2823
+ } ,
2824
+ database : {
2825
+ healthy : false ,
2826
+ latency : "" ,
2827
+ latency_ms : 0 ,
2828
+ reachable : true ,
2829
+ } ,
2830
+ derp : {
2831
+ healthy : false ,
2832
+ warning : false ,
2833
+ regions : [ ] ,
2834
+ netcheck_logs : [ ] ,
2835
+ } ,
2836
+ websocket : {
2837
+ healthy : false ,
2838
+ body : "" ,
2839
+ code : 0 ,
2840
+ } ,
2820
2841
} ;
You can’t perform that action at this time.
0 commit comments