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

View File

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

View File

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

View File

@ -20,7 +20,7 @@
<div class="form-group" ng-class="{'has-error': badQuery}"> <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"> <input id="search" type="text" class="form-control" ng-model="q" placeholder="Search for block, transaction or address">
</div> </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> </form>
<div class="status" data-ng-controller="FooterController" data-ng-init="getFooter()"> <div class="status" data-ng-controller="FooterController" data-ng-init="getFooter()">
<i class="small" data-ng-show="info.blocks"> <i class="small" data-ng-show="info.blocks">

View File

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