Set default Pending color to calming darkorange
parent
9f9812b897
commit
237d97e6cb
|
|
@ -259,7 +259,7 @@ func newStatus() Status {
|
|||
NewColor: "lightskyblue",
|
||||
ModifyColor: "greenyellow",
|
||||
AddColor: "dodgerblue",
|
||||
PendingColor: "orangered",
|
||||
PendingColor: "darkorange",
|
||||
ErrorColor: "orangered",
|
||||
HighlightColor: "aqua",
|
||||
KillColor: "mediumpurple",
|
||||
|
|
|
|||
|
|
@ -37,9 +37,18 @@ type ContainerWithMetrics interface {
|
|||
// Container renders a K8s Container to screen.
|
||||
type Container struct{}
|
||||
|
||||
// ColorGet returns a color for a state
|
||||
func ColorGet(s string,ns string, h Header, re RowEvent) tcell.Color {
|
||||
switch s {
|
||||
// ColorerFunc colors a resource row.
|
||||
func (c Container) ColorerFunc() ColorerFunc {
|
||||
return func(ns string, h Header, re RowEvent) tcell.Color {
|
||||
if !Happy(ns, h, re.Row) {
|
||||
return ErrColor
|
||||
}
|
||||
|
||||
stateCol := h.IndexOf("STATE", true)
|
||||
if stateCol == -1 {
|
||||
return DefaultColorer(ns, h, re)
|
||||
}
|
||||
switch strings.TrimSpace(re.Row.Fields[stateCol]) {
|
||||
case Pending:
|
||||
return PendingColor
|
||||
case ContainerCreating, PodInitializing:
|
||||
|
|
@ -53,21 +62,6 @@ func ColorGet(s string,ns string, h Header, re RowEvent) tcell.Color {
|
|||
default:
|
||||
return ErrColor
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// ColorerFunc colors a resource row.
|
||||
func (c Container) ColorerFunc() ColorerFunc {
|
||||
return func(ns string, h Header, re RowEvent) tcell.Color {
|
||||
if !Happy(ns, h, re.Row) {
|
||||
return ErrColor
|
||||
}
|
||||
|
||||
stateCol := h.IndexOf("STATE", true)
|
||||
if stateCol == -1 {
|
||||
return DefaultColorer(ns, h, re)
|
||||
}
|
||||
return ColorGet(strings.TrimSpace(re.Row.Fields[stateCol]), ns, h, re)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue