Skip to content

Commit

Permalink
disable enter fucntionailt for table header
Browse files Browse the repository at this point in the history
  • Loading branch information
Abrar-Ahmed7 committed Feb 10, 2023
1 parent bb971c1 commit 16709af
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
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
}

0 comments on commit 16709af

Please sign in to comment.