Merge pull request #82 from colkito/feature/error-pages-not-found
added error messages for bad addresses, txids, blockids
This commit is contained in:
commit
9db25a988e
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.address').controller('AddressController', ['$scope', '$routeParams', '$location', 'Global', 'Address', function ($scope, $routeParams, $location, Global, Address) {
|
angular.module('insight.address').controller('AddressController', ['$scope', '$rootScope', '$routeParams', '$location', 'Global', 'Address', function ($scope, $rootScope, $routeParams, $location, Global, Address) {
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
$scope.findOne = function() {
|
$scope.findOne = function() {
|
||||||
|
@ -8,6 +8,9 @@ angular.module('insight.address').controller('AddressController', ['$scope', '$r
|
||||||
addrStr: $routeParams.addrStr
|
addrStr: $routeParams.addrStr
|
||||||
}, function(address) {
|
}, function(address) {
|
||||||
$scope.address = address;
|
$scope.address = address;
|
||||||
|
}, function() {
|
||||||
|
$rootScope.flashMessage = 'Address Not Found';
|
||||||
|
$location.path('/');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.blocks').controller('BlocksController', ['$scope', '$routeParams', '$location', 'Global', 'Block', 'Blocks', function ($scope, $routeParams, $location, Global, Block, Blocks) {
|
angular.module('insight.blocks').controller('BlocksController', ['$scope', '$rootScope', '$routeParams', '$location', 'Global', 'Block', 'Blocks', function ($scope, $rootScope, $routeParams, $location, Global, Block, Blocks) {
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
$scope.list = function() {
|
$scope.list = function() {
|
||||||
|
@ -17,6 +17,9 @@ angular.module('insight.blocks').controller('BlocksController', ['$scope', '$rou
|
||||||
blockHash: $routeParams.blockHash
|
blockHash: $routeParams.blockHash
|
||||||
}, function(block) {
|
}, function(block) {
|
||||||
$scope.block = block;
|
$scope.block = block;
|
||||||
|
}, function() {
|
||||||
|
$rootScope.flashMessage = 'Block Not Found';
|
||||||
|
$location.path('/');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,12 @@
|
||||||
|
|
||||||
var TRANSACTION_DISPLAYED = 5;
|
var TRANSACTION_DISPLAYED = 5;
|
||||||
var BLOCKS_DISPLAYED = 5;
|
var BLOCKS_DISPLAYED = 5;
|
||||||
angular.module('insight.system').controller('IndexController', ['$scope', 'Global', 'socket', 'Blocks', 'Transactions', function($scope, Global, socket, Blocks, Transactions) {
|
angular.module('insight.system').controller('IndexController', ['$scope', '$rootScope', 'Global', 'socket', 'Blocks', 'Transactions', function($scope, $rootScope, Global, socket, Blocks, Transactions) {
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
|
//show errors
|
||||||
|
$scope.flashMessage = $rootScope.flashMessage || null;
|
||||||
|
|
||||||
socket.on('tx', function(tx) {
|
socket.on('tx', function(tx) {
|
||||||
console.log('Transaction received! ' + JSON.stringify(tx));
|
console.log('Transaction received! ' + JSON.stringify(tx));
|
||||||
if ($scope.txs.length === TRANSACTION_DISPLAYED) {
|
if ($scope.txs.length === TRANSACTION_DISPLAYED) {
|
||||||
|
@ -43,4 +46,3 @@ angular.module('insight.system').controller('IndexController', ['$scope', 'Globa
|
||||||
$scope.txs = [];
|
$scope.txs = [];
|
||||||
$scope.blocks = [];
|
$scope.blocks = [];
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('insight.transactions').controller('transactionsController', ['$scope', '$routeParams', '$location', 'Global', 'Transaction', 'TransactionsByBlock', 'TransactionsByAddress', function ($scope, $routeParams, $location, Global, Transaction, TransactionsByBlock, TransactionsByAddress) {
|
angular.module('insight.transactions').controller('transactionsController', ['$scope', '$rootScope', '$routeParams', '$location', 'Global', 'Transaction', 'TransactionsByBlock', 'TransactionsByAddress', '$rootScope', function ($scope, $rootScope, $routeParams, $location, Global, Transaction, TransactionsByBlock, TransactionsByAddress) {
|
||||||
$scope.global = Global;
|
$scope.global = Global;
|
||||||
|
|
||||||
$scope.findOne = function() {
|
$scope.findOne = function() {
|
||||||
|
@ -8,6 +8,9 @@ angular.module('insight.transactions').controller('transactionsController', ['$s
|
||||||
txId: $routeParams.txId
|
txId: $routeParams.txId
|
||||||
}, function(tx) {
|
}, function(tx) {
|
||||||
$scope.tx = tx;
|
$scope.tx = tx;
|
||||||
|
}, function() {
|
||||||
|
$rootScope.flashMessage = 'Transaction Not Found';
|
||||||
|
$location.path('/');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -26,7 +29,4 @@ angular.module('insight.transactions').controller('transactionsController', ['$s
|
||||||
$scope.txs = txs;
|
$scope.txs = txs;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="jumbotron">
|
<div class="jumbotron">
|
||||||
<h1>Ooops!</h1>
|
<h1>Ooops!</h1>
|
||||||
<h2 class="text-muted">Page not found :(</h2>
|
<h2 class="text-muted">404 Page not found :(</h2>
|
||||||
<p><a href="/" class="pull-right">Go to home</a></p>
|
<p><a href="/" class="pull-right">Go to home</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
<div class="alert alert-danger" ng:show="flashMessage">
|
||||||
|
{{flashMessage}}
|
||||||
|
</div>
|
||||||
<section data-ng-controller="IndexController" data-ng-init="index()">
|
<section data-ng-controller="IndexController" data-ng-init="index()">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -20,4 +23,3 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue