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:
parent
98de21374a
commit
9bea20442f
@ -80,28 +80,28 @@ 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,
|
||||||
"City": info.City,
|
"City": info.City,
|
||||||
"Region": info.Region,
|
"Region": info.Region,
|
||||||
"Country": info.Country,
|
"Country": info.Country,
|
||||||
"Coordinates": info.Coordinates,
|
"Coordinates": info.Coordinates,
|
||||||
"PostalCode": info.PostalCode,
|
"PostalCode": info.PostalCode,
|
||||||
"Organization": info.Organization,
|
"Organization": info.Organization,
|
||||||
})
|
})
|
||||||
|
|
||||||
widget.result = resultBuffer.String()
|
widget.result = resultBuffer.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user