Skip to content

Commit

Permalink
Fix network node page bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicletz committed Nov 21, 2024
1 parent 9207377 commit 5c85afc
Showing 1 changed file with 33 additions and 3 deletions.
36 changes: 33 additions & 3 deletions network/vue/node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@

<div v-if="typeof (traffic) != 'string' && prev_traffic != null">
<table class="data" style="table-layout: auto; width: auto;">
<caption>Current Epoch Fleet Activity</caption>
<caption>Epoch <% number(traffic['epoch']) %> Fleet Activity</caption>
<tr>
<th>Fleet</th>
<th>Devices</th>
Expand All @@ -197,10 +197,10 @@
<% number(fleet.total_tickets) %>
</td>
<td>
<% Math.round(bn(fleet.total_score)/(1024*1024)) %> MB
<% Math.round(bn(fleet.total_score)/(1024*1024*1024)) %> GB
</td>
<td>
<% (Math.round(fleet_score(fleet)/(1024*1024*1024) * 100) / 100).toFixed(2) %> GB
0 GB
</td>
<td v-if="last_score(fleet).gt(bn(fleet.total_score))">
<% estimated_value(fleet) %> *Estimate based on previous epoch
Expand All @@ -211,6 +211,33 @@
</td>
</tr>
</table>
<table class="data" style="table-layout: auto; width: auto;">
<caption>Epoch <% number(prev_traffic['epoch']) %> Fleet Activity</caption>
<tr>
<th>Fleet</th>
<th>Devices</th>
<th>Bandwidth Collected</th>
<th>Total Fleet Bandwidth Submitted</th>
<th>Estimated Reward</th>
</tr>
<tr v-for="fleet in prev_traffic['fleets'] ">
<td>
<a :href="'https://moonscan.io/address/' + fleet['fleet']" target="_blank"><% fleet['fleet'].substring(0,10) %></a>
</td>
<td>
<% number(fleet.total_tickets) %>
</td>
<td>
<% Math.round(bn(fleet.total_score)/(1024*1024*1024)) %> GB
</td>
<td>
<% (Math.round(fleet_score(fleet)/(1024*1024*1024) * 100) / 100).toFixed(2) %> GB
</td>
<td>
<% estimated_value(fleet) %>
</td>
</tr>
</table>
</div>
</div>
</div>
Expand Down Expand Up @@ -275,6 +302,9 @@ var DiodeNode = Vue.component("diode_node", {
estimated_value(fleet) {
let score = this.fleet_score(fleet)
if (score.isZero()) {
return "0"
}
let total_score = this.bn(fleet["total_score"])
if (total_score.gt(score)) {
// If the score of all collected tickets is higher than the fleet score
Expand Down

0 comments on commit 5c85afc

Please sign in to comment.