@@ -325,15 +325,6 @@ func (ls Ls) displayWorkspacesAndHelp(org *entity.Organization, otherOrgs []enti
325325
326326 displayLsResetBreadCrumb (ls .terminal , userWorkspaces )
327327 // displayLsConnectBreadCrumb(ls.terminal, userWorkspaces)
328-
329- // if !enableSSHCol {
330- // ls.terminal.Vprintf(ls.terminal.Green("Or ssh:\n"))
331- // for _, v := range userWorkspaces {
332- // if v.Status == entity.Running {
333- // ls.terminal.Vprintf(ls.terminal.Yellow("\tssh %s\n", v.GetLocalIdentifier()))
334- // }
335- // }
336- // }
337328 }
338329}
339330
@@ -405,8 +396,6 @@ func displayProjects(t *terminal.Terminal, orgName string, projects []virtualpro
405396 }
406397}
407398
408- const enableSSHCol = false
409-
410399func getBrevTableOptions () table.Options {
411400 options := table .OptionsDefault
412401 options .DrawBorder = false
@@ -420,10 +409,7 @@ func displayWorkspacesTable(t *terminal.Terminal, workspaces []entity.Workspace,
420409 ta := table .NewWriter ()
421410 ta .SetOutputMirror (os .Stdout )
422411 ta .Style ().Options = getBrevTableOptions ()
423- header := table.Row {"Name" , "Status" , "ID" , "Machine" }
424- if enableSSHCol {
425- header = table.Row {"Name" , "Status" , "SSH" , "ID" , "Machine" }
426- }
412+ header := table.Row {"Name" , "Status" , "Build" , "Shell" , "ID" , "Machine" }
427413 ta .AppendHeader (header )
428414 for _ , w := range workspaces {
429415 isShared := ""
@@ -432,15 +418,20 @@ func displayWorkspacesTable(t *terminal.Terminal, workspaces []entity.Workspace,
432418 }
433419 status := getWorkspaceDisplayStatus (w )
434420 instanceString := utilities .GetInstanceString (w )
435- workspaceRow := []table.Row {{fmt .Sprintf ("%s %s" , w .Name , isShared ), getStatusColoredText (t , status ), w .ID , instanceString }}
436- if enableSSHCol {
437- workspaceRow = []table.Row {{w .Name , getStatusColoredText (t , status ), w .GetLocalIdentifier (), w .ID , instanceString }}
438- }
421+ workspaceRow := []table.Row {{fmt .Sprintf ("%s %s" , w .Name , isShared ), getStatusColoredText (t , status ), getStatusColoredText (t , string (w .VerbBuildStatus )), getStatusColoredText (t , getShellDisplayStatus (w )), w .ID , instanceString }}
439422 ta .AppendRows (workspaceRow )
440423 }
441424 ta .Render ()
442425}
443426
427+ func getShellDisplayStatus (w entity.Workspace ) string {
428+ status := entity .NotReady
429+ if w .Status == entity .Running && w .VerbBuildStatus == entity .Completed {
430+ status = entity .Ready
431+ }
432+ return status
433+ }
434+
444435func getWorkspaceDisplayStatus (w entity.Workspace ) string {
445436 status := w .Status
446437 if w .Status == entity .Running && w .HealthStatus == entity .Unhealthy {
@@ -480,11 +471,11 @@ func displayProjectsTable(projects []virtualproject.VirtualProject) {
480471
481472func getStatusColoredText (t * terminal.Terminal , status string ) string {
482473 switch status {
483- case entity .Running :
474+ case entity .Running , entity . Ready , string ( entity . Completed ) :
484475 return t .Green (status )
485- case entity .Starting , entity .Deploying , entity .Stopping :
476+ case entity .Starting , entity .Deploying , entity .Stopping , string ( entity . Building ), string ( entity . Pending ) :
486477 return t .Yellow (status )
487- case entity .Failure , entity .Deleting , entity .Unhealthy :
478+ case entity .Failure , entity .Deleting , entity .Unhealthy , string ( entity . CreateFailed ) :
488479 return t .Red (status )
489480 default :
490481 return status
0 commit comments