Skip to content

Commit 30acb7e

Browse files
authored
web(d-web): V36 share-version crossing widget on embedded dashboard (#430)
Surfaces ratchet state at a glance from the existing /v36_status JSON (VOTING/ACTIVATED, vote %, work-weighted signaling, current->target share version) -- the same internal state debug.log uses, never a stub. Charter #3 (crossing visibility): makes the live V35->V36 cross legible to the operator directly in the dashboard, serving LTC prod #288. Static drop-in to the on-disk --dashboard-dir; card defaults hidden and renders only on a successful fetch, so it degrades gracefully on coins or nodes where /v36_status is empty. Non-consensus web layer only. Co-authored-by: frstrtr <frstrtr@users.noreply.github.com>
1 parent 47ed9d0 commit 30acb7e

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

web-static/dashboard.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,6 +1783,13 @@ <h3><span class="icon">🌐</span> c2pool Hash Rate</h3>
17831783
<div class="stat-sub">DOA+Orphan: <span id="pool_stale">-</span></div>
17841784
<div class="stat-detail">Share Difficulty: <span id="difficulty">-</span></div>
17851785
</div>
1786+
<!-- V36 crossing-state: truthful ratchet visibility from /v36_status (charter #3) -->
1787+
<div class="stat-card" id="v36_card" style="display:none;">
1788+
<h3><span class="icon">🔀</span> Share-Version Crossing</h3>
1789+
<div class="stat-value" id="v36_status_label">-</div>
1790+
<div class="stat-sub">Vote: <span id="v36_vote_pct">-</span> &nbsp;·&nbsp; Work-weighted: <span id="v36_ww_pct">-</span></div>
1791+
<div class="stat-detail"><span id="v36_share_label">-</span> &rarr; <span id="v36_target_label">-</span> <span id="v36_msg" style="opacity:0.7;"></span></div>
1792+
</div>
17861793
</div>
17871794

17881795
<!-- Right Column: Top stats row + Graph -->
@@ -2880,6 +2887,31 @@ <h4>Legend</h4>
28802887
d3.json('../global_stats', function(d) { _gs = d; _tryRenderStats(); });
28812888
d3.json('../merged_stats', function(d) { _ms = d || {}; _tryRenderStats(); });
28822889
d3.json('../best_share', function(d) { _bs = d || {}; _tryRenderStats(); });
2890+
d3.json('../v36_status', function(d) { if (d) renderV36Status(d); });
2891+
}
2892+
2893+
// V36 crossing widget: maps /v36_status ratchet state to an at-a-glance label.
2894+
// Sourced from the same internal state debug.log uses -- never a stub.
2895+
function renderV36Status(v) {
2896+
var card = document.getElementById('v36_card');
2897+
if (!card) return;
2898+
var labels = {
2899+
no_transition: 'ACTIVATED',
2900+
activating: 'ACTIVATING',
2901+
signaling_strong: 'VOTING (strong)',
2902+
signaling: 'VOTING',
2903+
propagating: 'PROPAGATING',
2904+
building_chain: 'BUILDING CHAIN',
2905+
waiting: 'WAITING'
2906+
};
2907+
card.style.display = '';
2908+
card.classList.toggle('transitioning', !!v.is_transitioning);
2909+
d3.select('#v36_status_label').text(labels[v.status] || v.status || '-');
2910+
d3.select('#v36_vote_pct').text(v.overall_v36_vote_pct != null ? v.overall_v36_vote_pct + '%' : '-');
2911+
d3.select('#v36_ww_pct').text(v.sampling_signaling != null ? v.sampling_signaling + '%' : '-');
2912+
d3.select('#v36_share_label').text(v.current_share_name || (v.current_share_type != null ? 'V' + v.current_share_type : '-'));
2913+
d3.select('#v36_target_label').text(v.target_version_name || (v.target_version != null ? 'V' + v.target_version : '-'));
2914+
d3.select('#v36_msg').text(v.message ? '\u00b7 ' + v.message : '');
28832915
}
28842916

28852917
function renderBestShare(bs) {

0 commit comments

Comments
 (0)