1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

WTF-847 Fix the formatting of the headings in the Docket widget

Fixes #847

Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
Chris Cummer 2020-03-15 20:12:15 -07:00
parent 80edeef484
commit 6a7a07f1c1
2 changed files with 6 additions and 4 deletions

View File

@ -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{

View File

@ -1,6 +1,8 @@
package docker
import (
"fmt"
"github.com/docker/docker/client"
"github.com/pkg/errors"
"github.com/rivo/tview"
@ -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()
}