diff --git a/www/app/controllers/index.js b/www/app/controllers/index.js index 34656a2..69ce510 100644 --- a/www/app/controllers/index.js +++ b/www/app/controllers/index.js @@ -1,22 +1,22 @@ import Ember from 'ember'; export default Ember.Controller.extend({ - applicationController: Ember.inject.controller('application'), - stats: Ember.computed.reads('applicationController'), - config: Ember.computed.reads('applicationController.config'), + applicationController: Ember.inject.controller('application'), + stats: Ember.computed.reads('applicationController'), + config: Ember.computed.reads('applicationController.config'), - cachedLogin: Ember.computed('login', { - get() { - return this.get('login') || Ember.$.cookie('login'); - }, - set(key, value) { - Ember.$.cookie('login', value); - this.set('model.login', value); - return value; - } - }), - - chartOptions: Ember.computed("model.hashrate", { + cachedLogin: Ember.computed('login', { + get() { + return this.get('login') || Ember.$.cookie('login'); + }, + set(key, value) { + Ember.$.cookie('login', value); + this.set('model.login', value); + return value; + } + }), + + chartOptions: Ember.computed("model.hashrate", { get() { var e = this, t = e.getWithDefault("stats.model.poolCharts"), @@ -27,9 +27,9 @@ export default Ember.Controller.extend({ height: 220, marginRight: 10, events: { - load: function() { + load: function () { var series = this.series[0]; - setInterval(function() { + setInterval(function () { var x = (new Date()).getTime(), y = e.getWithDefault("model.Hashrate") / 1000000; series.addPoint([x, y], true, true); }, 1090000000); @@ -74,18 +74,18 @@ export default Ember.Controller.extend({ enabled: true }, tooltip: { - formatter: function() { + formatter: function () { return this.y > 1000000000000 ? "" + this.point.d + "
Hashrate " + (this.y / 1000000000000).toFixed(2) + " TH/s
" : this.y > 1000000000 ? "" + this.point.d + "
Hashrate " + (this.y / 1000000000).toFixed(2) + " GH/s
" : this.y > 1000000 ? "" + this.point.d + "
Hashrate " + (this.y / 1000000).toFixed(2) + " MH/s
" : "" + this.point.d + "
Hashrate " + this.y.toFixed(2) + " H/s"; }, useHTML: true }, - exporting: { - enabled: false - }, + exporting: { + enabled: false + }, series: [{ color: "#15BD27", name: "Hashrate", - data: function() { + data: function () { var e, a = []; if (null != t) { for (e = 0; e <= t.length - 1; e += 1) { @@ -102,9 +102,9 @@ export default Ember.Controller.extend({ } } else { a.push({ - x: 0, - d: 0, - y: 0 + x: 0, + d: 0, + y: 0 }); } return a; @@ -114,8 +114,8 @@ export default Ember.Controller.extend({ return a; } }), - - chartDiff: Ember.computed("model.hashrate", { + + chartDiff: Ember.computed("model.hashrate", { get() { var e = this, t = e.getWithDefault("stats.model.netCharts"), @@ -126,15 +126,15 @@ export default Ember.Controller.extend({ height: 250, marginRight: 10, //zoomType: 'xy', - /* events: { - load: function() { - var series = this.series[0]; - setInterval(function() { - var x = (new Date()).getTime(), y = e.getWithDefault("difficulty") / 1000000; - series.addPoint([x, y], true, true); - }, 1090000000); - } - } */ + /* events: { + load: function() { + var series = this.series[0]; + setInterval(function() { + var x = (new Date()).getTime(), y = e.getWithDefault("difficulty") / 1000000; + series.addPoint([x, y], true, true); + }, 1090000000); + } + } */ }, title: { text: "Network Difficulty", @@ -142,95 +142,95 @@ export default Ember.Controller.extend({ color: "#000" } }, - rangeSelector : { - enabled: true, - selected: 4, - allButtonsEnabled: true, - inputDateFormat: '%Y/%m/%d %H:%M', - inputEditDateFormat: '%Y/%m/%d %H:%M', - inputEnabled: false, - buttons: [{ - type: 'hour', - count: 1, - text: '1h' - }, - { - type: 'hour', - count: 2, - text: '2h' - }, - { - type: 'hour', - count: 4, - text: '4h' - }, - { - type: 'hour', - count: 6, - text: '6h' - }, - { - type: 'hour', - count: 12, - text: '12h' - }, - { - type: 'all', - text: 'All' - } - ], - }, - navigator: { - enabled: true - }, - /* scrollbar: { - enabled:true, - barBackgroundColor: 'gray', - barBorderRadius: 7, - barBorderWidth: 0, - buttonBackgroundColor: 'gray', - buttonBorderWidth: 0, - buttonArrowColor: 'yellow', - buttonBorderRadius: 7, - rifleColor: 'yellow', - trackBackgroundColor: 'white', - trackBorderWidth: 1, - trackBorderColor: 'silver', - trackBorderRadius: 7 - - - }, */ - credits: { - enabled: false, - position: { - align: 'right', - x: -10, - verticalAlign: 'bottom', - y: -5 - }, - href: "https://highcharts.com", - text: "Highcharts" - }, + rangeSelector: { + enabled: true, + selected: 4, + allButtonsEnabled: true, + inputDateFormat: '%Y/%m/%d %H:%M', + inputEditDateFormat: '%Y/%m/%d %H:%M', + inputEnabled: false, + buttons: [{ + type: 'hour', + count: 1, + text: '1h' + }, + { + type: 'hour', + count: 2, + text: '2h' + }, + { + type: 'hour', + count: 4, + text: '4h' + }, + { + type: 'hour', + count: 6, + text: '6h' + }, + { + type: 'hour', + count: 12, + text: '12h' + }, + { + type: 'all', + text: 'All' + } + ], + }, + navigator: { + enabled: true + }, + /* scrollbar: { + enabled:true, + barBackgroundColor: 'gray', + barBorderRadius: 7, + barBorderWidth: 0, + buttonBackgroundColor: 'gray', + buttonBorderWidth: 0, + buttonArrowColor: 'yellow', + buttonBorderRadius: 7, + rifleColor: 'yellow', + trackBackgroundColor: 'white', + trackBorderWidth: 1, + trackBorderColor: 'silver', + trackBorderRadius: 7 + + + }, */ + credits: { + enabled: false, + position: { + align: 'right', + x: -10, + verticalAlign: 'bottom', + y: -5 + }, + href: "https://highcharts.com", + text: "Highcharts" + }, xAxis: { - + labels: { style: { color: "#000" } - //minRange: 1 + //minRange: 1 }, ordinal: false, type: "datetime" }, yAxis: { - + title: { text: "DIFFICULTY", style: { color: "#000" } }, - + labels: { style: { color: "#000" @@ -246,18 +246,18 @@ export default Ember.Controller.extend({ enabled: false }, tooltip: { - formatter: function() { + formatter: function () { return this.y > 1000000000000 ? "" + this.point.d + "
Difficulty " + (this.y / 1000000000000).toFixed(2) + " TH/s
" : this.y > 1000000000 ? "" + this.point.d + "
Difficulty " + (this.y / 1000000000).toFixed(2) + " GH/s
" : this.y > 1000000 ? "" + this.point.d + "
Difficulty " + (this.y / 1000000).toFixed(2) + " MH/s
" : "" + this.point.d + "
Difficulty " + this.y.toFixed(2) + " H/s"; }, useHTML: true }, - exporting: { - enabled: true - }, + exporting: { + enabled: true + }, series: [{ color: "#F87217", name: "Difficulty", - data: function() { + data: function () { var e, a = []; if (null != t) { for (e = 0; e <= t.length - 1; e += 1) { @@ -274,17 +274,31 @@ export default Ember.Controller.extend({ } } else { a.push({ - x: 0, - d: 0, - y: 0 + x: 0, + d: 0, + y: 0 }); } return a; }() - + }] }; return a; } + }), + dag: Ember.computed("stats", "model", { + get() { + var percent = (this.get("epoch") * 8192) / 1024 / 1024 + 1; + if (!percent) { + return 0; + } + return percent; + }, + }), + epoch: Ember.computed("model.stats", { + get() { + return parseInt(this.get("applicationController.height") / 60000); /* etchash 60000 ethash 30000 */ + }, }) }); \ No newline at end of file diff --git a/www/app/templates/index.hbs b/www/app/templates/index.hbs index 8ff445b..a065466 100644 --- a/www/app/templates/index.hbs +++ b/www/app/templates/index.hbs @@ -10,26 +10,35 @@
- Min. payout threshold: {{config.PayoutThreshold}}, Payouts are continuos throughout the day. -
+ Min. payout threshold: {{config.PayoutThreshold}}, Payouts are continuos throughout the day. +
PPLNS Stable and profitable pool with regular payouts.
-
Miners Online: {{format-number stats.model.minersTotal}}
-
Pool Hash Rate: {{format-hashrate stats.model.hashrate}}
-
Pool Fee: {{config.PoolFee}}
+
Miners Online: {{format-number + stats.model.minersTotal}}
+
Pool Hash Rate: {{format-hashrate + stats.model.hashrate}}
+
Pool Fee: {{config.PoolFee}}
{{#if stats.model.stats.lastBlockFound}} -
Last Block Found: {{format-relative (seconds-to-ms stats.model.stats.lastBlockFound)}}
+
Last Block Found: {{format-relative (seconds-to-ms + stats.model.stats.lastBlockFound)}}
{{/if}}
AVG BLOCK TIME: {{format-number stats.blockTime}} s
+
Epoch: {{format-number epoch}} DAG Size: {{format-number + dag}} GB
-
Network Difficulty: {{with-metric-prefix stats.difficulty}}
+
Network Difficulty: {{with-metric-prefix stats.difficulty}} +
Network Hash Rate: {{format-hashrate stats.hashrate}}
Blockchain Height: {{format-number stats.height}}
-
Current Round Variance: {{format-number stats.roundVariance style='percent'}}
-
Current price: $ {{model.exchangedata.current_price}}
+
Current Round Variance: {{format-number stats.roundVariance + style='percent'}}
+
Current price: $ + {{model.exchangedata.current_price}}
@@ -43,17 +52,17 @@ +
-
- {{high-charts mode=mode chartOptions=chartOptions content=chartData}} -
-
- {{high-charts mode=mode chartOptions=chartDiff content=chartData}} -
+
+ {{high-charts mode=mode chartOptions=chartOptions content=chartData}} +
+
+ {{high-charts mode=mode chartOptions=chartDiff content=chartData}} +

Instructions

@@ -70,4 +79,4 @@
- + \ No newline at end of file