File tree Expand file tree Collapse file tree 4 files changed +43
-2
lines changed Expand file tree Collapse file tree 4 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import { ImpendingDeletionBanner } from "components/WorkspaceDeletion"
31
31
import { useLocalStorage } from "hooks"
32
32
import { ChooseOne , Cond } from "components/Conditionals/ChooseOne"
33
33
import AlertTitle from "@mui/material/AlertTitle"
34
+ import { Maybe } from "components/Conditionals/Maybe"
34
35
35
36
export enum WorkspaceErrors {
36
37
GET_BUILDS_ERROR = "getBuildsError" ,
@@ -207,6 +208,28 @@ export const Workspace: FC<React.PropsWithChildren<WorkspaceProps>> = ({
207
208
208
209
< TemplateVersionWarnings warnings = { templateWarnings } />
209
210
211
+ < Maybe
212
+ condition = {
213
+ workspace . latest_build . status === "pending" &&
214
+ workspace . latest_build . job . queue_size > 0
215
+ }
216
+ >
217
+ < Alert severity = "info" >
218
+ < AlertTitle > Workspace build is pending</ AlertTitle >
219
+ < AlertDetail >
220
+ < div className = { styles . alertPendingInQueue } >
221
+ This build job is waiting for a provisioner to become
222
+ available. If you have been waiting for an extended period,
223
+ contact your administrator for assistance.
224
+ </ div >
225
+ < div >
226
+ Position in queue:{ " " }
227
+ < strong > { workspace . latest_build . job . queue_position } </ strong >
228
+ </ div >
229
+ </ AlertDetail >
230
+ </ Alert >
231
+ </ Maybe >
232
+
210
233
{ failedBuildLogs && (
211
234
< Stack >
212
235
< Alert
@@ -319,5 +342,9 @@ export const useStyles = makeStyles((theme) => {
319
342
fullWidth : {
320
343
width : "100%" ,
321
344
} ,
345
+
346
+ alertPendingInQueue : {
347
+ marginBottom : 12 ,
348
+ } ,
322
349
}
323
350
} )
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export const WorkspaceStatusBadge: FC<
20
20
> = ( { workspace, className } ) => {
21
21
const { text, icon, type } = getDisplayWorkspaceStatus (
22
22
workspace . latest_build . status ,
23
+ workspace . latest_build . job ,
23
24
)
24
25
return (
25
26
< ChooseOne >
@@ -42,6 +43,8 @@ export const WorkspaceStatusText: FC<
42
43
workspace . latest_build . status ,
43
44
)
44
45
46
+ workspace . latest_build . job . queue_size
47
+
45
48
return (
46
49
< ChooseOne >
47
50
{ /* <ImpendingDeletionText/> determines its own visibility */ }
Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ const Language = {
13
13
template : "Template" ,
14
14
lastUsed : "Last Used" ,
15
15
status : "Status" ,
16
- lastBuiltBy : "Last Built By" ,
17
16
}
18
17
19
18
export interface WorkspacesTableProps {
Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ export const getDisplayWorkspaceTemplateName = (
194
194
195
195
export const getDisplayWorkspaceStatus = (
196
196
workspaceStatus : TypesGen . WorkspaceStatus ,
197
+ provisionerJob ?: TypesGen . ProvisionerJob ,
197
198
) => {
198
199
const { t } = i18next
199
200
@@ -260,12 +261,23 @@ export const getDisplayWorkspaceStatus = (
260
261
case "pending" :
261
262
return {
262
263
type : "info" ,
263
- text : t ( "workspaceStatus.pending" , { ns : "common" } ) ,
264
+ text : getPendingWorkspaceStatusText ( provisionerJob ) ,
264
265
icon : < QueuedIcon /> ,
265
266
} as const
266
267
}
267
268
}
268
269
270
+ const getPendingWorkspaceStatusText = (
271
+ provisionerJob ?: TypesGen . ProvisionerJob ,
272
+ ) : string => {
273
+ const { t } = i18next
274
+
275
+ if ( provisionerJob === undefined || provisionerJob . queue_size === 0 ) {
276
+ return t ( "workspaceStatus.pending" , { ns : "common" } )
277
+ }
278
+ return "Pending in queue: " + provisionerJob . queue_position
279
+ }
280
+
269
281
const LoadingIcon = ( ) => {
270
282
return < CircularProgress size = { 10 } style = { { color : "#FFF" } } />
271
283
}
You can’t perform that action at this time.
0 commit comments