Skip to content

Commit

Permalink
WTF-847 Fix the formatting of the headings in the Docket widget
Browse files Browse the repository at this point in the history
Fixes #847

Signed-off-by: Chris Cummer <[email protected]>
  • Loading branch information
senorprogrammer committed Mar 16, 2020
1 parent 80edeef commit 6a7a07f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions modules/docker/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ func (widget *Widget) getSystemInfo() string {
func (widget *Widget) getContainerStates() string {
cntrs, err := widget.cli.ContainerList(context.Background(), types.ContainerListOptions{All: true})
if err != nil {
return errors.Wrapf(err, "could not get container list").Error()
return errors.Wrapf(err, " could not get container list").Error()
}

if len(cntrs) == 0 {
return "no containers"
return " no containers"
}

colorMap := map[string]string{
Expand Down
6 changes: 4 additions & 2 deletions modules/docker/widget.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package docker

import (
"fmt"

"github.com/docker/docker/client"
"github.com/pkg/errors"
"github.com/rivo/tview"
Expand Down Expand Up @@ -54,11 +56,11 @@ func (widget *Widget) refreshDisplayBuffer() {

widget.displayBuffer = ""

widget.displayBuffer += "[" + widget.settings.labelColor + "::bul]system\n"
widget.displayBuffer += fmt.Sprintf("[%s] System[white]\n", widget.settings.common.Colors.Subheading)
widget.displayBuffer += widget.getSystemInfo()

widget.displayBuffer += "\n"

widget.displayBuffer += "[" + widget.settings.labelColor + "::bul]containers\n"
widget.displayBuffer += fmt.Sprintf("[%s] Containers[white]\n", widget.settings.common.Colors.Subheading)
widget.displayBuffer += widget.getContainerStates()
}

0 comments on commit 6a7a07f

Please sign in to comment.