Skip to content

Commit 8658cca

Browse files
committed
misc(frontend): fix mobile layout overflow bugs, persist activity display mode
1 parent cc0aabe commit 8658cca

File tree

5 files changed

+44
-34
lines changed

5 files changed

+44
-34
lines changed

go.mod

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ require (
6565
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
6666
github.com/skygeario/go-confusable-homoglyphs v0.0.0-20191212061114-e2b2a60df110
6767
github.com/stripe/stripe-go/v72 v72.50.0
68-
github.com/swaggo/swag v1.16.4
6968
github.com/urfave/negroni v1.0.0
7069
github.com/wealdtech/go-ens/v3 v3.6.0
7170
github.com/wealdtech/go-eth2-types/v2 v2.8.1
@@ -98,7 +97,6 @@ require (
9897
cloud.google.com/go/longrunning v0.6.4 // indirect
9998
cloud.google.com/go/monitoring v1.22.1 // indirect
10099
github.com/ClickHouse/ch-go v0.61.5 // indirect
101-
github.com/KyleBanks/depth v1.2.1 // indirect
102100
github.com/MicahParks/keyfunc v1.9.0 // indirect
103101
github.com/Microsoft/go-winio v0.6.2 // indirect
104102
github.com/VictoriaMetrics/fastcache v1.12.2 // indirect
@@ -139,10 +137,6 @@ require (
139137
github.com/go-faster/errors v0.7.1 // indirect
140138
github.com/go-logr/logr v1.4.2 // indirect
141139
github.com/go-logr/stdr v1.2.2 // indirect
142-
github.com/go-openapi/jsonpointer v0.20.2 // indirect
143-
github.com/go-openapi/jsonreference v0.20.4 // indirect
144-
github.com/go-openapi/spec v0.20.14 // indirect
145-
github.com/go-openapi/swag v0.22.9 // indirect
146140
github.com/goccy/go-json v0.10.2 // indirect
147141
github.com/gofrs/flock v0.8.1 // indirect
148142
github.com/gogo/protobuf v1.3.2 // indirect
@@ -210,7 +204,6 @@ require (
210204
go.opentelemetry.io/otel/trace v1.31.0 // indirect
211205
go.uber.org/multierr v1.11.0 // indirect
212206
go.uber.org/zap v1.27.0 // indirect
213-
golang.org/x/tools v0.29.0 // indirect
214207
google.golang.org/appengine/v2 v2.0.2 // indirect
215208
google.golang.org/genproto v0.0.0-20241216192217-9240e9c98484 // indirect
216209
google.golang.org/genproto/googleapis/api v0.0.0-20250115164207-1a7da9e5054f // indirect

go.sum

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ=
3737
github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
3838
github.com/Gurpartap/storekit-go v0.0.0-20201205024111-36b6cd5c6a21 h1:HcdvlzaQ4CJfH7xbfJZ3ZHN//BTEpId46iKEMuP3wHE=
3939
github.com/Gurpartap/storekit-go v0.0.0-20201205024111-36b6cd5c6a21/go.mod h1:7PODFS++oNZ6khojmPBvkrDeFO/hrc3jmvWvQAOXorw=
40-
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
41-
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
4240
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
4341
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
4442
github.com/MicahParks/keyfunc v1.9.0 h1:lhKd5xrFHLNOWrDc4Tyb/Q1AJ4LCzQ48GVJyVIID3+o=
@@ -240,14 +238,6 @@ github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre
240238
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
241239
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
242240
github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78=
243-
github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q=
244-
github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs=
245-
github.com/go-openapi/jsonreference v0.20.4 h1:bKlDxQxQJgwpUSgOENiMPzCTBVuc7vTdXSSgNeAhojU=
246-
github.com/go-openapi/jsonreference v0.20.4/go.mod h1:5pZJyJP2MnYCpoeoMAql78cCHauHj0V9Lhc506VOpw4=
247-
github.com/go-openapi/spec v0.20.14 h1:7CBlRnw+mtjFGlPDRZmAMnq35cRzI91xj03HVyUi/Do=
248-
github.com/go-openapi/spec v0.20.14/go.mod h1:8EOhTpBoFiask8rrgwbLC3zmJfz4zsCUueRuPM6GNkw=
249-
github.com/go-openapi/swag v0.22.9 h1:XX2DssF+mQKM2DHsbgZK74y/zj4mo9I99+89xUmuZCE=
250-
github.com/go-openapi/swag v0.22.9/go.mod h1:3/OXnFfnMAwBD099SwYRk7GD3xOrr1iL7d/XNLXVVwE=
251241
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
252242
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
253243
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
@@ -847,8 +837,6 @@ github.com/stripe/stripe-go/v72 v72.50.0 h1:oy+EsSKMrFS3zzayb8Ic+2LZ04Ux0vJ4990/
847837
github.com/stripe/stripe-go/v72 v72.50.0/go.mod h1:QwqJQtduHubZht9mek5sds9CtQcKFdsykV9ZepRWwo0=
848838
github.com/supranational/blst v0.3.14 h1:xNMoHRJOTwMn63ip6qoWJ2Ymgvj7E2b9jY2FAwY+qRo=
849839
github.com/supranational/blst v0.3.14/go.mod h1:jZJtfjgudtNl4en1tzwPIV3KjUnQUvG3/j+w+fVonLw=
850-
github.com/swaggo/swag v1.16.4 h1:clWJtd9LStiG3VeijiCfOVODP6VpHtKdQy9ELFG3s1A=
851-
github.com/swaggo/swag v1.16.4/go.mod h1:VBsHJRsDvfYvqoiMKnsdwhNV9LEMHgEDZcyVYX0sxPg=
852840
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs=
853841
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48=
854842
github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e h1:cR8/SYRgyQCt5cNCMniB/ZScMkhI9nk8U5C7SbISXjo=

services/validator_tagger_scheduler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ func expandAndValidateSteps(names []string) ([]string, error) {
216216
for _, n := range names {
217217
if n == "all" {
218218
// Expand to daily steps only (no precompute) as "all" is intended for the daily chain
219-
for _, s := range []string{"import", "lido", "lido_csm", "lido_simple_dvt", "rocketpool", "withdrawal_tagging", "deposit_tagging", "populate_validator_names"} {
219+
for _, s := range []string{"import", "lido", "lido_csm", "lido_simple_dvt", "rocketpool", "withdrawal_tagging", "deposit_tagging", "populate_validator_names", "precompute"} {
220220
set[s] = struct{}{}
221221
}
222222
continue

templates/entity_detail.html

Lines changed: 42 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,28 @@
143143
function init() {
144144
var toggle = document.getElementById("activity-percent-toggle")
145145
if (!toggle) return
146-
setActivityMode(false)
146+
var storageKey = "entity_activity_display_mode"
147+
var initialPercentMode = false
148+
try {
149+
var saved = localStorage.getItem(storageKey)
150+
if (saved === "percent" || saved === "true" || saved === "1") {
151+
initialPercentMode = true
152+
} else if (saved === "absolute" || saved === "false" || saved === "0") {
153+
initialPercentMode = false
154+
}
155+
} catch (e) {
156+
// ignore storage errors
157+
}
158+
toggle.checked = initialPercentMode
159+
setActivityMode(initialPercentMode)
147160
toggle.addEventListener("change", function () {
148-
setActivityMode(toggle.checked)
161+
var newMode = toggle.checked
162+
try {
163+
localStorage.setItem(storageKey, newMode ? "percent" : "absolute")
164+
} catch (e) {
165+
// ignore storage errors
166+
}
167+
setActivityMode(newMode)
149168
})
150169
}
151170

@@ -402,6 +421,16 @@
402421
background-color: #6f42c1; /* purple */
403422
color: #ffffff;
404423
}
424+
/* Keep two columns in Duties, Income, Missed Rewards and Slashings grids even on smallest screens */
425+
@media (max-width: 575.98px) {
426+
.duties-grid > [class*="col-"],
427+
.income-grid > [class*="col-"],
428+
.missed-grid > [class*="col-"],
429+
.slashings-grid > [class*="col-"] {
430+
flex: 0 0 50%;
431+
max-width: 50%;
432+
}
433+
}
405434
</style>
406435
{{ end }}
407436

@@ -429,20 +458,20 @@ <h1 class="h4 mb-0 mr-2">Entity Dashboard</h1>
429458
</div>
430459
</div>
431460
<div class="mb-2 d-flex align-items-center justify-content-between">
432-
<div>
433-
<span class="badge badge-entity"><i class="fas fa-building mr-1" aria-hidden="true"></i> Entity</span>
461+
<div class="d-flex align-items-center" style="flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap;">
462+
<span class="badge badge-entity"><i class="fas fa-building" aria-hidden="true"></i> <span class="d-none d-sm-inline">Entity</span></span>
434463
{{ if and .Data.HasRealSubEntities (ne .Data.SubEntity "-") }}
435-
<a class="ml-2 font-weight-bold" href="/entity/{{ .Data.Entity | urlPathEscape }}/-">{{ .Data.Entity }}</a>
464+
<a class="font-weight-bold ml-2" href="/entity/{{ .Data.Entity | urlPathEscape }}/-" style="display: inline-block; max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom;" title="{{ .Data.Entity }}">{{ .Data.Entity }}</a>
436465
{{ else }}
437-
<span class="ml-2 font-weight-bold">{{ .Data.Entity }}</span>
466+
<span class="font-weight-bold ml-2" style="display: inline-block; max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom;" title="{{ .Data.Entity }}">{{ .Data.Entity }}</span>
438467
{{ end }}
439468
{{ if .Data.HasRealSubEntities }}
440469
<span class="mx-2">/</span>
441-
<span class="badge badge-subentity"><i class="fas fa-sitemap mr-1" aria-hidden="true"></i> Sub-Entity</span>
442-
<span class="ml-2 font-weight-bold">{{ .Data.SubEntity }}</span>
470+
<span class="badge badge-subentity"><i class="fas fa-sitemap" aria-hidden="true"></i> <span class="d-none d-sm-inline">Sub-Entity</span></span>
471+
<span class="font-weight-bold ml-2" style="display: inline-block; max-width: 50%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom;" title="{{ .Data.SubEntity }}">{{ .Data.SubEntity }}</span>
443472
{{ end }}
444473
</div>
445-
<div class="d-flex align-items-center">
474+
<div class="d-flex align-items-center" style="flex: 0 0 auto;">
446475
<span class="badge badge-pill bg-success text-white mr-2 px-2 py-1 validator-chip" {{ .Data.OnlineBreakdownHTML }} aria-label="Online validators: {{ formatThousandsInt .Data.OnlineCount }}">
447476
<i class="fas fa-power-off mr-1" aria-hidden="true"></i> {{ formatThousandsInt .Data.OnlineCount }}
448477
</span>
@@ -534,7 +563,7 @@ <h1 class="h4 mb-0 mr-2">Entity Dashboard</h1>
534563
</div>
535564
</div>
536565
</div>
537-
<div class="row">
566+
<div class="row duties-grid">
538567
<div class="col-sm-6 mb-2">
539568
<div class="stat-heading"><i class="fas fa-check-circle mr-1" aria-hidden="true"></i> Attestations</div>
540569
<div class="stat">
@@ -604,7 +633,7 @@ <h1 class="h4 mb-0 mr-2">Entity Dashboard</h1>
604633
<div class="card h-100">
605634
<div class="card-body">
606635
<div class="section-title mb-3"><i class="fas fa-coins mr-1" aria-hidden="true"></i> Income</div>
607-
<div class="row">
636+
<div class="row income-grid">
608637
<div class="col-sm-4 mb-2">
609638
<div class="stat text-warning">
610639
{{ formatElCurrency .Data.TotalRewardsWei "ETH" 2 true false false true }}
@@ -628,7 +657,7 @@ <h1 class="h4 mb-0 mr-2">Entity Dashboard</h1>
628657
</div>
629658
<hr />
630659
<div class="section-title mb-3"><i class="fas fa-times-circle mr-1" aria-hidden="true"></i> Missed Rewards</div>
631-
<div class="row">
660+
<div class="row missed-grid">
632661
<div class="col-sm-6 mb-2">
633662
<div class="stat text-warning">
634663
{{ formatClCurrency .Data.TotalMissedClRewards "ETH" 2 true false false
@@ -667,7 +696,7 @@ <h1 class="h4 mb-0 mr-2">Entity Dashboard</h1>
667696
</div>
668697
<hr />
669698
<div class="section-title mb-3"><i class="fas fa-gavel mr-1" aria-hidden="true"></i> Slashings</div>
670-
<div class="row">
699+
<div class="row slashings-grid">
671700
<div class="col-sm-6 mb-2">
672701
<div class="stat text-danger">{{ formatThousandsInt .Data.SlashedInPeriodMax }}</div>
673702
<div class="stat-label">Slashed Validators</div>

templates/index/recentBlocks.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ <h3 class="card-title d-flex justify-content-between align-items-center" style="
3737
</td>
3838
<td v-else v-html="block.status_formatted"></td>
3939
<td><span data-toggle="tooltip" data-placement="top" v-bind:data-original-title="block.ts | timestampTooltip">${block.ts | fromNow}</span></td>
40-
<td v-if="block.slot !== 0" v-html="block.proposer_formatted"></td>
40+
<td v-if="block.slot !== 0"><span class="p-0 m-0" style="display: block; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: inherit;" v-html="block.proposer_formatted"></span></td>
4141
<td v-else>N/A</td>
4242
<!-- <td class="text-monospace">
4343
<a v-if="block.status === 1 || block.status === 3" v-bind:href="'/block/' + block.block_root_formatted">0x${ block.block_root_formatted.substr(0, 6) }...</a>

0 commit comments

Comments
 (0)