Skip to content

Commit

Permalink
feat: use a dash to mark an unknown node info value
Browse files Browse the repository at this point in the history
  • Loading branch information
bochaco committed Dec 10, 2024
1 parent cfe329d commit 67dbb50
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/nodes_list_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,13 @@ fn NodeInstanceView(
let peer_id = move || {
info.read()
.short_peer_id()
.unwrap_or_else(|| "unknown".to_string())
.unwrap_or_else(|| " -".to_string())
};

let rewards_addr = move || {
info.read()
.short_rewards_addr()
.unwrap_or_else(|| "unknown".to_string())
.unwrap_or_else(|| " -".to_string())
};

let node_card_clicked = move || {
Expand Down Expand Up @@ -312,7 +312,7 @@ fn NodeInstanceView(
</p>
<p>
<span class="node-info-item">"Version: "</span>
{move || info.get().bin_version.unwrap_or_else(|| "unknown".to_string())}
{move || info.get().bin_version.unwrap_or_else(|| " -".to_string())}
</p>
<p>
<div class="flex flex-row">
Expand All @@ -321,15 +321,15 @@ fn NodeInstanceView(
{move || {
info.read()
.balance
.map_or("unknown".to_string(), |v| v.to_string())
.map_or(" -".to_string(), |v| v.to_string())
}}
</div>
<div class="basis-1/2">
<span class="node-info-item">"Rewards: "</span>
{move || {
info.read()
.rewards
.map_or("unknown".to_string(), |v| v.to_string())
.map_or(" -".to_string(), |v| v.to_string())
}}
</div>
</div>
Expand All @@ -345,23 +345,23 @@ fn NodeInstanceView(
{move || {
info.read()
.port
.map_or("unknown".to_string(), |v| v.to_string())
.map_or(" -".to_string(), |v| v.to_string())
}}
</div>
<div class="basis-2/3">
<span class="node-info-item">"Node metrics Port: "</span>
{move || {
info.read()
.metrics_port
.map_or("unknown".to_string(), |v| v.to_string())
.map_or(" -".to_string(), |v| v.to_string())
}}
</div>
</div>
</p>
<p>
<span class="node-info-item">"Store cost: "</span>
{move || {
info.read().store_cost.map_or("unknown".to_string(), |v| v.to_string())
info.read().store_cost.map_or(" -".to_string(), |v| v.to_string())
}}
</p>
<p>
Expand All @@ -371,15 +371,15 @@ fn NodeInstanceView(
{move || {
info.read()
.records
.map_or("unknown".to_string(), |v| v.to_string())
.map_or(" -".to_string(), |v| v.to_string())
}}
</div>
<div class="basis-1/2">
<span class="node-info-item">"Relevant: "</span>
{move || {
info.read()
.relevant_records
.map_or("unknown".to_string(), |v| v.to_string())
.map_or(" -".to_string(), |v| v.to_string())
}}
</div>
</div>
Expand All @@ -391,15 +391,15 @@ fn NodeInstanceView(
{move || {
info.read()
.connected_peers
.map_or("unknown".to_string(), |v| v.to_string())
.map_or(" -".to_string(), |v| v.to_string())
}}
</div>
<div class="basis-1/2">
<span class="node-info-item">"Shunned by: "</span>
{move || {
info.read()
.shunned_count
.map_or("unknown".to_string(), |v| v.to_string())
.map_or(" -".to_string(), |v| v.to_string())
}}
</div>
</div>
Expand All @@ -409,7 +409,7 @@ fn NodeInstanceView(
{move || {
info.read()
.kbuckets_peers
.map_or("unknown".to_string(), |v| v.to_string())
.map_or(" -".to_string(), |v| v.to_string())
}}
</p>
<p>
Expand Down

0 comments on commit 67dbb50

Please sign in to comment.