Skip to content

Commit

Permalink
Merge pull request #146 from kaytu-io/fix-approved-plugins
Browse files Browse the repository at this point in the history
fix: add resource name to details
  • Loading branch information
artaasadi authored May 21, 2024
2 parents e092c8c + 8c17d30 commit 497f8e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion view/page_optimization.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (m OptimizationsPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
i.ResourceType,
i.Region,
i.Platform,
fmt.Sprintf("$%s (%%%.2f)", utils.FormatFloat(totalSaving), (totalSaving/totalCurrentCost)*100),
fmt.Sprintf("$%s (%.2f%%)", utils.FormatFloat(totalSaving), (totalSaving/totalCurrentCost)*100),
}
if i.Skipped {
row[5] = "skipped"
Expand Down
14 changes: 8 additions & 6 deletions view/page_optimization_details.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,20 @@ func (m OptimizationDetailsPage) OnOpen() Page {
}

deviceColumns := []table.Column{
table.NewColumn("0", "DeviceID", 30),
table.NewColumn("1", "ResourceType", 20),
table.NewColumn("2", "Runtime", 13),
table.NewColumn("3", "Current Cost", 20),
table.NewColumn("4", "Right sized Cost", 20),
table.NewColumn("5", "Savings", 20),
table.NewColumn("0", "Resource ID", 30),
table.NewColumn("1", "Resource Name", 23),
table.NewColumn("2", "ResourceType", 20),
table.NewColumn("3", "Runtime", 13),
table.NewColumn("4", "Current Cost", 20),
table.NewColumn("5", "Right sized Cost", 20),
table.NewColumn("6", "Savings", 20),
}

deviceRows := Rows{}
for _, dev := range item.Devices {
deviceRows = append(deviceRows, Row{
dev.DeviceId,
item.Name,
dev.ResourceType,
dev.Runtime,
fmt.Sprintf("$%s", utils.FormatFloat(dev.CurrentCost)),
Expand Down

0 comments on commit 497f8e6

Please sign in to comment.