minor fixups

pull/1/head
Jesse Duffield 5 years ago
parent a017067824
commit 02b735e011

@ -298,6 +298,8 @@ func (c *Container) GetColor() color.Attribute {
return color.FgRed
case "restarting":
return color.FgBlue
case "removing":
return color.FgMagenta
default:
return color.FgWhite
}

@ -238,7 +238,7 @@ func (c *Container) PlotGraph(spec config.GraphConfig, width int) (string, error
asciigraph.Width(width),
asciigraph.Min(min),
asciigraph.Max(max),
asciigraph.Caption(spec.Caption),
asciigraph.Caption(fmt.Sprintf("%s: %0.2f (%v)", spec.Caption, data[len(data)-1], time.Since(c.StatHistory[0].RecordedAt))),
), nil
}

@ -168,11 +168,17 @@ func (c *DockerCommand) GetContainersAndServices() error {
// find out which services have corresponding containers and assign them
for _, service := range services {
foundMatch := false
for _, container := range containers {
if container.ServiceID != "" && container.ServiceID == service.ID {
foundMatch = true
service.Container = container
break
}
}
if !foundMatch {
service.Container = nil
}
}
// sort services first by whether they have a linked container, and second by alphabetical order

@ -201,6 +201,20 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
Handler: gui.handleServiceAttach,
Description: gui.Tr.SLocalize("attach"),
},
{
ViewName: "services",
Key: '[',
Modifier: gocui.ModNone,
Handler: gui.handleServicesPrevContext,
Description: gui.Tr.SLocalize("previousContext"),
},
{
ViewName: "services",
Key: ']',
Modifier: gocui.ModNone,
Handler: gui.handleServicesNextContext,
Description: gui.Tr.SLocalize("nextContext"),
},
{
ViewName: "images",
Key: '[',

@ -115,7 +115,11 @@ func (gui *Gui) renderServiceConfig(mainView *gocui.View, service *commands.Serv
}
func (gui *Gui) renderServiceStats(mainView *gocui.View, service *commands.Service) error {
return nil
if service.Container == nil {
return nil
}
return gui.renderContainerStats(mainView, service.Container)
}
func (gui *Gui) renderServiceLogs(mainView *gocui.View, service *commands.Service) error {

Loading…
Cancel
Save