(instance models.AppInstanceFields)
| 49 | } |
| 50 | |
| 51 | func ColoredInstanceState(instance models.AppInstanceFields) (colored string) { |
| 52 | state := string(instance.State) |
| 53 | switch state { |
| 54 | case models.ApplicationStateStarted, models.ApplicationStateRunning: |
| 55 | colored = T("running") |
| 56 | case models.ApplicationStateStopped: |
| 57 | colored = terminal.StoppedColor(T("stopped")) |
| 58 | case models.ApplicationStateCrashed: |
| 59 | colored = terminal.CrashedColor(T("crashed")) |
| 60 | case models.ApplicationStateFlapping: |
| 61 | colored = terminal.CrashedColor(T("crashing")) |
| 62 | case models.ApplicationStateDown: |
| 63 | colored = terminal.CrashedColor(T("down")) |
| 64 | case models.ApplicationStateStarting: |
| 65 | colored = terminal.AdvisoryColor(T("starting")) |
| 66 | default: |
| 67 | colored = terminal.WarningColor(state) |
| 68 | } |
| 69 | |
| 70 | return |
| 71 | } |
no test coverage detected