diff --git a/app/app.css b/app/app.css
index 7fdf73d..7dec0a2 100644
--- a/app/app.css
+++ b/app/app.css
@@ -181,6 +181,15 @@ md-tooltip .md-content {
height:300px;
}
+.chartcontainer-pool {
+ width: 100% !important;
+ height: 150px;
+}
+
+.chartcontainer-pool .ng-isolate-scope {
+ height:150px;
+}
+
/* LOGIN WINDOW */
md-dialog .login{
min-width: 800px !important;
diff --git a/app/app.js b/app/app.js
index 6e12c81..2adf86c 100644
--- a/app/app.js
+++ b/app/app.js
@@ -79,6 +79,8 @@ var app = angular.module('poolui', [
$scope.poolList = ["pplns", "pps", "solo"];
$scope.poolStats = {}; // All Pool stats
+ $scope.poolHashrateChart = {}; // hashrate history
+ $scope.poolMinersChart = {}; // miners history
$scope.addrStats = {}; // All tracked addresses
$scope.lastBlock = {};
diff --git a/app/user/home/home.html b/app/user/home/home.html
index 0b4adcb..7d15635 100644
--- a/app/user/home/home.html
+++ b/app/user/home/home.html
@@ -1,4 +1,27 @@
+
+
+
+ Historical Pool Hashrate
+
+
+
+
+
+
+
+
+
+
+ Historical Pool Miners
+
+
+
+
+
+
+
+
diff --git a/app/user/home/home.js b/app/user/home/home.js
index 6275a5a..d429216 100644
--- a/app/user/home/home.js
+++ b/app/user/home/home.js
@@ -1,5 +1,74 @@
'use strict';
app.controller('HomeCtrl', function($scope, $route, dataService, timerService) {
-
+
+ function ticker() {
+ dataService.getData("/pool/chart/hashrate/pplns", function(data){
+
+ data = _.forEach(data, function(element) {
+ element.ts = new Date(element.ts);
+ });
+
+ $scope.poolHashrateChart = {
+ datasets: { global: data },
+ options: {
+ series: [
+ {"axis":"y","id":"global","dataset":"global","label":"Total Pool Hashrate","key":"hs","color":"green","type":["line","area"]}
+ ],
+ allSeries: [],
+ axes: {
+ x: {
+ key: "ts",
+ type: "date"
+ },
+ y: {
+ min: 0
+ }
+ }
+ }
+ }
+ });
+ }
+
+ function ticker2() {
+ dataService.getData("/pool/chart/miners", function(data){
+
+ data = _.forEach(data, function(element) {
+ element.ts = new Date(element.ts);
+ });
+
+ $scope.poolMinersChart = {
+ datasets: { global: data },
+ options: {
+ series: [
+ {"axis":"y","id":"global","dataset":"global","label":"Total Pool Miners","key":"cn","color":"green","type":["line","area"]}
+ ],
+ allSeries: [],
+ axes: {
+ x: {
+ key: "ts",
+ type: "date"
+ },
+ y: {
+ min: 0
+ }
+ }
+ }
+ }
+ });
+ }
+
+ timerService.register(ticker, 'poolHashrateChart');
+ ticker();
+
+ timerService.register(ticker2, 'poolMinersChart');
+ ticker2();
+
+ $scope.$on("$routeChangeStart", function () {
+ timerService.remove("poolHashrateChart");
+ });
+
+ $scope.$on("$routeChangeStart", function () {
+ timerService.remove("poolMinersChart");
+ });
});
\ No newline at end of file
diff --git a/app/utils/services.js b/app/utils/services.js
index b3f5cb6..a432c67 100644
--- a/app/utils/services.js
+++ b/app/utils/services.js
@@ -156,7 +156,7 @@ angular.module('utils.services', [])
});
// only display selected miners
- var selected = minerStats[addr].selected;
+ var selected = minerStats[addr].table_selected;
if(minerStats[addr].table_selected.length < 1) {
selected = _.union(minerStats[addr].table_selected, ['global']);
}