Skip to content

Commit

Permalink
Bids 2567/stats page for validators without index (#2625)
Browse files Browse the repository at this point in the history
* (BIDS-2567) Improve error handling and remove out-commented code

* (BIDS-2567) Improve and unify error logs in validator.go

* (BIDS-2567) Hide stats button for deposited/pending validators

* (BIDS-2567) Add period to most "could not find" pages

* (BIDS-2567) Add period to tx not found page

* (BIDS-2567) Remove line about mempool from validtor not found page

* (BIDS-2567) Implement requested changes from code review
  • Loading branch information
D13ce authored Oct 24, 2023
1 parent 206c355 commit 3d735ae
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 114 deletions.
276 changes: 173 additions & 103 deletions handlers/validator.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion templates/404notfound.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="container">
<div style="padding-top: 2rem;" class="row justify-content-between align-items-center">
<div class="col-md-6 mb-5">
<h2 style="font-size:1.8rem;">Sorry, the page you are looking for could not be found</h2>
<h2 style="font-size:1.8rem;">Sorry, the page you are looking for could not be found.</h2>
</div>
<div class="col-md-5 p-3">
{{ template "relax_svg" }}
Expand Down
2 changes: 1 addition & 1 deletion templates/dashboardnotfound.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{ define "content" }}
{{ with .Data }}
<div class="container mt-2">
<h1 class="mt-4 text-center">Sorry but we could not find the dashboard you are looking for</h1>
<h1 class="mt-4 text-center">Sorry but we could not find the dashboard you are looking for.</h1>
</div>
{{ end }}
{{ end }}
2 changes: 1 addition & 1 deletion templates/epochnotfound.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1 class="h4 mb-1 mb-md-0"><i class="fas fa-history mr-2"></i>Epoch not found</
</div>
<div class="card">
<div class="card-body">
<div class="d-1">Sorry but we could not find the epoch you are looking for</div>
<div class="d-1">Sorry but we could not find the epoch you are looking for.</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/eth1txnotfound.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h1 class="h4 mb-1 mb-md-0"><i class="fas fa-history mr-2"></i>Tx not found</h1>
</div>
<div class="card">
<div class="card-body">
<div class="d-1">Sorry but we could not find the tx you are looking for</div>
<div class="d-1">Sorry but we could not find the tx you are looking for.</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion templates/slotnotfound.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1 class="h4 mb-1 mb-md-0"><i class="fas fa-cube mr-2"></i>{{ if eq . "block" }
</div>
<div class="card">
<div class="card-body">
<div class="d-1">Sorry but we could not find the {{ if eq . "block" }}block{{ else }}slot{{ end }} you are looking for</div>
<div class="d-1">Sorry but we could not find the {{ if eq . "block" }}block{{ else }}slot{{ end }} you are looking for.</div>
</div>
</div>
</div>
Expand Down
12 changes: 7 additions & 5 deletions templates/validator/heading.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ <h1 class="h4 mb-1 mb-md-0 d-flex align-items-center">
</button>
</span>
{{ end }}
<span class="mx-1" data-toggle="tooltip" title="View daily statistics">
<a class="btn btn-dark text-white btn-sm" href="/validator/{{ .Index }}/stats">
<i class="fas fa-table"></i>
</a>
</span>
{{ if (and (ne .Status "deposited") (ne .Status "deposited_invalid") (ne .Status "pending")) }}
<span class="mx-1" data-toggle="tooltip" title="View daily statistics">
<a class="btn btn-dark text-white btn-sm" href="/validator/{{ .Index }}/stats">
<i class="fas fa-table"></i>
</a>
</span>
{{ end }}
</h1>
</div>
<nav aria-label="breadcrumb">
Expand Down
1 change: 0 additions & 1 deletion templates/validator/validatornotfound.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ <h1 class="h4 mb-1 mb-md-0"><i class="fas fa-male mr-2"></i>Validator not found<
<div class="card">
<div class="card-body">
<div class="d-1">Sorry, but we could not find the validator you are looking for.</div>
<div class="d-1">Stay calm, depending on the gas price of the transaction, <a href="https://kb.beaconcha.in/ethereum-2.0-and-depositing-process">it may still be in the mempool.</a></div>
</div>
</div>
</div>
Expand Down

0 comments on commit 3d735ae

Please sign in to comment.