Skip to content

Commit

Permalink
feat: add arch info (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
keidarcy committed May 22, 2024
1 parent 3c5001d commit e0d1ec4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions internal/view/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,14 @@ func (v *taskView) headerPagesParam(t types.Task) (items []headerItem) {
}
// network
subnetID := utils.EmptyText
eniID := utils.EmptyText
arch := utils.EmptyText
privateIP := utils.EmptyText
for _, a := range t.Attachments {
if *a.Type == "ElasticNetworkInterface" {
for _, d := range a.Details {
if *d.Name == "subnetId" {
subnetID = *d.Value
}
if *d.Name == "networkInterfaceId" {
eniID = *d.Value
}

if *d.Name == "privateIPv4Address" {
privateIP = *d.Value
Expand All @@ -144,6 +141,14 @@ func (v *taskView) headerPagesParam(t types.Task) (items []headerItem) {
}
}

if len(t.Attributes) > 0 {
for _, attribute := range t.Attributes {
if *attribute.Name == "ecs.cpu-architecture" {
arch = *attribute.Value
}
}
}

items = []headerItem{
{name: "Task ID", value: utils.ArnToName(t.TaskArn)},
{name: "Task definition", value: utils.ArnToName(t.TaskDefinitionArn)},
Expand All @@ -152,7 +157,7 @@ func (v *taskView) headerPagesParam(t types.Task) (items []headerItem) {
{name: "Launch type", value: string(t.LaunchType)},
{name: "Capacity provider", value: utils.ShowString(t.CapacityProviderName)},
{name: "Subnet ID", value: subnetID},
{name: "ENI ID", value: eniID},
{name: "Cpu Architecture", value: arch},
{name: "Private IP", value: privateIP},
{name: "Execute command", value: strconv.FormatBool(t.EnableExecuteCommand)},
{name: "Started by", value: utils.ShowString(t.StartedBy)},
Expand Down

0 comments on commit e0d1ec4

Please sign in to comment.