Merge pull request #897 from tlipinski/aliases-colorer
Use DefaultColorer for aliases renderingmine
commit
e752cc1433
|
|
@ -5,7 +5,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal/client"
|
"github.com/derailed/k9s/internal/client"
|
||||||
"github.com/gdamore/tcell"
|
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
)
|
)
|
||||||
|
|
@ -15,9 +14,7 @@ type Alias struct{}
|
||||||
|
|
||||||
// ColorerFunc colors a resource row.
|
// ColorerFunc colors a resource row.
|
||||||
func (Alias) ColorerFunc() ColorerFunc {
|
func (Alias) ColorerFunc() ColorerFunc {
|
||||||
return func(ns string, _ Header, re RowEvent) tcell.Color {
|
return DefaultColorer
|
||||||
return tcell.ColorAliceBlue
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header returns a header row.
|
// Header returns a header row.
|
||||||
|
|
|
||||||
|
|
@ -25,15 +25,15 @@ func TestAliasColorer(t *testing.T) {
|
||||||
"addAll": {
|
"addAll": {
|
||||||
ns: client.AllNamespaces,
|
ns: client.AllNamespaces,
|
||||||
re: render.RowEvent{Kind: render.EventAdd, Row: r},
|
re: render.RowEvent{Kind: render.EventAdd, Row: r},
|
||||||
e: tcell.ColorAliceBlue},
|
e: tcell.ColorBlue},
|
||||||
"deleteAll": {
|
"deleteAll": {
|
||||||
ns: client.AllNamespaces,
|
ns: client.AllNamespaces,
|
||||||
re: render.RowEvent{Kind: render.EventDelete, Row: r},
|
re: render.RowEvent{Kind: render.EventDelete, Row: r},
|
||||||
e: tcell.ColorAliceBlue},
|
e: tcell.ColorGray},
|
||||||
"updateAll": {
|
"updateAll": {
|
||||||
ns: client.AllNamespaces,
|
ns: client.AllNamespaces,
|
||||||
re: render.RowEvent{Kind: render.EventUpdate, Row: r},
|
re: render.RowEvent{Kind: render.EventUpdate, Row: r},
|
||||||
e: tcell.ColorAliceBlue,
|
e: tcell.ColorBlack,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue