Add active swarm count to service node list

This commit is contained in:
Jason Rhinelander 2022-02-09 12:10:55 -04:00
parent 1a1b74ba79
commit 5c18cd3325
3 changed files with 6 additions and 1 deletions

View File

@ -352,6 +352,7 @@ def main(refresh=None, page=0, per_page=None, first=None, last=None, style=None)
emission=coinbase.get(),
hf=hfinfo.get(),
active_sns=active_sns,
active_swarms=len(set(x['swarm_id'] for x in active_sns)),
inactive_sns=inactive_sns,
awaiting_sns=awaiting_sns,
blocks=blocks,
@ -385,6 +386,7 @@ def sns():
return flask.render_template('service_nodes.html',
info=info.get(),
active_sns=active,
active_swarms=len(set(x['swarm_id'] for x in active)),
awaiting_sns=awaiting,
inactive_sns=inactive,
)

View File

@ -467,7 +467,7 @@ td span.checkpoint-not-signed { color: #c50022; }
text-overflow: ellipsis;
}
h3 .sn-count {
h3 .sn-count, h4 .sn-count {
font-weight: bold;
}

View File

@ -17,6 +17,9 @@
<h2 style="margin-bottom: 0px">Active Service Nodes <span class="sn-count">({{active_sns | count}})</span></h2>
<h4 class="Subtitle">Current storage swarm count:
<span class="sn-count" title="= {{"%.2f"|format(active_sns | count / active_swarms)}} SNs per swarm">{{active_swarms}}</span>
</h4>
<div class="TitleDivider sn-active"></div>
{%include 'include/sn_active.html'%}
</div>