-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bca1cf6
commit 5a733b0
Showing
11 changed files
with
108 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/bporter816/aws-tui/repo" | ||
"github.com/bporter816/aws-tui/ui" | ||
"github.com/bporter816/aws-tui/view" | ||
) | ||
|
||
type EBSTags struct { | ||
*ui.Table | ||
view.EBS | ||
resourceId string | ||
repo *repo.EC2 | ||
app *Application | ||
} | ||
|
||
func NewEBSTags(resourceId string, repo *repo.EC2, app *Application) *EBSTags { | ||
e := &EBSTags{ | ||
Table: ui.NewTable([]string{ | ||
"KEY", | ||
"VALUE", | ||
}, 1, 0), | ||
resourceId: resourceId, | ||
repo: repo, | ||
app: app, | ||
} | ||
return e | ||
} | ||
|
||
func (e EBSTags) GetLabels() []string { | ||
return []string{e.resourceId, "Tags"} | ||
} | ||
|
||
func (e EBSTags) GetKeyActions() []KeyAction { | ||
return []KeyAction{} | ||
} | ||
|
||
func (e EBSTags) Render() { | ||
model, err := e.repo.ListTags(e.resourceId) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
var data [][]string | ||
for _, v := range model { | ||
data = append(data, []string{ | ||
v.Key, | ||
v.Value, | ||
}) | ||
} | ||
e.SetData(data) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/bporter816/aws-tui/repo" | ||
"github.com/bporter816/aws-tui/ui" | ||
"github.com/bporter816/aws-tui/view" | ||
) | ||
|
||
type VPCTags struct { | ||
*ui.Table | ||
view.VPC | ||
repo *repo.EC2 | ||
resourceId string | ||
app *Application | ||
} | ||
|
||
func NewVPCTags(repo *repo.EC2, resourceId string, app *Application) *VPCTags { | ||
e := &VPCTags{ | ||
Table: ui.NewTable([]string{ | ||
"KEY", | ||
"VALUE", | ||
}, 1, 0), | ||
repo: repo, | ||
resourceId: resourceId, | ||
app: app, | ||
} | ||
return e | ||
} | ||
|
||
func (e VPCTags) GetLabels() []string { | ||
return []string{e.resourceId, "Tags"} | ||
} | ||
|
||
func (e VPCTags) GetKeyActions() []KeyAction { | ||
return []KeyAction{} | ||
} | ||
|
||
func (e VPCTags) Render() { | ||
model, err := e.repo.ListTags(e.resourceId) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
var data [][]string | ||
for _, v := range model { | ||
data = append(data, []string{ | ||
v.Key, | ||
v.Value, | ||
}) | ||
} | ||
e.SetData(data) | ||
} |
Oops, something went wrong.