Merge pull request #670 from bitpay/v0.3.0

v0.3.0
This commit is contained in:
Stephen Pair 2015-10-16 20:51:18 -04:00
commit 7c5a79c80a
30 changed files with 291 additions and 247 deletions

104
README.md
View File

@ -1,59 +1,23 @@
# *insight*
# Insight UI
*insight* is an open-source bitcoin blockchain explorer with complete REST
and websocket APIs. Insight runs in NodeJS, uses AngularJS for the
front-end and LevelDB for storage.
A Bitcoin blockchain explorer web application service for [Bitcore Node](https://github.com/bitpay/bitcore-node) using the [Insight API](https://github.com/bitpay/insight-api).
Check some screenshots and more details at [insight's project homepage](http://insight.is/).
## Getting Started
*Insight* project is now split into two repositories. One for the [API](https://github.com/bitpay/insight-api) and for the front-end. This repository is for the front-end, which will install the API as a NPM dependency.
## Prerequisites
* **Node.js v0.10.x** - Download and Install [Node.js](http://www.nodejs.org/download/).
* **NPM** - Node.js package manager, should be automatically installed when you get node.js.
## Quick Install
Check the Prerequisites section above before installing.
To install Insight, clone the main repository:
$ git clone https://github.com/bitpay/insight.git && cd insight
Install dependencies:
$ npm install
Run the main application:
$ npm start
Then open a browser and go to:
http://localhost:3001
If *insight* reports problems connecting to **bitcoind** please check the CONFIGURATION section of
[insight-api README](https://github.com/bitpay/insight-api/blob/master/README.md). To set the
environment variables run something like:
$ INSIGHT_NETWORK=livenet BITCOIND_USER=user BITCOIND_PASS=pass INSIGHT_PUBLIC_PATH=public npm start
Please note that the app will need to sync its internal database
with the blockchain state, which may take some time. You can check
sync progress from within the web interface. More details about that process
on [insight-api README](https://github.com/bitpay/insight-api/blob/master/README.md).
## Nginx Setup
To use Nginx as a reverse proxy for Insight, use the following base [configuration](https://gist.github.com/matiu/bdd5e55ff0ad90b54261)
```bash
npm install -g bitcore-node
bitcore-node create mynode
cd mynode
bitcore-node add insight-api
bitcore-node add insight-ui
bitcore-node start
```
Open a web browser to `http://localhost:3001/insight/`
## Development
To run insight locally for development mode:
To run Insight UI locally in development mode:
Install bower dependencies:
@ -67,44 +31,15 @@ To compile and minify the web application's assets:
$ grunt compile
```
There is a convinent Gruntfile.js for automation during editing the code
There is a convenient Gruntfile.js for automation during editing the code
```
$ grunt
```
In case you are developing *insight* and *insight-api* toghether, you can do the following:
* Install insight and insight-api on the same path ($IROOT)
```
$ cd $IROOT/insight
$ grunt
```
in other terminal:
```
$ cd $IROOT/insight-api
$ ln -s ../insight/public
$ INSIGHT_PUBLIC_PATH=public node insight.js
```
```
INSIGHT_PUBLIC_PATH=insight/public grunt
```
at insight-api's home path (edit the path according your setup).
**also** in the insight-api path. (So you will have two grunt processes running, one for insight and one for insight-api).
## Multilanguage support
insight use [angular-gettext](http://angular-gettext.rocketeer.be) for
multilanguage support.
Insight UI uses [angular-gettext](http://angular-gettext.rocketeer.be) for multilanguage support.
To enable a text to be translated, add the ***translate*** directive to html tags. See more details [here](http://angular-gettext.rocketeer.be/dev-guide/annotate/). Then, run:
@ -112,12 +47,11 @@ To enable a text to be translated, add the ***translate*** directive to html tag
grunt compile
```
This action will create a template.pot file in ***po/*** folder. You can open
it with some PO editor ([Poedit](http://poedit.net)). Read this [guide](http://angular-gettext.rocketeer.be/dev-guide/translate/) to learn how to edit/update/import PO files from a generated POT file. PO file will be generated inside po/ folder.
This action will create a template.pot file in ***po/*** folder. You can open it with some PO editor ([Poedit](http://poedit.net)). Read this [guide](http://angular-gettext.rocketeer.be/dev-guide/translate/) to learn how to edit/update/import PO files from a generated POT file. PO file will be generated inside po/ folder.
If you make new changes, simply run **grunt compile** again to generate a new .pot template and the angular javascript ***js/translations.js***. Then (if use Poedit), open .po file and choose ***update from POT File*** from **Catalog** menu.
Finally changes your default language from ***public/src/js/config***
Finally changes your default language from ***public/src/js/config***
```
gettextCatalog.currentLanguage = 'es';
@ -130,11 +64,11 @@ compile***.
## Note
For more details about the *insight API* configs and end-point, just go to [insight API github repository](https://github.com/bitpay/insight-api) or read the [documentation](https://github.com/bitpay/insight-api/blob/master/README.md)
For more details about the [Insight API](https://github.com/bitpay/insight-api) configuration and end-points, go to [Insight API GitHub repository](https://github.com/bitpay/insight-api).
## Contribute
Contributions and suggestions are welcomed at [insight github repository](https://github.com/bitpay/insight).
Contributions and suggestions are welcomed at the [Insight UI GitHub repository](https://github.com/bitpay/insight).
## License

60
bitcore-node/index.js Normal file
View File

@ -0,0 +1,60 @@
'use strict';
var BaseService = require('./service');
var inherits = require('util').inherits;
var fs = require('fs');
var InsightUI = function(options) {
BaseService.call(this, options);
if (typeof options.apiPrefix !== 'undefined') {
this.apiPrefix = options.apiPrefix;
} else {
this.apiPrefix = 'insight-api';
}
if (typeof options.routePrefix !== 'undefined') {
this.routePrefix = options.routePrefix;
} else {
this.routePrefix = 'insight';
}
};
InsightUI.dependencies = ['insight-api'];
inherits(InsightUI, BaseService);
InsightUI.prototype.start = function(callback) {
this.indexFile = this.filterIndexHTML(fs.readFileSync(__dirname + '/../public/index.html', {encoding: 'utf8'}));
setImmediate(callback);
};
InsightUI.prototype.getRoutePrefix = function() {
return this.routePrefix;
};
InsightUI.prototype.setupRoutes = function(app, express) {
var self = this;
app.use('/', function(req, res, next){
if (req.headers.accept && req.headers.accept.indexOf('text/html') !== -1 &&
req.headers["X-Requested-With"] !== 'XMLHttpRequest'
) {
res.setHeader('Content-Type', 'text/html');
res.send(self.indexFile);
} else {
express.static(__dirname + '/../public')(req, res, next);
}
});
};
InsightUI.prototype.filterIndexHTML = function(data) {
var transformed = data
.replace(/apiPrefix = '\/api'/, "apiPrefix = '/" + this.apiPrefix + "'");
if (this.routePrefix) {
transformed = transformed.replace(/<base href=\"\/\"/, '<base href="/' + this.routePrefix + '/"');
}
return transformed;
};
module.exports = InsightUI;

91
bitcore-node/service.js Normal file
View File

@ -0,0 +1,91 @@
'use strict';
var util = require('util');
var EventEmitter = require('events').EventEmitter;
var Service = function(options) {
EventEmitter.call(this);
this.node = options.node;
this.name = options.name;
};
util.inherits(Service, EventEmitter);
/**
* Describes the dependencies that should be loaded before this service.
*/
Service.dependencies = [];
/**
* blockHandler
* @param {Block} block - the block being added or removed from the chain
* @param {Boolean} add - whether the block is being added or removed
* @param {Function} callback - call with the leveldb database operations to perform
*/
Service.prototype.blockHandler = function(block, add, callback) {
// implement in the child class
setImmediate(function() {
callback(null, []);
});
};
/**
* the bus events available for subscription
* @return {Array} an array of event info
*/
Service.prototype.getPublishEvents = function() {
// Example:
// return [
// ['eventname', this, this.subscribeEvent, this.unsubscribeEvent],
// ];
return [];
};
/**
* the API methods to expose
* @return {Array} return array of methods
*/
Service.prototype.getAPIMethods = function() {
// Example:
// return [
// ['getData', this, this.getData, 1]
// ];
return [];
};
// Example:
// Service.prototype.getData = function(arg1, callback) {
//
// };
/**
* Function which is called when module is first initialized
*/
Service.prototype.start = function(done) {
setImmediate(done);
};
/**
* Function to be called when bitcore-node is stopped
*/
Service.prototype.stop = function(done) {
setImmediate(done);
};
/**
* Setup express routes
* @param {Express} app
*/
Service.prototype.setupRoutes = function(app) {
// Setup express routes here
};
Service.prototype.getRoutePrefix = function() {
return this.name;
};
module.exports = Service;

View File

@ -1,7 +1,7 @@
{
"name": "insight-bitcore",
"name": "insight-ui",
"description": "An open-source frontend for the Insight API. The Insight API provides you with a convenient, powerful and simple way to query and broadcast data on the bitcoin network and build your own services with it.",
"version": "0.2.7",
"version": "0.3.0",
"repository": "git://github.com/bitpay/insight.git",
"contributors": [
{
@ -38,11 +38,8 @@
"bitcore",
"front-end"
],
"scripts": {
"start": "INSIGHT_PUBLIC_PATH=public node node_modules/.bin/insight-bitcore-api"
},
"bitcoreNode": "bitcore-node",
"dependencies": {
"insight-bitcore-api": ">=0.2.14"
},
"devDependencies": {
"bower": "~1.2.8",

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
<!doctype html>
<html lang="en" data-ng-app="insight" data-ng-csp>
<head>
<base href="/" />
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
@ -8,9 +9,9 @@
<title data-ng-bind="$root.title + $root.titleDetail + ' | Insight'">Insight</title>
<meta name="keywords" content="bitcoins, transactions, blocks, address, block chain, best block, mining difficulty, hash serialized">
<meta name="description" content="Bitcoin Insight. View detailed information on all bitcoin transactions and block. {{ $root.title + $root.titleDetail }}">
<link rel="shortcut icon" href="/img/icons/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="img/icons/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,400italic">
<link rel="stylesheet" href="/css/main.min.css">
<link rel="stylesheet" href="css/main.min.css">
</head>
<body ng-cloak class="ng-cloak">
<div>
@ -39,7 +40,7 @@
</script>
</div>
<div id="wrap">
<div class="navbar navbar-default navbar-fixed-top" data-ng-include="'/views/includes/header.html'" role='navigation'></div>
<div class="navbar navbar-default navbar-fixed-top" data-ng-include="'views/includes/header.html'" role='navigation'></div>
<section class="container" data-ng-view></section>
</div>
<div id="footer" role="navigation">
@ -57,17 +58,18 @@
</span>
&nbsp;
[
<a href="/messages/verify" translate>verify message</a>
<a href="messages/verify" translate>verify message</a>
<span> &middot; </span>
<a href="/tx/send" translate>broadcast transaction</a>
<a href="tx/send" translate>broadcast transaction</a>
]
</div>
<a class="insight m10v pull-right" target="_blank" href="http://insight.is">insight <small>API v{{version}}</small></a>
</div>
</div>
<script language="javascript">window.apiPrefix = '/api';</script>
<script src="/socket.io/socket.io.js"></script>
<script src="/js/vendors.min.js"></script>
<script src="/js/angularjs-all.min.js"></script>
<script src="/js/main.min.js"></script>
<script src="js/vendors.min.js"></script>
<script src="js/angularjs-all.min.js"></script>
<script src="js/main.min.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -184,7 +184,7 @@ margin-left: 0;
#search-form { color: #fff; }
#search.loading {
background-image: url('/img/loading.gif');
background-image: url('../img/loading.gif');
background-position: 5px center;
background-repeat: no-repeat;
padding-left: 25px;
@ -548,7 +548,7 @@ margin-left: 0;
}
.btn-copy {
background: transparent url('/img/icons/copy.png') center center no-repeat;
background: transparent url('../img/icons/copy.png') center center no-repeat;
}
.btn-copy .tooltip {
@ -614,22 +614,22 @@ margin-left: 0;
height: 45px;
}
#powered a.bitcore {
background-image: url('/img/logo.svg');
background-image: url('../img/logo.svg');
background-size: 80px;
width: 30%;
}
#powered a.nodejs {
background-image: url('/img/nodejs.png');
background-image: url('../img/nodejs.png');
background-size: 80px;
width: 30%;
}
#powered a.angularjs {
background-image: url('/img/angularjs.png');
background-image: url('../img/angularjs.png');
background-size: 50px;
width: 20%;
}
#powered a.leveldb {
background-image: url('/img/leveldb.png');
background-image: url('../img/leveldb.png');
background-size: 50px;
width: 20%;
}

View File

@ -4,47 +4,47 @@
angular.module('insight').config(function($routeProvider) {
$routeProvider.
when('/block/:blockHash', {
templateUrl: '/views/block.html',
templateUrl: 'views/block.html',
title: 'Bitcoin Block '
}).
when('/block-index/:blockHeight', {
controller: 'BlocksController',
templateUrl: '/views/redirect.html'
templateUrl: 'views/redirect.html'
}).
when('/tx/send', {
templateUrl: '/views/transaction_sendraw.html',
templateUrl: 'views/transaction_sendraw.html',
title: 'Broadcast Raw Transaction'
}).
when('/tx/:txId/:v_type?/:v_index?', {
templateUrl: '/views/transaction.html',
templateUrl: 'views/transaction.html',
title: 'Bitcoin Transaction '
}).
when('/', {
templateUrl: '/views/index.html',
templateUrl: 'views/index.html',
title: 'Home'
}).
when('/blocks', {
templateUrl: '/views/block_list.html',
templateUrl: 'views/block_list.html',
title: 'Bitcoin Blocks solved Today'
}).
when('/blocks-date/:blockDate/:startTimestamp?', {
templateUrl: '/views/block_list.html',
templateUrl: 'views/block_list.html',
title: 'Bitcoin Blocks solved '
}).
when('/address/:addrStr', {
templateUrl: '/views/address.html',
templateUrl: 'views/address.html',
title: 'Bitcoin Address '
}).
when('/status', {
templateUrl: '/views/status.html',
templateUrl: 'views/status.html',
title: 'Status'
}).
when('/messages/verify', {
templateUrl: '/views/messages_verify.html',
templateUrl: 'views/messages_verify.html',
title: 'Verify Message'
})
.otherwise({
templateUrl: '/views/404.html',
templateUrl: 'views/404.html',
title: 'Error'
});
});

View File

@ -22,7 +22,7 @@ angular.module('insight.messages').controller('VerifyMessageController',
$scope.verify = function() {
$scope.verification.status = 'loading';
$scope.verification.address = $scope.message.address;
$http.post('/api/messages/verify', $scope.message)
$http.post(window.apiPrefix + '/messages/verify', $scope.message)
.success(function(data, status, headers, config) {
if(typeof(data.result) != 'boolean') {
// API returned 200 but result was not true or false

View File

@ -189,7 +189,7 @@ angular.module('insight.transactions').controller('SendRawTransactionController'
rawtx: $scope.transaction
};
$scope.status = 'loading';
$http.post('/api/tx/send', postData)
$http.post(window.apiPrefix + '/tx/send', postData)
.success(function(data, status, headers, config) {
if(typeof(data.txid) != 'string') {
// API returned 200 but the format is not known

View File

@ -2,7 +2,7 @@
angular.module('insight.address').factory('Address',
function($resource) {
return $resource('/api/addr/:addrStr/?noTxList=1', {
return $resource(window.apiPrefix + '/addr/:addrStr/?noTxList=1', {
addrStr: '@addStr'
}, {
get: {
@ -21,3 +21,4 @@ angular.module('insight.address').factory('Address',
});
});

View File

@ -3,7 +3,7 @@
angular.module('insight.blocks')
.factory('Block',
function($resource) {
return $resource('/api/block/:blockHash', {
return $resource(window.apiPrefix + '/block/:blockHash', {
blockHash: '@blockHash'
}, {
get: {
@ -23,9 +23,9 @@ angular.module('insight.blocks')
})
.factory('Blocks',
function($resource) {
return $resource('/api/blocks');
return $resource(window.apiPrefix + '/blocks');
})
.factory('BlockByHeight',
function($resource) {
return $resource('/api/block-index/:blockHeight');
return $resource(window.apiPrefix + '/block-index/:blockHeight');
});

View File

@ -2,5 +2,5 @@
angular.module('insight.currency').factory('Currency',
function($resource) {
return $resource('/api/currency');
return $resource(window.apiPrefix + '/currency');
});

View File

@ -8,5 +8,5 @@ angular.module('insight.system')
])
.factory('Version',
function($resource) {
return $resource('/api/version');
return $resource(window.apiPrefix + '/version');
});

View File

@ -3,15 +3,15 @@
angular.module('insight.status')
.factory('Status',
function($resource) {
return $resource('/api/status', {
return $resource(window.apiPrefix + '/status', {
q: '@q'
});
})
.factory('Sync',
function($resource) {
return $resource('/api/sync');
return $resource(window.apiPrefix + '/sync');
})
.factory('PeerSync',
function($resource) {
return $resource('/api/peer');
return $resource(window.apiPrefix + '/peer');
});

View File

@ -3,7 +3,7 @@
angular.module('insight.transactions')
.factory('Transaction',
function($resource) {
return $resource('/api/tx/:txId', {
return $resource(window.apiPrefix + '/tx/:txId', {
txId: '@txId'
}, {
get: {
@ -23,17 +23,17 @@ angular.module('insight.transactions')
})
.factory('TransactionsByBlock',
function($resource) {
return $resource('/api/txs', {
return $resource(window.apiPrefix + '/txs', {
block: '@block'
});
})
.factory('TransactionsByAddress',
function($resource) {
return $resource('/api/txs', {
return $resource(window.apiPrefix + '/txs', {
address: '@address'
});
})
.factory('Transactions',
function($resource) {
return $resource('/api/txs');
return $resource(window.apiPrefix + '/txs');
});

View File

@ -1,4 +1,4 @@
<div data-ng-include src="'/views/includes/connection.html'"></div>
<div data-ng-include src="'views/includes/connection.html'"></div>
<div class="jumbotron">
<h1>Ooops!</h1>
<h2 translate class="text-muted">404 Page not found :(</h2>

View File

@ -1,4 +1,4 @@
<div data-ng-include src="'/views/includes/connection.html'"></div>
<div data-ng-include src="'views/includes/connection.html'"></div>
<section data-ng-controller="AddressController" data-ng-init="findOne()">
<div class="secondary_navbar hidden-xs hidden-sm" scroll data-ng-class="{'hidden': !secondaryNavbar}" data-ng-show="address.addrStr" data-ng-init="hideSNavbar=0">
<div class="container" data-ng-if="!hideSNavbar">
@ -74,7 +74,7 @@
</div>
<div data-ng-if="address.addrStr" data-ng-controller="transactionsController" data-ng-init="load('address')">
<h2 translate>Transactions</h2>
<div data-ng-include src="'/views/transaction/list.html'" when-scrolled="loadMore()"></div>
<div data-ng-include src="'views/transaction/list.html'" when-scrolled="loadMore()"></div>
</div>
</section>

View File

@ -1,10 +1,10 @@
<div data-ng-include src="'/views/includes/connection.html'"></div>
<div data-ng-include src="'views/includes/connection.html'"></div>
<section data-ng-controller="BlocksController" data-ng-init="findOne()">
<div class="secondary_navbar hidden-xs hidden-sm" scroll data-ng-class="{'hidden': !secondaryNavbar}" data-ng-show="block.hash" data-ng-init="hideSNavbar=0">
<div class="container" data-ng-if="!hideSNavbar">
<div class="row">
<div class="col-md-1">
<a href="/block/{{block.previousblockhash}}"><span class="lead glyphicon glyphicon-chevron-left"></span></a>
<a href="block/{{block.previousblockhash}}"><span class="lead glyphicon glyphicon-chevron-left"></span></a>
</div>
<div class="col-md-10">
<div class="row">
@ -20,7 +20,7 @@
</div>
</div>
<div class="col-md-1">
<a data-ng-show="block.nextblockhash" href="/block/{{block.nextblockhash}}"><span class="lead glyphicon glyphicon-chevron-right"></span></a>
<a data-ng-show="block.nextblockhash" href="block/{{block.nextblockhash}}"><span class="lead glyphicon glyphicon-chevron-right"></span></a>
</div>
</div>
</div> <!-- END OF CONTAINER -->
@ -82,7 +82,7 @@
</tr>
<tr data-ng-show="block.previousblockhash">
<td><strong translate>Previous Block</strong></td>
<td class="text-right"><a href="/block/{{block.previousblockhash}}">{{block.height-1}}</a></td>
<td class="text-right"><a href="block/{{block.previousblockhash}}">{{block.height-1}}</a></td>
</tr>
</tbody>
</table>
@ -112,7 +112,7 @@
</tr>
<tr data-ng-show="block.nextblockhash">
<td><strong translate>Next Block</strong></td>
<td class="text-right"><a href="/block/{{block.nextblockhash}}">{{block.height+1}}</a></td>
<td class="text-right"><a href="block/{{block.nextblockhash}}">{{block.height+1}}</a></td>
</tr>
</tbody>
</table>
@ -121,7 +121,7 @@
</div>
<div data-ng-if="block.hash" data-ng-controller="transactionsController" data-ng-init="load('block')">
<h3 translate>Transactions</h3>
<div data-ng-include src="'/views/transaction/list.html'" when-scrolled="loadMore()"></div>
<div data-ng-include src="'views/transaction/list.html'" when-scrolled="loadMore()"></div>
</div>
</section>

View File

@ -1,4 +1,4 @@
<div data-ng-include src="'/views/includes/connection.html'"></div>
<div data-ng-include src="'views/includes/connection.html'"></div>
<section data-ng-controller="BlocksController" data-ng-init="list()">
<div class="row">
<div class="col-xs-12 col-gray col-gray-fixed">
@ -22,8 +22,8 @@
<p class="text-center m20v" data-ng-show="!pagination.isToday && !loading">{{humanSince(pagination.currentTs)}}
<p class="text-center m20v" data-ng-show="loading">&nbsp;</p>
<div class="m50v text-center">
<a class="btn btn-primary" href="/blocks-date/{{pagination.prev}}"><small>&larr; {{pagination.prev}}</small></a>
<a class="btn btn-primary" href="/blocks-date/{{pagination.next}}" data-ng-show="!pagination.isToday"><small>{{pagination.next}} &rarr;</small></a>
<a class="btn btn-primary" href="blocks-date/{{pagination.prev}}"><small>&larr; {{pagination.prev}}</small></a>
<a class="btn btn-primary" href="blocks-date/{{pagination.next}}" data-ng-show="!pagination.isToday"><small>{{pagination.next}} &rarr;</small></a>
</div>
</div>
</div>
@ -49,7 +49,7 @@
<td colspan="5"><span translate>Waiting for blocks...</span> <span class="loader-gif"></span></td>
</tr>
<tr class="fader" data-ng-repeat='b in blocks'>
<td><a href="/block/{{b.hash}}">{{b.height}}</a></td>
<td><a href="block/{{b.hash}}">{{b.height}}</a></td>
<td>{{b.time * 1000 | date:'medium'}}</td>
<td class="text-right">{{b.txlength}}</td>
<td class="text-right hidden-xs"><a href="{{b.poolInfo.url}}" title="{{b.poolInfo.poolName}}" target="_blank" data-ng-show="b.poolInfo">{{b.poolInfo.poolName}}</a></td>
@ -58,8 +58,8 @@
</tbody>
</table>
<div data-ng-if="pagination.more">
<a class="btn btn-primary" href="/blocks-date/{{pagination.current}}" data-ng-show="{{before}}">Lastest block from date</a>
<a class="btn btn-primary" href="/blocks-date/{{pagination.current}}/{{pagination.moreTs}}">Older blocks from this date</a>
<a class="btn btn-primary" href="blocks-date/{{pagination.current}}" data-ng-show="{{before}}">Lastest block from date</a>
<a class="btn btn-primary" href="blocks-date/{{pagination.current}}/{{pagination.moreTs}}">Older blocks from this date</a>
</div>
</div>
</div>

View File

@ -3,16 +3,16 @@
</a>
<ul class="dropdown-menu">
<li>
<a href="#" data-ng-click="setCurrency('USD')" data-ng-class="{active: currency.symbol == 'USD'}">USD</a>
<a data-ng-click="setCurrency('USD')" data-ng-class="{active: currency.symbol == 'USD'}">USD</a>
</li>
<li>
<a href="#" data-ng-click="setCurrency('BTC')" data-ng-class="{active: currency.symbol == 'BTC'}">BTC</a>
<a data-ng-click="setCurrency('BTC')" data-ng-class="{active: currency.symbol == 'BTC'}">BTC</a>
</li>
<li>
<a href="#" data-ng-click="setCurrency('mBTC')" data-ng-class="{active: currency.symbol == 'mBTC'}">mBTC</a>
<a data-ng-click="setCurrency('mBTC')" data-ng-class="{active: currency.symbol == 'mBTC'}">mBTC</a>
</li>
<li>
<a href="#" data-ng-click="setCurrency('bits')" data-ng-class="{active: currency.symbol == 'bits'}">bits</a>
<a data-ng-click="setCurrency('bits')" data-ng-class="{active: currency.symbol == 'bits'}">bits</a>
</li>
</ul>

View File

@ -7,15 +7,15 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="insight navbar-brand" href="/">insight</a>
<a class="insight navbar-brand" href=".">insight</a>
</div>
<div class="navbar-collapse collapse" collapse="$root.isCollapsed">
<ul class="nav navbar-nav">
<li data-ng-repeat="item in menu" ui-route="/{{item.link}}" data-ng-class="{active: $uiRoute}">
<a href="/{{item.link}}">{{item.title|translate}}</a>
<li data-ng-repeat="item in menu" ui-route="{{item.link}}" data-ng-class="{active: $uiRoute}">
<a href="{{item.link}}">{{item.title|translate}}</a>
</li>
</ul>
<span class="hidden-xs navbar-form navbar-left" data-ng-include src="'/views/includes/search.html'"></span>
<span class="hidden-xs navbar-form navbar-left" data-ng-include src="'views/includes/search.html'"></span>
<ul class="nav navbar-nav navbar-right">
<li>
<div class="status" data-ng-controller="StatusController">
@ -38,10 +38,10 @@
</div>
</li>
<li>
<a href="#" data-ng-click="openScannerModal()"><span class="glyphicon
<a data-ng-click="openScannerModal()"><span class="glyphicon
glyphicon-qrcode"></span> Scan</a>
</li>
<li class="dropdown" data-ng-controller="CurrencyController" data-ng-include="'/views/includes/currency.html'"></li>
<li class="dropdown" data-ng-controller="CurrencyController" data-ng-include="'views/includes/currency.html'"></li>
</ul>
</div>
</div>

View File

@ -1,13 +1,13 @@
<div class="alert alert-danger" data-ng-show="flashMessage">
{{$root.flashMessage}}
</div>
<div data-ng-include src="'/views/includes/connection.html'"></div>
<div data-ng-include src="'views/includes/connection.html'"></div>
<section data-ng-controller="IndexController" data-ng-init="index()">
<div class="container">
<div id="home" class="row">
<div class="col-xs-12 col-md-8">
<div id="search-form-mobile" class="visible-xs" data-ng-include src="'/views/includes/search.html'"></div>
<div id="search-form-mobile" class="visible-xs" data-ng-include src="'views/includes/search.html'"></div>
<h1 translate>Latest Blocks</h1>
<table class="table table-hover table-striped" style="table-layout: fixed">
@ -24,7 +24,7 @@
<tr data-ng-show="!blocks.length"><td colspan="4" translate>Waiting for blocks...</td></tr>
<tr class="fader" data-ng-repeat='b in blocks'>
<td>
<a href="/block/{{b.hash}}">{{b.height}}</a>
<a href="block/{{b.hash}}">{{b.height}}</a>
</td>
<td><span class="ellipsis">{{humanSince(b.time)}}</span></td>
<td class="text-right">{{b.txlength}}</td>
@ -34,7 +34,7 @@
</tbody>
</table>
<div class="btn-more">
<a href="/blocks" class="btn btn-default" translate>See all blocks</a>
<a href="blocks" class="btn btn-default" translate>See all blocks</a>
</div>
<h2 translate>Latest Transactions</h2>
@ -50,7 +50,7 @@
<tr data-ng-show="!txs.length"><td colspan="3" translate>Waiting for transactions...</td></tr>
<tr class="fader" data-ng-repeat='tx in txs'>
<td>
<a class="ellipsis" href="/tx/{{tx.txid}}">{{tx.txid}}</a>
<a class="ellipsis" href="tx/{{tx.txid}}">{{tx.txid}}</a>
</td>
<td class="text-right"><span class="ellipsis">{{$root.currency.getConvertion(tx.valueOut) || tx.valueOut + ' BTC'}}</span></td>
</tr>

View File

@ -1,4 +1,4 @@
<div data-ng-include src="'/views/includes/connection.html'"></div>
<div data-ng-include src="'views/includes/connection.html'"></div>
<section>
<div class="page-header">
<h1 translate>Application Status</h1>
@ -60,66 +60,25 @@
<h2 translate>Last Block</h2>
<table class="table" style="table-layout: fixed" data-ng-controller="StatusController" data-ng-init="getStatus('LastBlockHash')">
<thead data-ng-include src="'/views/includes/infoStatus.html'"></thead>
<thead data-ng-include src="'views/includes/infoStatus.html'"></thead>
<tbody>
<tr>
<td translate>Last Block Hash (Bitcoind)</td>
<td class="text-right ellipsis"><a href="/block/{{lastblockhash}}">{{lastblockhash}}</a></td>
<td class="text-right ellipsis"><a href="block/{{lastblockhash}}">{{lastblockhash}}</a></td>
</tr>
<tr>
<td translate>Current Blockchain Tip (insight)</td>
<td class="text-right ellipsis"><a href="/block/{{syncTipHash}}">{{syncTipHash}}</a></td>
<td class="text-right ellipsis"><a href="block/{{syncTipHash}}">{{syncTipHash}}</a></td>
</tr>
</tbody>
</table>
<h2 translate>Transaction Output Set Information</h2>
<div data-ng-controller="StatusController">
<button data-ng-click="txoutLoading=1;getStatus('TxOutSetInfo')" class="btn btn-default" data-ng-show="!txoutsetinfo.height">
<span translate>Show Transaction Output data</span>
<span data-ng-show="txoutLoading" class="glyphicon glyphicon-refresh icon-rotate"></span>
</button >
<table class="table" data-ng-show="txoutsetinfo.height" style="table-layout: fixed" >
<thead data-ng-include src="'/views/includes/infoStatus.html'"></thead>
<tbody>
<tr>
<td translate>Height</td>
<td class="text-right"><a href="/block-index/{{txoutsetinfo.height}}">{{txoutsetinfo.height}}</a></td>
</tr>
<tr>
<td translate>Best Block</td>
<td class="text-right ellipsis"><a href="/block/{{txoutsetinfo.bestblock}}">{{txoutsetinfo.bestblock}}</a></td>
</tr>
<tr>
<td translate>Transactions</td>
<td class="text-right"> {{txoutsetinfo.transactions}}</td>
</tr>
<tr>
<td translate>Transaction Outputs</td>
<td class="text-right">{{txoutsetinfo.txouts}}</td>
</tr>
<tr>
<td translate>Bytes Serialized</td>
<td class="text-right">{{txoutsetinfo.bytes_serialized}}</td>
</tr>
<tr>
<td translate>Hash Serialized</td>
<td class="text-right ellipsis">{{txoutsetinfo.hash_serialized}}</td>
</tr>
<tr>
<td translate>Total Amount</td>
<td class="text-right">{{txoutsetinfo.total_amount}}</td>
</tr>
</tbody>
</table>
</div>
</div> <!-- END OF COL-8 -->
<div class="col-xs-12 col-md-4 col-gray">
<h2 translate>Bitcoin node information</h2>
<table class="table" data-ng-controller="StatusController" data-ng-init="getStatus('Info')">
<thead data-ng-include src="'/views/includes/infoStatus.html'"></thead>
<thead data-ng-include src="'views/includes/infoStatus.html'"></thead>
<tbody>
<tr>
<td translate>Version</td>
@ -131,7 +90,7 @@
</tr>
<tr>
<td translate>Blocks</td>
<td class="text-right"><a href="/block-index/{{info.blocks}}">{{info.blocks}}</a></td>
<td class="text-right"><a href="block-index/{{info.blocks}}">{{info.blocks}}</a></td>
</tr>
<tr>
<td translate>Time Offset</td>

View File

@ -1,4 +1,4 @@
<div data-ng-include src="'/views/includes/connection.html'"></div>
<div data-ng-include src="'views/includes/connection.html'"></div>
<section data-ng-controller="transactionsController" data-ng-init="findThis()">
<div class="secondary_navbar hidden-xs hidden-sm" scroll data-ng-class="{'hidden': !secondaryNavbar}" data-ng-show="tx.txid" data-ng-init="hideSNavbar=0">
<div class="container" data-ng-if="!hideSNavbar">
@ -63,14 +63,14 @@
</tr>
<tr>
<td><strong translate>Mined Time</strong></td>
<td data-ng-show="tx.time" class="text-muted text-right">{{tx.blocktime * 1000|date:'medium'}}</td>
<td data-ng-show="!tx.time" class="text-muted text-right">N/A</td>
<td data-ng-show="tx.blocktime" class="text-muted text-right">{{tx.blocktime * 1000|date:'medium'}}</td>
<td data-ng-show="!tx.blocktime" class="text-muted text-right">N/A</td>
</tr>
<tr>
<td><strong translate>Included in Block</strong></td>
<td data-ng-show="tx.blockhash" class="text-muted text-right">
<div class="ellipsis">
<a href="/block/{{tx.blockhash}}">{{tx.blockhash}}</a>
<a href="block/{{tx.blockhash}}">{{tx.blockhash}}</a>
</div>
<td data-ng-show="!tx.blockhash" class="text-muted text-right">Unconfirmed</td>
</tr>
@ -92,7 +92,7 @@
</div>
<h2 translate>Details</h2>
<div class="block-tx" data-ng-if="tx.txid">
<div data-ng-include src="'/views/transaction/tx.html'"></div>
<div data-ng-include src="'views/transaction/tx.html'"></div>
</div>
</div>
</section>

View File

@ -2,7 +2,7 @@
data-ng-show="!txs[0].txid && !loading"
translate>There are no transactions involving this address.</div>
<div class="block-tx" 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 class="progress progress-striped active" data-ng-show="loading">
<div class="progress-bar progress-bar-info" style="width: 100%">

View File

@ -1,10 +1,10 @@
<div class="line-bot row" data-ng-hide="!tx">
<div class="col-xs-7 col-md-8">
<div class="ellipsis">
<a class="btn-expand" href="#" title="Show/Hide items details" data-ng-click="itemsExpanded = !itemsExpanded">
<a class="btn-expand" title="Show/Hide items details" data-ng-click="itemsExpanded = !itemsExpanded">
<span class="glyphicon glyphicon-plus-sign" data-ng-class="{'glyphicon-minus-sign': itemsExpanded}"></span>
</a>
<a href="/tx/{{tx.txid}}">{{tx.txid}}</a>
<a href="tx/{{tx.txid}}">{{tx.txid}}</a>
<span class="btn-copy" clip-copy="tx.txid"></span>
</div>
</div>
@ -13,7 +13,7 @@
<span translate>first seen at</span>
<time>{{tx.firstSeenTs * 1000 | date:'medium'}}</time>
</div>
<div data-ng-show="tx.time && !tx.firstSeenTs">
<div data-ng-show="tx.blocktime && !tx.firstSeenTs">
<span translate>mined</span>
<time>{{tx.time * 1000 | date:'medium'}}</time>
</div>
@ -40,7 +40,7 @@
<div class="ellipsis">
<span data-ng-show="vin.notAddr">{{vin.addr}}</span>
<span class="text-muted" title="Current Bitcoin Address" data-ng-show="vin.addr == $root.currentAddr">{{vin.addr}}</span>
<a href="/address/{{vin.addr}}" data-ng-show="!vin.notAddr && vin.addr != $root.currentAddr">{{vin.addr}}</a>
<a href="address/{{vin.addr}}" data-ng-show="!vin.notAddr && vin.addr != $root.currentAddr">{{vin.addr}}</a>
</div>
<div data-ng-show="vin.unconfirmedInput" class="text-danger"> <span class="glyphicon glyphicon-warning-sign"></span> (Input unconfirmed)</div>
<div data-ng-show="vin.dbError" class="text-danger">
@ -50,7 +50,7 @@
<div data-ng-show="vin.doubleSpentTxID" class="text-danger">
<span class="glyphicon glyphicon-warning-sign"></span>
<span translate>Double spent attempt detected. From tx:</span>
<a href="/tx/{{vin.doubleSpentTxID}}">{{vin.doubleSpentTxID}},{{vin.doubleSpentIndex}}</a>
<a href="tx/{{vin.doubleSpentTxID}}">{{vin.doubleSpentTxID}},{{vin.doubleSpentIndex}}</a>
</div>
</div>
</div>
@ -71,9 +71,9 @@
{{$root.currency.getConvertion(vin.value) || vin.value + ' BTC'}}
</div>
<div class="ellipsis">
<a class="glyphicon glyphicon-chevron-right" href="/tx/{{vin.txid}}/>/{{vin.vout}}" title="Outpoint: {{vin.txid}},{{vin.vout}}"></a>
<a class="glyphicon glyphicon-chevron-right" href="tx/{{vin.txid}}/>/{{vin.vout}}" title="Outpoint: {{vin.txid}},{{vin.vout}}"></a>
<span data-ng-show="vin.notAddr">{{vin.addr}}</span>
<a href="/address/{{vin.addr}}" data-ng-show="!vin.notAddr">{{vin.addr}}</a>
<a href="address/{{vin.addr}}" data-ng-show="!vin.notAddr">{{vin.addr}}</a>
</div>
<div data-ng-show="vin.unconfirmedInput" class="text-danger">
<span class="glyphicon glyphicon-warning-sign"></span>
@ -86,7 +86,7 @@
<div data-ng-show="vin.doubleSpentTxID" class="text-danger">
<span class="glyphicon glyphicon-warning-sign"></span>
<span translate>Double spent attempt detected. From tx:</span>
<a href="/tx/{{<vin class=""></vin>doubleSpentTxID}}">{{vin.doubleSpentTxID}},{{vin.doubleSpentIndex}}</a>
<a href="tx/{{<vin class=""></vin>doubleSpentTxID}}">{{vin.doubleSpentTxID}},{{vin.doubleSpentIndex}}</a>
</div>
</div> <!-- END OF PANEL BODY -->
</div> <!-- END OF PANEL-DEFAULT -->
@ -138,7 +138,7 @@
<div class="ellipsis">
<span data-ng-show="vout.notAddr">{{vout.addr}}</span>
<span class="text-muted" title="Current Bitcoin Address" data-ng-show="address == $root.currentAddr" data-ng-repeat="address in vout.addr.split(',')">{{vout.addr}}</span>
<a href="/address/{{address}}" data-ng-show="!vout.notAddr && address != $root.currentAddr" data-ng-repeat="address in vout.addr.split(',')">{{address}}</a>
<a href="address/{{address}}" data-ng-show="!vout.notAddr && address != $root.currentAddr" data-ng-repeat="address in vout.addr.split(',')">{{address}}</a>
</div>
</div>
</div>
@ -159,11 +159,11 @@
<div class="pull-right btc-value">
<span>{{$root.currency.getConvertion(vout.value) || vout.value + ' BTC'}}
<span class="text-success" data-ng-show="!vout.spentTxId" tooltip="Output is unspent" tooltip-placement="left">(U)</span>
<a class="glyphicon glyphicon-chevron-right" data-ng-show="vout.spentTxId" href="/tx/{{vout.spentTxId}}/</{{vout.spentIndex}}" title="Spent at: {{vout.spentTxId}},{{vout.spentIndex}}"></a>
<a class="glyphicon glyphicon-chevron-right" data-ng-show="vout.spentTxId" href="tx/{{vout.spentTxId}}/</{{vout.spentIndex}}" title="Spent at: {{vout.spentTxId}},{{vout.spentIndex}}"></a>
</span>
</div>
<div class="ellipsis">
<a href="/address/{{address}}" data-ng-repeat="address in vout.scriptPubKey.addresses">{{address}}</a>
<a href="address/{{address}}" data-ng-repeat="address in vout.scriptPubKey.addresses">{{address}}</a>
</div>
</div>
</div>
@ -193,7 +193,7 @@
</div>
<div class="well well-sm bgwhite ellipsis" data-ng-if="itemsExpanded && !block.hash && tx.blockhash">
<strong translate>Included in Block</strong> <a class="text-muted" href="/block/{{tx.blockhash}}">{{tx.blockhash}}</a>
<strong translate>Included in Block</strong> <a class="text-muted" href="block/{{tx.blockhash}}">{{tx.blockhash}}</a>
<span class="btn-copy" clip-copy="tx.blockhash"></span>
</div>