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:
parent
80edeef484
commit
6a7a07f1c1
@ -110,11 +110,11 @@ func (widget *Widget) getSystemInfo() string {
|
|||||||
func (widget *Widget) getContainerStates() string {
|
func (widget *Widget) getContainerStates() string {
|
||||||
cntrs, err := widget.cli.ContainerList(context.Background(), types.ContainerListOptions{All: true})
|
cntrs, err := widget.cli.ContainerList(context.Background(), types.ContainerListOptions{All: true})
|
||||||
if err != nil {
|
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 {
|
if len(cntrs) == 0 {
|
||||||
return "no containers"
|
return " no containers"
|
||||||
}
|
}
|
||||||
|
|
||||||
colorMap := map[string]string{
|
colorMap := map[string]string{
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
package docker
|
package docker
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/docker/docker/client"
|
"github.com/docker/docker/client"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/rivo/tview"
|
"github.com/rivo/tview"
|
||||||
@ -54,11 +56,11 @@ func (widget *Widget) refreshDisplayBuffer() {
|
|||||||
|
|
||||||
widget.displayBuffer = ""
|
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 += widget.getSystemInfo()
|
||||||
|
|
||||||
widget.displayBuffer += "\n"
|
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()
|
widget.displayBuffer += widget.getContainerStates()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user