premix report page: add accounts section

This commit is contained in:
andri lim 2019-02-03 15:44:39 +07:00 committed by zah
parent e3b6ffe5ba
commit f75faf54c3
2 changed files with 27 additions and 4 deletions

View File

@ -264,7 +264,7 @@ function transactionsRenderer(txId, nimbus, geth) {
renderTx(ncr, gcr);
}
function headerRenderer(nimbus, geth) {
function accountsRenderer(nimbus, geth) {
function emptyAccount() {
return {
address: '',
@ -295,8 +295,8 @@ function headerRenderer(nimbus, geth) {
}
}
let container = $('#headerContainer').empty();
$('#headerTitle').text('Block #' + parseInt(geth.block.number, 16));
let container = $('#accountsContainer').empty();
$('#accountsTitle').text('Block #' + parseInt(geth.block.number, 16));
let ncs = deepCopy(nimbus.stateDump.after);
let gcs = deepCopy(geth.accounts);
@ -363,6 +363,12 @@ function headerRenderer(nimbus, geth) {
}
}
function headerRenderer(nimbus, geth) {
let container = $('#headerContainer').empty();
$('#headerTitle').text('Block #' + parseInt(geth.block.number, 16));
}
function generateNavigation(txs, nimbus, geth) {
function navAux(menuId, renderer) {
let menu = $(menuId).click(function(ev) {
@ -390,6 +396,10 @@ function generateNavigation(txs, nimbus, geth) {
navAux('#opCodeMenu', opCodeRenderer);
navAux('#transactionsMenu', transactionsRenderer);
$('#accountsMenu').click(function(ev) {
accountsRenderer(nimbus, geth);
});
$('#headerMenu').click(function(ev) {
headerRenderer(nimbus, geth);
});

View File

@ -46,6 +46,7 @@
<ul class="uk-subnav uk-subnav-divider" uk-switcher="connect:#switcherSection">
<li><a id="opCodeMenu" href="#">OpCode</a></li>
<li><a id="transactionsMenu" href="#">Transactions</a></li>
<li><a id="accountsMenu" href="#">Accounts</a></li>
<li><a id="headerMenu" href="#">Header</a></li>
<li class="uk-active"><a href="#">Help</a></li>
</ul>
@ -104,11 +105,23 @@
<!-- Transactions Page -->
</li>
<li>
<!-- Accounts Page -->
<div class="uk-section-small uk-section-default">
<div class="uk-container uk-container-medium">
<h3>Post State Accounts <span id="accountsTitle" class="uk-text-primary uk-text-small">Block #</span></h3>
<div id="accountsContainer">
</div>
</div>
</div>
<!-- Accounts Page -->
</li>
<li>
<!-- Header Page -->
<div class="uk-section-small uk-section-default">
<div class="uk-container uk-container-medium">
<h3>Header Post State Accounts <span id="headerTitle" class="uk-text-primary uk-text-small">Block #</span></h3>
<h3>Header Summary <span id="headerTitle" class="uk-text-primary uk-text-small">Block #</span></h3>
<div id="headerContainer">
</div>
</div>