(app models.ApplicationFields)
| 28 | } |
| 29 | |
| 30 | func ColoredAppInstances(app models.ApplicationFields) string { |
| 31 | healthString := fmt.Sprintf("%d/%d", app.RunningInstances, app.InstanceCount) |
| 32 | |
| 33 | if app.RunningInstances < 0 { |
| 34 | healthString = fmt.Sprintf("?/%d", app.InstanceCount) |
| 35 | } |
| 36 | |
| 37 | if app.RunningInstances == 0 { |
| 38 | if strings.ToLower(app.State) == models.ApplicationStateStopped { |
| 39 | return healthString |
| 40 | } |
| 41 | return terminal.CrashedColor(healthString) |
| 42 | } |
| 43 | |
| 44 | if app.RunningInstances < app.InstanceCount { |
| 45 | return terminal.WarningColor(healthString) |
| 46 | } |
| 47 | |
| 48 | return healthString |
| 49 | } |
| 50 | |
| 51 | func ColoredInstanceState(instance models.AppInstanceFields) (colored string) { |
| 52 | state := string(instance.State) |
no test coverage detected