Merge pull request #97 from cmgustavo/feature/01link-status-page

Feature/01link status page
This commit is contained in:
Manuel Aráoz 2014-01-20 19:15:12 -08:00
commit 99c04752cd
7 changed files with 84 additions and 71 deletions

View File

@ -346,8 +346,13 @@ TransactionSchema.methods.fillInfo = function(next) {
if (err) return next(err);
that.info = info;
that.info.time = that.time;
return next();
if (! that.info) {
return next();
}
else {
that.info.time = that.time;
return next();
}
});
};

View File

@ -29,7 +29,7 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
min-height: 100%;
height: auto;
/* Negative indent footer by its height */
margin: 0 auto -60px;
margin: 0 auto -44px;
/* Pad bottom by footer height */
padding: 0 0 60px;
}
@ -87,22 +87,22 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
font-weight: 100;
}
#search::-webkit-input-placeholder {
#search::-webkit-input-placeholder {
font-family: Ubuntu, sans-serif;
font-weight: 100;
font-style: italic;
font-size: 13px;
font-size: 15px;
color: #BCDF7E;
line-height: 18px;
line-height: 20px;
}
#search::-moz-placeholder {
#search::-moz-placeholder {
font-family: Ubuntu, sans-serif;
font-weight: 100;
font-size: 13px;
font-size: 15px;
color: #BCDF7E;
line-height: 18px;
line-height: 20px;
}
.status {
@ -122,8 +122,6 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
background-color: #F4F4F4;
padding: 15px;
margin-top: 21px;
width: 265px;
height: 87%;
border-radius: 5px;
}
@ -223,8 +221,10 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
/* Set the fixed height of the footer here */
#footer {
height: 60px;
background-color: #f5f5f5;
height: 44px;
background-color: #8DC429;
border-top: 4px solid #64920F;
color: #fff;
}
.line-bot {
@ -246,9 +246,14 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
#wrap > .container {
padding: 60px 15px 0;
}
/*.container .text-muted {
margin: 20px 0;
}*/
.container .text-muted {
margin: 10px 0;
}
.container .text-muted a {
color: #eee;
}
#footer > .container {
padding-left: 15px;
@ -265,7 +270,13 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
#search { width: 400px; }
.no_matching {
background-color: #FFFFFF;
border: 2px solid #64920F;
padding: 10px 20px;
position: absolute;
top: 46px;
}
/*Animations*/
.fader.ng-enter {

View File

@ -1,27 +1,32 @@
<section data-ng-controller="BlocksController" data-ng-init="list()">
<div class="page-header">
<h1>
<span class="glyphicon glyphicon-calendar"></span>
Blocks
<small>by date</small>
</h1>
<ul class="pagination">
<li><a href="#!/blocks-date/{{pagination.prev}}">&laquo; {{pagination.prev}}</a></li>
<li class="disabled"><a href="#">{{pagination.current}}</a></li>
<li><a href="#!/blocks-date/{{pagination.next}}">{{pagination.next}} &raquo;</a></li>
</ul>
</div>
<table class="table table-striped" ng-show="blocks || blocks.length">
<thead>
<th>Hash</th>
<th>Solved at</th>
</thead>
<tbody>
<tr data-ng-repeat="block in blocks">
<td><a href="#!/block/{{block.hash}}">{{block.hash}}</a></td>
<td>{{block.time * 1000 | date:'medium'}}</td>
</tr>
</tbody>
</table>
<h1 class="text-center text-muted" ng-hide="!blocks || blocks.length">No blocks yet.</h1>
<div class="row">
<div class="col-md-8 col-md-offset-2">
<ul class="pager">
<li class="previous"><a href="#!/blocks-date/{{pagination.prev}}">&larr; {{pagination.prev}}</a></li>
<li class="disabled"><a href="#">{{pagination.current}}</a></li>
<li class="next"><a href="#!/blocks-date/{{pagination.next}}">{{pagination.next}} &rarr;</a></li>
</ul>
<table class="table table-striped" data-ng-show="blocks || blocks.length">
<thead>
<tr>
<th>Hash</th>
<th>Solved at</th>
</tr>
</thead>
<tbody>
<tr data-ng-repeat="block in blocks">
<td><a href="#!/block/{{block.hash}}">{{block.hash}}</a></td>
<td>{{block.time * 1000 | date:'medium'}}</td>
</tr>
</tbody>
</table>
</div>
</div>
<h2 class="text-center text-muted" data-ng-hide="!blocks || blocks.length">No blocks yet.</h2>
</section>

View File

@ -1,10 +1,6 @@
<div data-ng-controller="FooterController" data-ng-init="getFooter()">
<div data-ng-controller="FooterController">
<div class="container">
<p class="text-muted text-right" data-ng-show="info.blocks">
Blocks: {{info.blocks}} |
Connections: {{info.connections}} |
Difficulty: {{info.difficulty}}
</p>
<p class="text-center text-muted"><a href="/">Insight</a></p>
</div>
</div>

View File

@ -20,7 +20,7 @@
<div class="form-group" ng-class="{'has-error': badQuery}">
<input id="search" type="text" class="form-control" ng-model="q" placeholder="Search for block, transaction or address">
</div>
<span class="text-danger" ng-show="badQuery">No matching records found!</span>
<div class="no_matching text-danger" ng-show="badQuery">No matching records found!</div>
</form>
<div class="status" data-ng-controller="FooterController" data-ng-init="getFooter()">
<i class="small" data-ng-show="info.blocks">
@ -36,4 +36,4 @@
</div>
</div>
</div>
</div>
</div>

View File

@ -5,8 +5,8 @@
</h1>
</div>
<div class="row">
<div class="col-lg-6">
<h3>getInfo</h3>
<div class="col-md-8 col-md-offset-2">
<h2>getInfo()</h2>
<table class="table table-striped" data-ng-init="getStatus('Info')">
<tbody>
<tr data-ng-show="!info &amp;&amp; !infoError">
@ -31,7 +31,7 @@
</tr>
<tr>
<td>blocks</td>
<td>{{info.blocks}}</td>
<td><a href="/#!/block-index/{{info.blocks}}">{{info.blocks}}</a></td>
</tr>
<tr>
<td>timeoffset</td>
@ -71,9 +71,8 @@
</tr>
</tbody>
</table>
</div>
<div class="col-lg-6">
<h3>sync status</h3>
<h2>Sync Status</h2>
<table class="table table-striped" data-ng-init="getSync()">
<tbody>
<tr data-ng-show="syncError">
@ -95,14 +94,16 @@
</tr>
<tr>
<td>start</td>
<td>{{sync.start}}
<span data-ng-show="sync.isStartGenesis"> (genesisBlock) </span>
<td>
<a href="/#!/block/{{sync.start}}">{{sync.start}}</a>
<span data-ng-show="sync.isStartGenesis"> (genesisBlock)</span>
</td>
</tr>
<tr>
<td>end</td>
<td>{{sync.end}}
<span data-ng-show="sync.isEndGenesis"> (genesisBlock) </span>
<td>
<a href="/#!/block/{{sync.end}}">{{sync.end}}</a>
<span data-ng-show="sync.isEndGenesis"> (genesisBlock)</span>
</td>
</tr>
<tr>
@ -116,14 +117,10 @@
</ul>
</td>
</tr>
</tbody>
</table>
<h3>getTxOutSetInfo</h3>
<h2>getTxOutSetInfo()</h2>
<table class="table table-striped" data-ng-init="getStatus('TxOutSetInfo')">
<tbody>
<tr data-ng-show="!txoutsetinfo &amp;&amp; !infoError">
@ -134,11 +131,11 @@
</tr>
<tr>
<td>Height</td>
<td>{{txoutsetinfo.height}}</td>
<td><a href="/#!/block-index/{{txoutsetinfo.height}}">{{txoutsetinfo.height}}</a></td>
</tr>
<tr>
<td>bestblock</td>
<td>{{txoutsetinfo.bestblock}}</td>
<td><a href="/#!/block/{{txoutsetinfo.bestblock}}">{{txoutsetinfo.bestblock}}</a></td>
</tr>
<tr>
<td>transactions</td>
@ -162,12 +159,8 @@
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<h3>getDifficulty</h3>
<h2>getDifficulty()</h2>
<table class="table table-striped" data-ng-init="getStatus('Difficulty')">
<tbody>
<tr data-ng-show="!difficulty &amp;&amp; !infoError">
@ -183,9 +176,8 @@
</tr>
</tbody>
</table>
</div>
<div class="col-lg-6">
<h3>getLastBlockHash</h3>
<h2>getLastBlockHash()</h2>
<table class="table table-striped" data-ng-init="getStatus('LastBlockHash')">
<tbody>
<tr data-ng-show="!lastblockhash &amp;&amp; !infoError">

View File

@ -1,5 +1,9 @@
<div data-ng-show="!txs || txs.lenght">Loading...</div>
<div class="alert alert-warning" data-ng-show="txs && !txs[0].txid">There are not transactions</div>
<div class="panel panel-default" data-ng-show="!txs.length">
<div class="panel-body">
Loading...
</div>
</div>
<div class="alert alert-warning" data-ng-show="txs.length && !txs[0].txid">There are not transactions</div>
<div class="block-tx fader" data-ng-show="txs && txs[0].txid" data-ng-repeat="tx in txs">
<div data-ng-include src="'/views/transaction/tx.html'"></div>
</div>