add bitcore-node service and make everything relative paths

This commit is contained in:
Patrick Nagurny 2015-09-03 11:39:21 -04:00
parent 4253de1ed4
commit 1d70f0196c
22 changed files with 217 additions and 80 deletions

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

@ -0,0 +1,42 @@
'use strict';
var BaseService = require('./service');
var inherits = require('util').inherits;
var fs = require('fs');
var InsightUI = function(options) {
BaseService.call(this, options);
};
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.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(/<base href=\"\/\"/, '<base href="/insight/"')
.replace(/apiPrefix = '\/api'/, "apiPrefix = '/insight-api'");
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

@ -41,6 +41,7 @@
"scripts": {
"start": "INSIGHT_PUBLIC_PATH=public node node_modules/.bin/insight-bitcore-api"
},
"bitcoreNode": "bitcore-node",
"dependencies": {
"insight-bitcore-api": ">=0.2.14"
},

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">
@ -59,15 +60,16 @@
[
<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>

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

@ -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

@ -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">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">
@ -41,7 +41,7 @@
<a href="#" 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,15 +60,15 @@
<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>
@ -81,15 +81,15 @@
</button >
<table class="table" data-ng-show="txoutsetinfo.height" style="table-layout: fixed" >
<thead data-ng-include src="'/views/includes/infoStatus.html'"></thead>
<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>
<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>
<td class="text-right ellipsis"><a href="block/{{txoutsetinfo.bestblock}}">{{txoutsetinfo.bestblock}}</a></td>
</tr>
<tr>
<td translate>Transactions</td>
@ -119,7 +119,7 @@
<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 +131,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">
@ -70,7 +70,7 @@
<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

@ -4,7 +4,7 @@
<a class="btn-expand" href="#" 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>
@ -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>