Add getStatus call to header controller

This commit is contained in:
Sky Young 2018-05-21 14:10:02 -07:00
parent 6c7776904a
commit b00f80b967
2 changed files with 15 additions and 2 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "flosight-ui", "name": "flosight-ui",
"description": "An open-source frontend for the Flosight API. The Flosight API provides you with a convenient, powerful and simple way to query and broadcast data on the florincoin network and build your own services with it.", "description": "An open-source frontend for the Flosight API. The Flosight API provides you with a convenient, powerful and simple way to query and broadcast data on the florincoin network and build your own services with it.",
"version": "5.0.0-beta.60", "version": "5.0.0-beta.61",
"repository": "git://github.com/bitpay/flosight-ui.git", "repository": "git://github.com/bitpay/flosight-ui.git",
"bugs": { "bugs": {
"url": "https://github.com/bitpay/flosight-ui/issues" "url": "https://github.com/bitpay/flosight-ui/issues"

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('flosight.system').controller('HeaderController', angular.module('flosight.system').controller('HeaderController',
function($scope, $rootScope, $modal, getSocket, Global, Block) { function($scope, $rootScope, $modal, getSocket, Global, Block, Status) {
$scope.global = Global; $scope.global = Global;
$rootScope.currency = { $rootScope.currency = {
@ -25,6 +25,19 @@ angular.module('flosight.system').controller('HeaderController',
}); });
}; };
$scope.getStatus = function(q) {
Status.get({
q: 'get' + q
},
function(d) {
$scope.loaded = 1;
angular.extend($scope, d);
},
function(e) {
$scope.error = 'API ERROR: ' + e.data;
});
};
var _getBlock = function(hash) { var _getBlock = function(hash) {
Block.get({ Block.get({
blockHash: hash blockHash: hash