File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed
Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -71,11 +71,17 @@ type RowStyle struct{}
7171type SelectedStyle struct {}
7272
7373func (h CellStyle ) Style (i int , r table.Row ) lipgloss.Style {
74- switch r [i ] {
75- case "down" :
74+ switch {
75+ case r [2 ] == "down" :
76+ return styles .TextDarkRed
77+ case i == 2 && r [i ] == "allocated" :
7678 return styles .TextRed
77- case "mixed" :
79+ case i == 2 && r [i ] == "idle" :
80+ return styles .TextGreenIdle
81+ case i == 2 && r [i ] == "mixed" :
7882 return styles .TextOrange
83+ case i == 9 && strings .Contains (r [i ], "POWERED_DOWN" ):
84+ return styles .TextDarkRed
7985 default :
8086 return lipgloss .NewStyle ()
8187 }
Original file line number Diff line number Diff line change @@ -5,18 +5,22 @@ import (
55)
66
77var (
8- Blue = lipgloss .Color ("#0057b7" )
9- Yellow = lipgloss .Color ("#ffd700" )
10- Red = lipgloss .Color ("#cc0000" )
11- Green = lipgloss .Color ("#00b300" )
12- Orange = lipgloss .Color ("#FFA500" )
8+ Blue = lipgloss .Color ("#0057b7" )
9+ Yellow = lipgloss .Color ("#ffd700" )
10+ Red = lipgloss .Color ("#cc0000" )
11+ DarkRed = lipgloss .Color ("#990000" )
12+ Green = lipgloss .Color ("#00b300" )
13+ GreenIdle = lipgloss .Color ("#00cc66" )
14+ Orange = lipgloss .Color ("#FF8000" )
1315
1416 Bluegrey = lipgloss .Color ("#c2d1f0" )
1517
1618 // Generic text color styles
1719 TextRed = lipgloss .NewStyle ().Foreground (Red )
20+ TextDarkRed = lipgloss .NewStyle ().Foreground (DarkRed )
1821 TextYellow = lipgloss .NewStyle ().Foreground (Yellow )
1922 TextGreen = lipgloss .NewStyle ().Foreground (Green )
23+ TextGreenIdle = lipgloss .NewStyle ().Foreground (GreenIdle )
2024 TextBlue = lipgloss .NewStyle ().Foreground (Blue )
2125 TextOrange = lipgloss .NewStyle ().Foreground (Orange )
2226 TextBlueGrey = lipgloss .NewStyle ().Foreground (Bluegrey )
Original file line number Diff line number Diff line change @@ -441,7 +441,7 @@ func (m *Model) renderRow(rowID int) string {
441441 for i , value := range m .rows [rowID ] {
442442 style := lipgloss .NewStyle ().Width (m .cols [i ].Width ).MaxWidth (m .cols [i ].Width ).Inline (true )
443443 overlayedStyle := cellStyles [i ].Inherit (rowStyle )
444- overlayedStyle = overlayedStyle .Copy ().Inherit (selStyle )
444+ overlayedStyle = overlayedStyle .Copy ().Inherit (selStyle ). Padding ( 0 , 1 )
445445 //renderedCell := cellStyles[i].Inherit(rowStyle).Render(style.Render(runewidth.Truncate(value, m.cols[i].Width, "…")))
446446 renderedCell := overlayedStyle .Render (style .Render (runewidth .Truncate (value , m .cols [i ].Width , "…" )))
447447
You can’t perform that action at this time.
0 commit comments