@@ -13,31 +13,20 @@ import { FC } from "react"
13
13
import { AlertBanner } from "components/AlertBanner/AlertBanner"
14
14
import IconButton from "@material-ui/core/IconButton/IconButton"
15
15
import { useTranslation } from "react-i18next"
16
- import { WorkspaceProxy } from "api/typesGenerated"
16
+ import { Region } from "api/typesGenerated"
17
17
import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank' ;
18
18
import { Avatar } from "components/Avatar/Avatar"
19
19
import { AvatarData } from "components/AvatarData/AvatarData"
20
- import {
21
- HelpTooltip ,
22
- HelpTooltipText ,
23
- HelpTooltipTitle ,
24
- } from "components/Tooltips/HelpTooltip/HelpTooltip"
25
- import CheckCircleIcon from '@material-ui/icons/CheckCircle' ;
26
- // import LinkOffIcon from '@material-ui/icons/LinkOff';
27
- // import CancelIcon from '@material-ui/icons/Cancel';
28
- import SyncProblemIcon from '@material-ui/icons/SyncProblem' ;
29
- import SyncDisabledIcon from '@material-ui/icons/SyncDisabled' ;
30
- import SyncIcon from '@material-ui/icons/Sync' ;
31
- import HourglassEmptyIcon from '@material-ui/icons/HourglassEmpty' ;
32
- import WarningIcon from '@material-ui/icons/Warning' ;
20
+ import { HealthyBadge , NotHealthyBadge } from "components/DeploySettingsLayout/Badges"
21
+
33
22
34
23
35
24
export interface WorkspaceProxyPageViewProps {
36
- proxies ?: WorkspaceProxy [ ]
25
+ proxies ?: Region [ ]
37
26
getWorkspaceProxiesError ?: Error | unknown
38
27
isLoading : boolean
39
28
hasLoaded : boolean
40
- onSelect : ( proxy : WorkspaceProxy ) => void
29
+ onSelect : ( proxy : Region ) => void
41
30
selectProxyError ?: Error | unknown
42
31
}
43
32
@@ -52,7 +41,7 @@ export const WorkspaceProxyPageView: FC<
52
41
selectProxyError,
53
42
} ) => {
54
43
const theme = useTheme ( )
55
- const { t } = useTranslation ( "workspaceProxyPage " )
44
+ const { t } = useTranslation ( "proxyPage " )
56
45
57
46
return (
58
47
< Stack >
@@ -66,9 +55,9 @@ export const WorkspaceProxyPageView: FC<
66
55
< Table >
67
56
< TableHead >
68
57
< TableRow >
69
- < TableCell width = "20 %" > { t ( "table.icon" ) } </ TableCell >
70
- < TableCell width = "20 %" > { t ( "table.url" ) } </ TableCell >
71
- < TableCell width = "20 %" > { t ( "table.status" ) } </ TableCell >
58
+ < TableCell width = "40 %" > { t ( "table.icon" ) } </ TableCell >
59
+ < TableCell width = "30 %" > { t ( "table.url" ) } </ TableCell >
60
+ < TableCell width = "10 %" > { t ( "table.status" ) } </ TableCell >
72
61
< TableCell width = "0%" > </ TableCell >
73
62
</ TableRow >
74
63
</ TableHead >
@@ -97,7 +86,7 @@ export const WorkspaceProxyPageView: FC<
97
86
}
98
87
// subtitle={proxy.description}
99
88
avatar = {
100
- proxy . icon !== "" && < Avatar src = { proxy . icon } variant = "square" fitImage />
89
+ proxy . icon_url !== "" && < Avatar src = { proxy . icon_url } variant = "square" fitImage />
101
90
}
102
91
/>
103
92
</ TableCell >
@@ -108,7 +97,7 @@ export const WorkspaceProxyPageView: FC<
108
97
</span>
109
98
</TableCell> */ }
110
99
111
- < TableCell > { proxy . url } </ TableCell >
100
+ < TableCell > { proxy . path_app_url } </ TableCell >
112
101
{ /* <TableCell>{lastUsedOrNever(token.last_used)}</TableCell> */ }
113
102
{ /* <TableCell>{proxy.wildcard_hostname}</TableCell> */ }
114
103
{ /* <TableCell>
@@ -153,38 +142,14 @@ export const WorkspaceProxyPageView: FC<
153
142
154
143
155
144
export interface WorkspaceProxyStatusProps {
156
- proxy : WorkspaceProxy
145
+ proxy : Region
157
146
}
158
147
159
148
const ProxyStatus : FC < React . PropsWithChildren < WorkspaceProxyStatusProps > > = ( { proxy } ) => {
160
- let text = ""
161
- let icon = CheckCircleIcon
162
- switch ( proxy . status ?. status ) {
163
- case "ok" :
164
- text = "Proxy is healthy and ready to use"
165
- icon = SyncIcon
166
- break ;
167
- case "unregistered" :
168
- text = "Proxy has not been started"
169
- icon = HourglassEmptyIcon
170
- break ;
171
- case "unreachable" :
172
- text = "Proxy is unreachable"
173
- icon = SyncDisabledIcon
174
- break ;
175
- case "unhealthy" :
176
- text = "Proxy is reachable, but is not healthy to use"
177
- icon = SyncProblemIcon
178
- break ;
179
- default :
180
- text = `Unknown status: ${ proxy . status ?. status } `
181
- icon = WarningIcon
149
+ let icon = < NotHealthyBadge />
150
+ if ( proxy . healthy ) {
151
+ icon = < HealthyBadge />
182
152
}
183
153
184
- return (
185
- < HelpTooltip icon = { icon } size = "medium" >
186
- < HelpTooltipTitle > { proxy . status ?. status } </ HelpTooltipTitle >
187
- < HelpTooltipText > { text } </ HelpTooltipText >
188
- </ HelpTooltip >
189
- )
154
+ return icon
190
155
}
0 commit comments