Skip to content

Commit

Permalink
add color for status of lifecycke for s3
Browse files Browse the repository at this point in the history
  • Loading branch information
aanamshaikh committed Jan 31, 2023
1 parent d170585 commit ff752c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/view/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,11 @@ func (a *App) setTableContentorLifecycle(table *tview.Table, rules []*s3.Lifecyc
indx := 0
for _, rule := range rules {
table.SetCell((indx + 2), 0, tview.NewTableCell(*rule.ID).SetTextColor(tcell.ColorYellow).SetAlign(tview.AlignCenter))
table.SetCell((indx + 2), 1, tview.NewTableCell(*rule.Status).SetTextColor(tcell.ColorYellow).SetAlign(tview.AlignCenter))
statusColor := tcell.ColorRed
if *rule.Status == "Enabled" {
statusColor = tcell.ColorDarkGreen
}
table.SetCell((indx + 2), 1, tview.NewTableCell(*rule.Status).SetTextColor(statusColor).SetAlign(tview.AlignCenter))
table.SetCell((indx + 2), 2, tview.NewTableCell(fmt.Sprintf("%v", *rule.Expiration.Days)).SetTextColor(tcell.ColorYellow).SetAlign(tview.AlignCenter))
table.SetCell((indx + 2), 3, tview.NewTableCell(strconv.Itoa(int(*rule.Transitions[0].Days))).SetTextColor(tcell.ColorYellow).SetAlign(tview.AlignCenter))
table.SetCell((indx + 2), 4, tview.NewTableCell(*rule.Transitions[0].StorageClass).SetTextColor(tcell.ColorYellow).SetAlign(tview.AlignCenter))
Expand Down

0 comments on commit ff752c3

Please sign in to comment.