File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
plugins/plugin-codeflare-dashboard/src/controller/dashboard Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 1717import stripAnsi from "strip-ansi"
1818import type { TextProps } from "ink"
1919
20+ import type Kind from "./kinds.js"
2021import type { Tail } from "./tailf.js"
2122import type Options from "./options.js"
2223import { isValidTheme , themes } from "./themes/utilization.js"
@@ -183,8 +184,14 @@ class Demo {
183184 }
184185}
185186
187+ /** foo => Foo; fOO => Foo; FOO => Foo */
186188function capitalize ( str : string ) {
187- return str [ 0 ] . toUpperCase ( ) + str . slice ( 1 )
189+ return str [ 0 ] . toUpperCase ( ) + str . slice ( 1 ) . toLowerCase ( )
190+ }
191+
192+ /** Displayed variant of `Kind` */
193+ function titleFor ( kind : Kind ) {
194+ return capitalize ( kind ) . replace ( / ( .* ) m e m / i, ( _ , p1 ) => p1 + ( ! p1 ? "" : " " ) + "Memory" )
188195}
189196
190197export default function utilizationDashboard (
@@ -214,5 +221,5 @@ export default function utilizationDashboard(
214221 }
215222
216223 const styledStates = states . map ( ( state ) => ( { state, style : styleOf [ state ] } ) )
217- return { title : capitalize ( kind ) , initWatcher, states : styledStates }
224+ return { title : titleFor ( kind ) , initWatcher, states : styledStates }
218225}
You can’t perform that action at this time.
0 commit comments