Get Network Info on Index page

This commit is contained in:
Sky Young 2018-05-21 13:56:49 -07:00
parent 0c40d113b4
commit 5c070d0e65
3 changed files with 16 additions and 4 deletions

View File

@ -1,7 +1,7 @@
{
"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.",
"version": "5.0.0-beta.58",
"version": "5.0.0-beta.59",
"repository": "git://github.com/bitpay/flosight-ui.git",
"bugs": {
"url": "https://github.com/bitpay/flosight-ui/issues"

View File

@ -4,7 +4,7 @@ var TRANSACTION_DISPLAYED = 10;
var BLOCKS_DISPLAYED = 5;
angular.module('flosight.system').controller('IndexController',
function($scope, Global, getSocket, Blocks) {
function($scope, Global, getSocket, Blocks, Status) {
$scope.global = Global;
var _getBlocks = function(loadTxs) {
@ -49,7 +49,18 @@ angular.module('flosight.system').controller('IndexController',
_startSocket();
});
var _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;
});
};
$scope.humanSince = function(time) {
var m = moment.unix(time);
@ -59,6 +70,7 @@ angular.module('flosight.system').controller('IndexController',
$scope.index = function() {
_getBlocks(true);
_startSocket();
_getStatus('Info');
};
$scope.txs = [];

View File

@ -9,7 +9,7 @@
<div id="search-form-mobile" class="visible-xs" data-ng-include src="'views/includes/search.html'"></div>
<h1 translate>Latest Blocks</h1>
<h1 translate>Latest Blocks {{info.network}}</h1>
<table class="table table-hover table-striped" style="table-layout: fixed">
<thead>
<tr>