mirror of
https://github.com/status-im/status-go-monitor.git
synced 2025-01-27 03:24:46 +00:00
add Wrap setting to views, add local addr to peer details
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
f2a7540bb8
commit
fce1049354
1
main.go
1
main.go
@ -57,6 +57,7 @@ func main() {
|
||||
Name: "info",
|
||||
Title: "Details",
|
||||
Placeholder: "Loading details...",
|
||||
Wrap: true,
|
||||
// corner positions
|
||||
TopLeft: func(mx, my int) (int, int) {
|
||||
return 0, my/2 + 1
|
||||
|
5
peers.go
5
peers.go
@ -70,11 +70,12 @@ func writePeerDetails(g *gocui.Gui, peer *Peer) {
|
||||
return err
|
||||
}
|
||||
v.Clear()
|
||||
fmt.Fprintf(v, strings.Repeat("%-8s: %s\n", 5),
|
||||
fmt.Fprintf(v, strings.Repeat("%-8s: %s\n", 6),
|
||||
"Name", peer.Name,
|
||||
"ID", string(peer.Id),
|
||||
"Enode", peer.Enode,
|
||||
"Address", peer.Network.RemoteAddress,
|
||||
"Local", peer.Network.LocalAddress,
|
||||
"Remote", peer.Network.RemoteAddress,
|
||||
"Caps", strings.Join(peer.Caps, ", "))
|
||||
return nil
|
||||
})
|
||||
|
4
view.go
4
view.go
@ -10,6 +10,7 @@ type ViewController struct {
|
||||
Name string
|
||||
Title string
|
||||
Placeholder string
|
||||
Wrap bool
|
||||
Cursor bool
|
||||
Current bool
|
||||
Highlight bool
|
||||
@ -38,9 +39,10 @@ func (m *ViewManager) Layout(g *gocui.Gui) error {
|
||||
if err == nil && err != gocui.ErrUnknownView {
|
||||
return err
|
||||
}
|
||||
v.Title = cfg.Title
|
||||
v.Wrap = cfg.Wrap
|
||||
v.SelFgColor = cfg.SelFgColor
|
||||
v.SelBgColor = cfg.SelBgColor
|
||||
v.Title = cfg.Title
|
||||
v.Highlight = cfg.Highlight
|
||||
|
||||
if cfg.Cursor {
|
||||
|
Loading…
x
Reference in New Issue
Block a user