MCPcopy Index your code
hub / github.com/cloudfoundry/cli / ColoredAppState

Function ColoredAppState

cf/uihelpers/ui.go:13–28  ·  view source on GitHub ↗
(app models.ApplicationFields)

Source from the content-addressed store, hash-verified

11)
12
13func ColoredAppState(app models.ApplicationFields) string {
14 appState := strings.ToLower(app.State)
15
16 if app.RunningInstances == 0 {
17 if appState == models.ApplicationStateStopped {
18 return appState
19 }
20 return terminal.CrashedColor(appState)
21 }
22
23 if app.RunningInstances < app.InstanceCount {
24 return terminal.WarningColor(appState)
25 }
26
27 return appState
28}
29
30func ColoredAppInstances(app models.ApplicationFields) string {
31 healthString := fmt.Sprintf("%d/%d", app.RunningInstances, app.InstanceCount)

Callers 2

ExecuteMethod · 0.92
ShowAppMethod · 0.92

Calls 2

CrashedColorFunction · 0.92
WarningColorFunction · 0.92

Tested by

no test coverage detected