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

Fix styling issue with IPInfo module

Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
Chris Cummer 2019-12-12 11:29:53 -08:00
parent 98de21374a
commit 9bea20442f

View File

@ -80,14 +80,14 @@ func (widget *Widget) setResult(info *ipinfo) {
formatableText("City", "City") + formatableText("City", "City") +
formatableText("Region", "Region") + formatableText("Region", "Region") +
formatableText("Country", "Country") + formatableText("Country", "Country") +
formatableText("Coords", "Coordinates") + formatableText("Loc", "Coordinates") +
formatableText("Org", "Organization"), formatableText("Org", "Organization"),
) )
resultBuffer := new(bytes.Buffer) resultBuffer := new(bytes.Buffer)
resultTemplate.Execute(resultBuffer, map[string]string{ resultTemplate.Execute(resultBuffer, map[string]string{
"nameColor": widget.settings.common.Colors.Subheading, "subheadingColor": widget.settings.common.Colors.Subheading,
"valueColor": widget.settings.common.Colors.Text, "valueColor": widget.settings.common.Colors.Text,
"Ip": info.Ip, "Ip": info.Ip,
"Hostname": info.Hostname, "Hostname": info.Hostname,
@ -103,5 +103,5 @@ func (widget *Widget) setResult(info *ipinfo) {
} }
func formatableText(key, value string) string { func formatableText(key, value string) string {
return fmt.Sprintf(" [{{.nameColor}}]%8s: [{{.valueColor}}]{{.%s}}\n", key, value) return fmt.Sprintf(" [{{.subheadingColor}}]%8s[-:-:-] [{{.valueColor}}]{{.%s}}\n", key, value)
} }