derailed 2019-12-30 18:01:34 -07:00
parent db4665ddd7
commit 49a2ab0a04
3 changed files with 1 additions and 37 deletions

View File

@ -36,6 +36,5 @@
45, 45,
60 60
] ]
} }
} }

View File

@ -146,38 +146,3 @@ func fuzzyFilter(q string, index int, data render.TableData) render.TableData {
return filtered return filtered
} }
// UpdateTitle refreshes the table title.
func styleTitle(rc int, ns, base, path, buff string, styles *config.Styles) string {
if rc > 0 {
rc--
}
base = strings.Title(base)
if ns == render.AllNamespaces {
ns = render.NamespaceAll
}
info := ns
if path != "" {
info = path
cns, n := render.Namespaced(path)
if cns == render.ClusterScope {
info = n
}
}
var title string
if info == "" || info == render.ClusterScope {
title = SkinTitle(fmt.Sprintf(titleFmt, base, rc), styles.Frame())
} else {
title = SkinTitle(fmt.Sprintf(nsTitleFmt, base, info, rc), styles.Frame())
}
if buff == "" {
return title
}
if IsLabelSelector(buff) {
buff = TrimLabelSelector(buff)
}
return title + SkinTitle(fmt.Sprintf(SearchFmt, buff), styles.Frame())
}

View File

@ -79,7 +79,7 @@ func (n *Namespace) decorate(data render.TableData) render.TableData {
render.RowEvent{ render.RowEvent{
Kind: render.EventUnchanged, Kind: render.EventUnchanged,
Row: render.Row{ Row: render.Row{
ID: render.AllNamespaces, ID: render.NamespaceAll,
Fields: render.Fields{render.NamespaceAll, "Active", "0"}, Fields: render.Fields{render.NamespaceAll, "Active", "0"},
}, },
}, },