Small progress tweaks. (#1218)

This commit is contained in:
CyrusNajmabadi 2018-04-16 19:46:57 -07:00 committed by GitHub
parent 2a9cf66ed0
commit 0bd3036115
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 9 deletions

View file

@ -474,7 +474,7 @@ func (display *ProgressDisplay) processNormalEvent(event engine.Event) {
if len(display.rows) == 0 { if len(display.rows) == 0 {
// about to make our first status message. make sure we present the header line first. // about to make our first status message. make sure we present the header line first.
display.rows = append(display.rows, &headerRowData{}) display.rows = append(display.rows, &headerRowData{display: display})
} }
// At this point, all events should relate to resources. // At this point, all events should relate to resources.
@ -627,19 +627,19 @@ func (display *ProgressDisplay) getStepDoneDescription(step engine.StepEventMeta
func getPreviewText(op deploy.StepOp) string { func getPreviewText(op deploy.StepOp) string {
switch op { switch op {
case deploy.OpSame: case deploy.OpSame:
return "[no change]" return "no change"
case deploy.OpCreate: case deploy.OpCreate:
return "[create]" return "create"
case deploy.OpUpdate: case deploy.OpUpdate:
return "[update]" return "update"
case deploy.OpDelete: case deploy.OpDelete:
return "[delete]" return "delete"
case deploy.OpReplace: case deploy.OpReplace:
return "[replace]" return "replace"
case deploy.OpCreateReplacement: case deploy.OpCreateReplacement:
return "[create for replacement]" return "create for replacement"
case deploy.OpDeleteReplaced: case deploy.OpDeleteReplaced:
return "[delete for replacement]" return "delete for replacement"
} }
contract.Failf("Unrecognized resource step op: %v", op) contract.Failf("Unrecognized resource step op: %v", op)

View file

@ -42,6 +42,7 @@ type ResourceRow interface {
// Implementation of a Row, used for the header of the grid. // Implementation of a Row, used for the header of the grid.
type headerRowData struct { type headerRowData struct {
display *ProgressDisplay
columns []string columns []string
uncolorizedColumns []string uncolorizedColumns []string
} }
@ -56,7 +57,13 @@ func (data *headerRowData) ColorizedColumns() []string {
return blue(msg) return blue(msg)
} }
data.columns = []string{"#", header("Resource Type"), header("Name"), header("Status"), header("Extra Info")} var statusColumn string
if data.display.isPreview {
statusColumn = header("Plan")
} else {
statusColumn = header("Status")
}
data.columns = []string{"#", header("Resource Type"), header("Name"), statusColumn, header("Extra Info")}
} }
return data.columns return data.columns