Browse Source

Epoch + DAG Size info

master
yuriy0803 2 years ago
parent
commit
c3e08e1265
  1. 250
      www/app/controllers/index.js
  2. 43
      www/app/templates/index.hbs

250
www/app/controllers/index.js

@ -1,22 +1,22 @@
import Ember from 'ember'; import Ember from 'ember';
export default Ember.Controller.extend({ export default Ember.Controller.extend({
applicationController: Ember.inject.controller('application'), applicationController: Ember.inject.controller('application'),
stats: Ember.computed.reads('applicationController'), stats: Ember.computed.reads('applicationController'),
config: Ember.computed.reads('applicationController.config'), config: Ember.computed.reads('applicationController.config'),
cachedLogin: Ember.computed('login', { cachedLogin: Ember.computed('login', {
get() { get() {
return this.get('login') || Ember.$.cookie('login'); return this.get('login') || Ember.$.cookie('login');
}, },
set(key, value) { set(key, value) {
Ember.$.cookie('login', value); Ember.$.cookie('login', value);
this.set('model.login', value); this.set('model.login', value);
return value; return value;
} }
}), }),
chartOptions: Ember.computed("model.hashrate", { chartOptions: Ember.computed("model.hashrate", {
get() { get() {
var e = this, var e = this,
t = e.getWithDefault("stats.model.poolCharts"), t = e.getWithDefault("stats.model.poolCharts"),
@ -27,9 +27,9 @@ export default Ember.Controller.extend({
height: 220, height: 220,
marginRight: 10, marginRight: 10,
events: { events: {
load: function() { load: function () {
var series = this.series[0]; var series = this.series[0];
setInterval(function() { setInterval(function () {
var x = (new Date()).getTime(), y = e.getWithDefault("model.Hashrate") / 1000000; var x = (new Date()).getTime(), y = e.getWithDefault("model.Hashrate") / 1000000;
series.addPoint([x, y], true, true); series.addPoint([x, y], true, true);
}, 1090000000); }, 1090000000);
@ -74,18 +74,18 @@ export default Ember.Controller.extend({
enabled: true enabled: true
}, },
tooltip: { tooltip: {
formatter: function() { formatter: function () {
return this.y > 1000000000000 ? "<b>" + this.point.d + "<b><br>Hashrate&nbsp;" + (this.y / 1000000000000).toFixed(2) + "&nbsp;TH/s</b>" : this.y > 1000000000 ? "<b>" + this.point.d + "<b><br>Hashrate&nbsp;" + (this.y / 1000000000).toFixed(2) + "&nbsp;GH/s</b>" : this.y > 1000000 ? "<b>" + this.point.d + "<b><br>Hashrate&nbsp;" + (this.y / 1000000).toFixed(2) + "&nbsp;MH/s</b>" : "<b>" + this.point.d + "<b><br>Hashrate<b>&nbsp;" + this.y.toFixed(2) + "&nbsp;H/s</b>"; return this.y > 1000000000000 ? "<b>" + this.point.d + "<b><br>Hashrate&nbsp;" + (this.y / 1000000000000).toFixed(2) + "&nbsp;TH/s</b>" : this.y > 1000000000 ? "<b>" + this.point.d + "<b><br>Hashrate&nbsp;" + (this.y / 1000000000).toFixed(2) + "&nbsp;GH/s</b>" : this.y > 1000000 ? "<b>" + this.point.d + "<b><br>Hashrate&nbsp;" + (this.y / 1000000).toFixed(2) + "&nbsp;MH/s</b>" : "<b>" + this.point.d + "<b><br>Hashrate<b>&nbsp;" + this.y.toFixed(2) + "&nbsp;H/s</b>";
}, },
useHTML: true useHTML: true
}, },
exporting: { exporting: {
enabled: false enabled: false
}, },
series: [{ series: [{
color: "#15BD27", color: "#15BD27",
name: "Hashrate", name: "Hashrate",
data: function() { data: function () {
var e, a = []; var e, a = [];
if (null != t) { if (null != t) {
for (e = 0; e <= t.length - 1; e += 1) { for (e = 0; e <= t.length - 1; e += 1) {
@ -102,9 +102,9 @@ export default Ember.Controller.extend({
} }
} else { } else {
a.push({ a.push({
x: 0, x: 0,
d: 0, d: 0,
y: 0 y: 0
}); });
} }
return a; return a;
@ -114,8 +114,8 @@ export default Ember.Controller.extend({
return a; return a;
} }
}), }),
chartDiff: Ember.computed("model.hashrate", { chartDiff: Ember.computed("model.hashrate", {
get() { get() {
var e = this, var e = this,
t = e.getWithDefault("stats.model.netCharts"), t = e.getWithDefault("stats.model.netCharts"),
@ -126,15 +126,15 @@ export default Ember.Controller.extend({
height: 250, height: 250,
marginRight: 10, marginRight: 10,
//zoomType: 'xy', //zoomType: 'xy',
/* events: { /* events: {
load: function() { load: function() {
var series = this.series[0]; var series = this.series[0];
setInterval(function() { setInterval(function() {
var x = (new Date()).getTime(), y = e.getWithDefault("difficulty") / 1000000; var x = (new Date()).getTime(), y = e.getWithDefault("difficulty") / 1000000;
series.addPoint([x, y], true, true); series.addPoint([x, y], true, true);
}, 1090000000); }, 1090000000);
} }
} */ } */
}, },
title: { title: {
text: "Network Difficulty", text: "Network Difficulty",
@ -142,95 +142,95 @@ export default Ember.Controller.extend({
color: "#000" color: "#000"
} }
}, },
rangeSelector : { rangeSelector: {
enabled: true, enabled: true,
selected: 4, selected: 4,
allButtonsEnabled: true, allButtonsEnabled: true,
inputDateFormat: '%Y/%m/%d %H:%M', inputDateFormat: '%Y/%m/%d %H:%M',
inputEditDateFormat: '%Y/%m/%d %H:%M', inputEditDateFormat: '%Y/%m/%d %H:%M',
inputEnabled: false, inputEnabled: false,
buttons: [{ buttons: [{
type: 'hour', type: 'hour',
count: 1, count: 1,
text: '1h' text: '1h'
}, },
{ {
type: 'hour', type: 'hour',
count: 2, count: 2,
text: '2h' text: '2h'
}, },
{ {
type: 'hour', type: 'hour',
count: 4, count: 4,
text: '4h' text: '4h'
}, },
{ {
type: 'hour', type: 'hour',
count: 6, count: 6,
text: '6h' text: '6h'
}, },
{ {
type: 'hour', type: 'hour',
count: 12, count: 12,
text: '12h' text: '12h'
}, },
{ {
type: 'all', type: 'all',
text: 'All' text: 'All'
} }
], ],
}, },
navigator: { navigator: {
enabled: true enabled: true
}, },
/* scrollbar: { /* scrollbar: {
enabled:true, enabled:true,
barBackgroundColor: 'gray', barBackgroundColor: 'gray',
barBorderRadius: 7, barBorderRadius: 7,
barBorderWidth: 0, barBorderWidth: 0,
buttonBackgroundColor: 'gray', buttonBackgroundColor: 'gray',
buttonBorderWidth: 0, buttonBorderWidth: 0,
buttonArrowColor: 'yellow', buttonArrowColor: 'yellow',
buttonBorderRadius: 7, buttonBorderRadius: 7,
rifleColor: 'yellow', rifleColor: 'yellow',
trackBackgroundColor: 'white', trackBackgroundColor: 'white',
trackBorderWidth: 1, trackBorderWidth: 1,
trackBorderColor: 'silver', trackBorderColor: 'silver',
trackBorderRadius: 7 trackBorderRadius: 7
}, */ }, */
credits: { credits: {
enabled: false, enabled: false,
position: { position: {
align: 'right', align: 'right',
x: -10, x: -10,
verticalAlign: 'bottom', verticalAlign: 'bottom',
y: -5 y: -5
}, },
href: "https://highcharts.com", href: "https://highcharts.com",
text: "Highcharts" text: "Highcharts"
}, },
xAxis: { xAxis: {
labels: { labels: {
style: { style: {
color: "#000" color: "#000"
} }
//minRange: 1 //minRange: 1
}, },
ordinal: false, ordinal: false,
type: "datetime" type: "datetime"
}, },
yAxis: { yAxis: {
title: { title: {
text: "DIFFICULTY", text: "DIFFICULTY",
style: { style: {
color: "#000" color: "#000"
} }
}, },
labels: { labels: {
style: { style: {
color: "#000" color: "#000"
@ -246,18 +246,18 @@ export default Ember.Controller.extend({
enabled: false enabled: false
}, },
tooltip: { tooltip: {
formatter: function() { formatter: function () {
return this.y > 1000000000000 ? "<b>" + this.point.d + "<b><br>Difficulty&nbsp;" + (this.y / 1000000000000).toFixed(2) + "&nbsp;TH/s</b>" : this.y > 1000000000 ? "<b>" + this.point.d + "<b><br>Difficulty&nbsp;" + (this.y / 1000000000).toFixed(2) + "&nbsp;GH/s</b>" : this.y > 1000000 ? "<b>" + this.point.d + "<b><br>Difficulty&nbsp;" + (this.y / 1000000).toFixed(2) + "&nbsp;MH/s</b>" : "<b>" + this.point.d + "<b><br>Difficulty<b>&nbsp;" + this.y.toFixed(2) + "&nbsp;H/s</b>"; return this.y > 1000000000000 ? "<b>" + this.point.d + "<b><br>Difficulty&nbsp;" + (this.y / 1000000000000).toFixed(2) + "&nbsp;TH/s</b>" : this.y > 1000000000 ? "<b>" + this.point.d + "<b><br>Difficulty&nbsp;" + (this.y / 1000000000).toFixed(2) + "&nbsp;GH/s</b>" : this.y > 1000000 ? "<b>" + this.point.d + "<b><br>Difficulty&nbsp;" + (this.y / 1000000).toFixed(2) + "&nbsp;MH/s</b>" : "<b>" + this.point.d + "<b><br>Difficulty<b>&nbsp;" + this.y.toFixed(2) + "&nbsp;H/s</b>";
}, },
useHTML: true useHTML: true
}, },
exporting: { exporting: {
enabled: true enabled: true
}, },
series: [{ series: [{
color: "#F87217", color: "#F87217",
name: "Difficulty", name: "Difficulty",
data: function() { data: function () {
var e, a = []; var e, a = [];
if (null != t) { if (null != t) {
for (e = 0; e <= t.length - 1; e += 1) { for (e = 0; e <= t.length - 1; e += 1) {
@ -274,17 +274,31 @@ export default Ember.Controller.extend({
} }
} else { } else {
a.push({ a.push({
x: 0, x: 0,
d: 0, d: 0,
y: 0 y: 0
}); });
} }
return a; return a;
}() }()
}] }]
}; };
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 */
},
}) })
}); });

43
www/app/templates/index.hbs

@ -10,26 +10,35 @@
</h1> </h1>
</div> </div>
<div class="row" style="padding:15px 5px;"> <div class="row" style="padding:15px 5px;">
<strong>Min. payout threshold: {{config.PayoutThreshold}}</strong>, Payouts are continuos throughout the day. <strong>Min. payout threshold: {{config.PayoutThreshold}}</strong>, Payouts are continuos throughout the day.
<br/> <br />
<span class="label label-success">PPLNS</span> Stable and profitable pool with regular payouts. <span class="label label-success">PPLNS</span> Stable and profitable pool with regular payouts.
</div> </div>
</div> </div>
<div class="col-md-3 stats"> <div class="col-md-3 stats">
<div><i class="fa fa-users"></i> Miners Online: <span id="poolHashrate">{{format-number stats.model.minersTotal}}</span></div> <div><i class="fa fa-users"></i> Miners Online: <span id="poolHashrate">{{format-number
<div><i class="fa fa-tachometer"></i> Pool Hash Rate: <span id="poolHashrate">{{format-hashrate stats.model.hashrate}}</span></div> stats.model.minersTotal}}</span></div>
<div><i class="fa fa-money"></i> Pool Fee: <span id="poolFee" class="label label-success">{{config.PoolFee}}</span></div> <div><i class="fa fa-tachometer"></i> Pool Hash Rate: <span id="poolHashrate">{{format-hashrate
stats.model.hashrate}}</span></div>
<div><i class="fa fa-money"></i> Pool Fee: <span id="poolFee"
class="label label-success">{{config.PoolFee}}</span></div>
{{#if stats.model.stats.lastBlockFound}} {{#if stats.model.stats.lastBlockFound}}
<div><i class="fa fa-clock-o"></i> Last Block Found: <span>{{format-relative (seconds-to-ms stats.model.stats.lastBlockFound)}}</span></div> <div><i class="fa fa-clock-o"></i> Last Block Found: <span>{{format-relative (seconds-to-ms
stats.model.stats.lastBlockFound)}}</span></div>
{{/if}} {{/if}}
<div><i class="fa fa-clock-o"></i> AVG BLOCK TIME: <span>{{format-number stats.blockTime}} s</span></div> <div><i class="fa fa-clock-o"></i> AVG BLOCK TIME: <span>{{format-number stats.blockTime}} s</span></div>
</div> </div>
<div><i class="fa fa-gears"></i>Epoch: <span>{{format-number epoch}}</span> DAG Size: <span>{{format-number
dag}} GB</span></div>
<div class="col-md-4 stats"> <div class="col-md-4 stats">
<div><i class="fa fa-unlock-alt"></i> Network Difficulty: <span>{{with-metric-prefix stats.difficulty}}</span></div> <div><i class="fa fa-unlock-alt"></i> Network Difficulty: <span>{{with-metric-prefix stats.difficulty}}</span>
</div>
<div><i class="fa fa-tachometer"></i> Network Hash Rate: <span>{{format-hashrate stats.hashrate}}</span></div> <div><i class="fa fa-tachometer"></i> Network Hash Rate: <span>{{format-hashrate stats.hashrate}}</span></div>
<div><i class="fa fa-bars"></i> Blockchain Height: <span>{{format-number stats.height}}</span></div> <div><i class="fa fa-bars"></i> Blockchain Height: <span>{{format-number stats.height}}</span></div>
<div><i class="fa fa-clock-o"></i> Current Round Variance: <span>{{format-number stats.roundVariance style='percent'}}</span></div> <div><i class="fa fa-clock-o"></i> Current Round Variance: <span>{{format-number stats.roundVariance
<div><i class="fa fa-credit-card-alt fa-fw"></i> Current price: <span>$ {{model.exchangedata.current_price}}</span></div> style='percent'}}</span></div>
<div><i class="fa fa-credit-card-alt fa-fw"></i> Current price: <span>$
{{model.exchangedata.current_price}}</span></div>
</div> </div>
</div> </div>
</div> </div>
@ -43,17 +52,17 @@
<span class="input-group-btn"> <span class="input-group-btn">
<button class="btn btn-primary btn-etc" type="button" {{action 'lookup' cachedLogin}}> <button class="btn btn-primary btn-etc" type="button" {{action 'lookup' cachedLogin}}>
<span style="display: inline;"><i class="fa fa-search"></i> Lookup</span> <span style="display: inline;"><i class="fa fa-search"></i> Lookup</span>
</button> </button>
</span> </span>
</div> </div>
</div> </div>
<div> <div>
<div class="container"> <div class="container">
{{high-charts mode=mode chartOptions=chartOptions content=chartData}} {{high-charts mode=mode chartOptions=chartOptions content=chartData}}
</div> </div>
<div class="container"> <div class="container">
{{high-charts mode=mode chartOptions=chartDiff content=chartData}} {{high-charts mode=mode chartOptions=chartDiff content=chartData}}
</div> </div>
<div class="jumbotron"> <div class="jumbotron">
<div class="container"> <div class="container">
<h3 class="text-center" style="padding: 0 0 5px 0; margin: 0 0 40px 0;"> Instructions</h3> <h3 class="text-center" style="padding: 0 0 5px 0; margin: 0 0 40px 0;"> Instructions</h3>
@ -70,4 +79,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
Loading…
Cancel
Save