mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 11:31:08 +03:00
show header and chain tip hashes on status page in tui (#1951)
This commit is contained in:
parent
39ebb33ba1
commit
408fcc386e
1 changed files with 14 additions and 0 deletions
|
@ -47,6 +47,10 @@ impl TUIStatusListener for TUIStatusView {
|
||||||
).child(
|
).child(
|
||||||
LinearLayout::new(Orientation::Horizontal)
|
LinearLayout::new(Orientation::Horizontal)
|
||||||
.child(TextView::new("------------------------")),
|
.child(TextView::new("------------------------")),
|
||||||
|
).child(
|
||||||
|
LinearLayout::new(Orientation::Horizontal)
|
||||||
|
.child(TextView::new("Header Tip Hash: "))
|
||||||
|
.child(TextView::new(" ").with_id("basic_header_tip_hash")),
|
||||||
).child(
|
).child(
|
||||||
LinearLayout::new(Orientation::Horizontal)
|
LinearLayout::new(Orientation::Horizontal)
|
||||||
.child(TextView::new("Header Chain Height: "))
|
.child(TextView::new("Header Chain Height: "))
|
||||||
|
@ -58,6 +62,10 @@ impl TUIStatusListener for TUIStatusView {
|
||||||
).child(
|
).child(
|
||||||
LinearLayout::new(Orientation::Horizontal)
|
LinearLayout::new(Orientation::Horizontal)
|
||||||
.child(TextView::new("------------------------")),
|
.child(TextView::new("------------------------")),
|
||||||
|
).child(
|
||||||
|
LinearLayout::new(Orientation::Horizontal)
|
||||||
|
.child(TextView::new("Tip Hash: "))
|
||||||
|
.child(TextView::new(" ").with_id("tip_hash")),
|
||||||
).child(
|
).child(
|
||||||
LinearLayout::new(Orientation::Horizontal)
|
LinearLayout::new(Orientation::Horizontal)
|
||||||
.child(TextView::new("Chain Height: "))
|
.child(TextView::new("Chain Height: "))
|
||||||
|
@ -213,12 +221,18 @@ impl TUIStatusListener for TUIStatusView {
|
||||||
c.call_on_id("connected_peers", |t: &mut TextView| {
|
c.call_on_id("connected_peers", |t: &mut TextView| {
|
||||||
t.set_content(stats.peer_count.to_string());
|
t.set_content(stats.peer_count.to_string());
|
||||||
});
|
});
|
||||||
|
c.call_on_id("tip_hash", |t: &mut TextView| {
|
||||||
|
t.set_content(stats.head.last_block_h.to_string());
|
||||||
|
});
|
||||||
c.call_on_id("chain_height", |t: &mut TextView| {
|
c.call_on_id("chain_height", |t: &mut TextView| {
|
||||||
t.set_content(stats.head.height.to_string());
|
t.set_content(stats.head.height.to_string());
|
||||||
});
|
});
|
||||||
c.call_on_id("basic_total_difficulty", |t: &mut TextView| {
|
c.call_on_id("basic_total_difficulty", |t: &mut TextView| {
|
||||||
t.set_content(stats.head.total_difficulty.to_string());
|
t.set_content(stats.head.total_difficulty.to_string());
|
||||||
});
|
});
|
||||||
|
c.call_on_id("basic_header_tip_hash", |t: &mut TextView| {
|
||||||
|
t.set_content(stats.header_head.last_block_h.to_string());
|
||||||
|
});
|
||||||
c.call_on_id("basic_header_chain_height", |t: &mut TextView| {
|
c.call_on_id("basic_header_chain_height", |t: &mut TextView| {
|
||||||
t.set_content(stats.header_head.height.to_string());
|
t.set_content(stats.header_head.height.to_string());
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue