You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

67 lines
2.1 KiB

'use strict';
angular.module('app.main', ['ngRoute'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/main', {
templateUrl: 'views/main/main.html',
controller: 'MainCtrl'
});
}])
.controller('MainCtrl', function($scope, $http) {
//last addr
$scope.addresses = [];
$http.get(urlapi + 'lastaddr')
.then(function(data, status, headers, config) {
console.log('data success');
console.log(data);
$scope.addresses = data.data;
}, function(data, status, headers, config) {
console.log('data error');
});
//last tx
$scope.txs = [];
$http.get(urlapi + 'lasttx')
.then(function(data, status, headers, config) {
console.log('data success');
console.log(data);
$scope.txs = data.data;
}, function(data, status, headers, config) {
console.log('data error');
});
//date analysis
$scope.last24hour= {
data:[],
labels: []
};
$http.get(urlapi + 'last24hour')
.then(function(data, status, headers, config) {
console.log('data success');
console.log(data);
$scope.last24hour.data = data.data.data;
$scope.last24hour.labels = data.data.labels;
}, function(data, status, headers, config) {
console.log('data error');
});
$scope.last7dayhour= {
data:[],
labels: []
};
$http.get(urlapi + 'last7dayhour')
.then(function(data, status, headers, config) {
console.log('data success');
console.log(data);
$scope.last7dayhour.data = data.data.data;
$scope.last7dayhour.labels = data.data.labels;
$scope.last7dayhour.series = data.data.series;
}, function(data, status, headers, config) {
console.log('data error');
});
});