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.

50 lines
1.5 KiB

  1. 'use strict';
  2. angular.module('app.main', ['ngRoute'])
  3. .config(['$routeProvider', function($routeProvider) {
  4. $routeProvider.when('/main', {
  5. templateUrl: 'views/main/main.html',
  6. controller: 'MainCtrl'
  7. });
  8. }])
  9. .controller('MainCtrl', function($scope, $http) {
  10. //last addr
  11. $scope.addresses = [];
  12. $http.get(urlapi + 'lastaddr')
  13. .then(function(data, status, headers, config) {
  14. console.log('data success');
  15. console.log(data);
  16. $scope.addresses = data.data;
  17. }, function(data, status, headers, config) {
  18. console.log('data error');
  19. });
  20. //last tx
  21. $scope.txs = [];
  22. $http.get(urlapi + 'lasttx')
  23. .then(function(data, status, headers, config) {
  24. console.log('data success');
  25. console.log(data);
  26. $scope.txs = data.data;
  27. }, function(data, status, headers, config) {
  28. console.log('data error');
  29. });
  30. //date analysis
  31. $scope.data = [];
  32. $scope.labels = [];
  33. $http.get(urlapi + 'houranalysis')
  34. .then(function(data, status, headers, config) {
  35. console.log('data success');
  36. console.log(data);
  37. $scope.data = data.data.data;
  38. $scope.labels = data.data.labels;
  39. }, function(data, status, headers, config) {
  40. console.log('data error');
  41. });
  42. });