Skip to content

chore: reorder instance server list collumns #738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions internal/namespaces/instance/v1/custom_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,23 @@ func serversMarshalerFunc(i interface{}, opt *human.MarshalOpt) (string, error)
type humanServerInList struct {
ID string
Name string
Type string
State instance.ServerState
Zone scw.Zone
PublicIP net.IP
PrivateIP *string
ImageName string
Tags []string
ImageName string
PlacementGroup *instance.PlacementGroup
ModificationDate time.Time
CreationDate time.Time
ImageID string
Protected bool
Volumes int
SecurityGroupID string
Protected bool
SecurityGroupName string
SecurityGroupID string
StateDetail string
Arch instance.Arch
PlacementGroup *instance.PlacementGroup
ImageID string
}

servers := i.([]*instance.Server)
Expand All @@ -87,22 +88,23 @@ func serversMarshalerFunc(i interface{}, opt *human.MarshalOpt) (string, error)
humanServers = append(humanServers, &humanServerInList{
ID: server.ID,
Name: server.Name,
Type: server.CommercialType,
State: server.State,
Zone: server.Zone,
ModificationDate: server.ModificationDate,
CreationDate: server.CreationDate,
ImageID: serverImageID,
ImageName: serverImageName,
Protected: server.Protected,
PublicIP: publicIPAddress,
PrivateIP: server.PrivateIP,
Tags: server.Tags,
ImageName: serverImageName,
PlacementGroup: server.PlacementGroup,
ModificationDate: server.ModificationDate,
CreationDate: server.CreationDate,
Volumes: len(server.Volumes),
SecurityGroupID: server.SecurityGroup.ID,
Protected: server.Protected,
SecurityGroupName: server.SecurityGroup.Name,
SecurityGroupID: server.SecurityGroup.ID,
StateDetail: server.StateDetail,
Arch: server.Arch,
PlacementGroup: server.PlacementGroup,
Tags: server.Tags,
ImageID: serverImageID,
})
}
return human.Marshal(humanServers, opt)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ID NAME STATE ZONE PUBLIC IP PRIVATE IP IMAGE NAME TAGS MODIFICATION DATE CREATION DATE IMAGE ID PROTECTED VOLUMES SECURITY GROUP ID SECURITY GROUP NAME STATE DETAIL ARCH
18e19087-4435-420b-abf7-a47c50a77fe7 cli-srv-mystifying-brattain archived fr-par-1 163.172.170.53 Ubuntu Bionic Beaver [] few seconds ago few seconds ago f974feac-abae-4365-b988-8ec7d1cec10d false 1 49822f6c-1d32-465c-a017-720691d159b2 Default security group - x86_64
ID NAME TYPE STATE ZONE PUBLIC IP PRIVATE IP TAGS IMAGE NAME MODIFICATION DATE CREATION DATE VOLUMES PROTECTED SECURITY GROUP NAME SECURITY GROUP ID STATE DETAIL ARCH IMAGE ID
18e19087-4435-420b-abf7-a47c50a77fe7 cli-srv-mystifying-brattain DEV1-S archived fr-par-1 163.172.170.53 [] Ubuntu Bionic Beaver few seconds ago few seconds ago 1 false Default security group 49822f6c-1d32-465c-a017-720691d159b2 - x86_64 f974feac-abae-4365-b988-8ec7d1cec10d