Skip to content

Commit

Permalink
fix merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
aanamshaikh committed Feb 10, 2023
2 parents a4c24c2 + b8ec059 commit 97168b3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
6 changes: 3 additions & 3 deletions internal/render/iam_user_group.go
Expand Up @@ -12,8 +12,8 @@ type IAMUG struct {

func (iamug IAMUG) Header() Header {
return Header{
HeaderColumn{Name: "Group-Id", SortIndicatorIdx: 5, Align: tview.AlignLeft, Hide: false, Wide: false, MX: false, Time: false},
HeaderColumn{Name: "Group-Name", SortIndicatorIdx: 5, Align: tview.AlignLeft, Hide: false, Wide: false, MX: false, Time: false},
HeaderColumn{Name: "Group-Id", SortIndicatorIdx: 6, Align: tview.AlignLeft, Hide: false, Wide: false, MX: false, Time: false},
HeaderColumn{Name: "Group-Name", SortIndicatorIdx: 6, Align: tview.AlignLeft, Hide: false, Wide: false, MX: false, Time: false},
HeaderColumn{Name: "ARN", SortIndicatorIdx: -1, Align: tview.AlignLeft, Hide: false, Wide: false, MX: false, Time: false},
HeaderColumn{Name: "Created-Date", SortIndicatorIdx: 8, Align: tview.AlignLeft, Hide: false, Wide: false, MX: false, Time: true},
}
Expand All @@ -24,7 +24,7 @@ func (iamug IAMUG) Render(o interface{}, ns string, row *Row) error {
if !ok {
return fmt.Errorf("Expected iamugResp, but got %T", o)
}

row.ID = ns
row.Fields = Fields{
iamugResp.GroupId,
Expand Down
12 changes: 8 additions & 4 deletions internal/view/ec2.go
Expand Up @@ -33,10 +33,14 @@ func (e *EC2) bindKeys(aa ui.KeyActions) {

func (e *EC2) enterCmd(evt *tcell.EventKey) *tcell.EventKey {
instanceId := e.GetTable().GetSelectedItem()
f := describeResource
if e.GetTable().enterFn != nil {
f = e.GetTable().enterFn
if instanceId != "" {
f := describeResource
if e.GetTable().enterFn != nil {
f = e.GetTable().enterFn
}
f(e.App(), e.GetTable().GetModel(), e.Resource(), instanceId)
e.App().Flash().Info("Instance Id: " + instanceId)
}
f(e.App(), e.GetTable().GetModel(), e.Resource(), instanceId)

return nil
}
13 changes: 8 additions & 5 deletions internal/view/sec_grp.go
Expand Up @@ -28,12 +28,15 @@ func (sg SG) bindKeys(aa ui.KeyActions) {

func (sg *SG) enterCmd(evt *tcell.EventKey) *tcell.EventKey {
groupId := sg.GetTable().GetSelectedItem()
sg.App().Flash().Info("groupId: " + groupId)
if groupId != "" {
f := describeResource
if sg.GetTable().enterFn != nil {
f = sg.GetTable().enterFn
}
f(sg.App(), sg.GetTable().GetModel(), sg.Resource(), groupId)
sg.App().Flash().Info("groupId: " + groupId)

f := describeResource
if sg.GetTable().enterFn != nil {
f = sg.GetTable().enterFn
}
f(sg.App(), sg.GetTable().GetModel(), sg.Resource(), groupId)

return nil
}
6 changes: 5 additions & 1 deletion internal/view/table.go
Expand Up @@ -128,7 +128,11 @@ func (t *Table) importAsCSV(evt *tcell.EventKey) *tcell.EventKey {
if err != nil {
log.Info().Msg(fmt.Sprintf("error in creating csv directory: %v", err))
}
path = filepath.Join(path + "/" + csvFileName[len(csvFileName)-2] + "-" + profile + "-" + region + ".csv")
if csvFileName[len(csvFileName)-2] == "S3" || strings.Contains(csvFileName[len(csvFileName)-2], "IAM") {
path = filepath.Join(path + "/" + csvFileName[len(csvFileName)-2] + "-" + profile + ".csv")
} else {
path = filepath.Join(path + "/" + csvFileName[len(csvFileName)-2] + "-" + profile + "-" + region + ".csv")
}
file, err := os.Create(path)
if err != nil {
log.Info().Msg(fmt.Sprintf("error in creating csv file: %v", err))
Expand Down

0 comments on commit 97168b3

Please sign in to comment.