|
|
|
@ -1,305 +1,338 @@ |
|
|
|
function formatDate(date, format) { |
|
|
|
import Ember from 'ember'; |
|
|
|
date = new Date(date); |
|
|
|
|
|
|
|
var formattedDate = { |
|
|
|
|
|
|
|
year: date.getFullYear(), |
|
|
|
|
|
|
|
month: date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1, |
|
|
|
|
|
|
|
day: date.getDate() < 10 ? "0" + date.getDate() : date.getDate(), |
|
|
|
|
|
|
|
hours: date.getHours() < 10 ? "0" + date.getHours() : date.getHours(), |
|
|
|
|
|
|
|
minutes: date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(), |
|
|
|
|
|
|
|
seconds: date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(), |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
for (var key in formattedDate) { |
|
|
|
|
|
|
|
format = format.replace(key, formattedDate[key]); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return format; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function formatHashrate(hashrate, showUnit) { |
|
|
|
export default Ember.Controller.extend({ |
|
|
|
var units = ["H/s", "KH/s", "MH/s", "GH/s", "TH/s", "PH/s"]; |
|
|
|
applicationController: Ember.inject.controller('application'), |
|
|
|
var index = 0; |
|
|
|
stats: Ember.computed.reads('applicationController'), |
|
|
|
while (hashrate > 1e3) { |
|
|
|
config: Ember.computed.reads('applicationController.config'), |
|
|
|
hashrate /= 1e3; |
|
|
|
|
|
|
|
index++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return showUnit |
|
|
|
|
|
|
|
? hashrate.toFixed(2) + " " + units[index] |
|
|
|
|
|
|
|
: hashrate.toFixed(2) + " " + units[index]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function formatNumber(number) { |
|
|
|
cachedLogin: Ember.computed('login', { |
|
|
|
var units = ["H/s", "KH/s", "MH/s", "GH/s", "TH/s", "PH/s"]; |
|
|
|
get() { |
|
|
|
var index = 0; |
|
|
|
return this.get('login') || Ember.$.cookie('login'); |
|
|
|
while (number >= 1e3) { |
|
|
|
}, |
|
|
|
number /= 1e3; |
|
|
|
set(key, value) { |
|
|
|
index++; |
|
|
|
Ember.$.cookie('login', value); |
|
|
|
|
|
|
|
this.set('model.login', value); |
|
|
|
|
|
|
|
return value; |
|
|
|
} |
|
|
|
} |
|
|
|
number = number < 10 ? number.toFixed(2) : number.toFixed(2); |
|
|
|
}), |
|
|
|
return number.replace(".00", "") + " " + units[index]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import Ember from "ember"; |
|
|
|
chartOptions: Ember.computed("model.hashrate", { |
|
|
|
|
|
|
|
get() { |
|
|
|
|
|
|
|
var now = new Date(); |
|
|
|
|
|
|
|
var e = this, |
|
|
|
|
|
|
|
t = e.getWithDefault("stats.model.poolCharts"), |
|
|
|
|
|
|
|
a = { |
|
|
|
|
|
|
|
chart: { |
|
|
|
|
|
|
|
backgroundColor: "rgba(255, 255, 255, 0.1)", |
|
|
|
|
|
|
|
type: "spline", |
|
|
|
|
|
|
|
height: 300, |
|
|
|
|
|
|
|
marginRight: 10, |
|
|
|
|
|
|
|
events: { |
|
|
|
|
|
|
|
load: function() { |
|
|
|
|
|
|
|
var self = this; |
|
|
|
|
|
|
|
var chartInterval = setInterval(function() { |
|
|
|
|
|
|
|
if (!self.series) { |
|
|
|
|
|
|
|
clearInterval(chartInterval); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var series = self.series[0]; |
|
|
|
|
|
|
|
var now = new Date(); |
|
|
|
|
|
|
|
|
|
|
|
export default Ember.Controller.extend({ |
|
|
|
var shift = false; |
|
|
|
applicationController: Ember.inject.controller("application"), |
|
|
|
// partially update chart
|
|
|
|
stats: Ember.computed.reads("applicationController"), |
|
|
|
if (now - series.data[0].x > 18*60*60*1000) { |
|
|
|
config: Ember.computed.reads("applicationController.config"), |
|
|
|
// show 18 hours ~ 15(min) * 74(points) ~ poolChartsNum: 74, poolChars: "0 */15 ..."
|
|
|
|
|
|
|
|
shift = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// check latest added temporary point and remove tempory added point for less than 5 minutes
|
|
|
|
|
|
|
|
if (series.data.length > 1 && series.data[series.data.length - 1].x - series.data[series.data.length - 2].x < 5*60*1000) { |
|
|
|
|
|
|
|
series.removePoint(series.data.length - 1, false, false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var x = now, y = e.getWithDefault("model.hashrate"); |
|
|
|
|
|
|
|
var d = x.toLocaleString(); |
|
|
|
|
|
|
|
series.addPoint({x: x, y: y, d:d}, true, shift); |
|
|
|
|
|
|
|
}, e.get('config.highcharts.main.interval') || 60000); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
title: { |
|
|
|
|
|
|
|
text: "Our pool's hashrate" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
xAxis: { |
|
|
|
|
|
|
|
labels: { |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
color: "#000" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
ordinal: false, |
|
|
|
|
|
|
|
type: "datetime", |
|
|
|
|
|
|
|
dateTimeLabelFormats: { |
|
|
|
|
|
|
|
millisecond: "%H:%M:%S", |
|
|
|
|
|
|
|
//second: "%H:%M:%S",
|
|
|
|
|
|
|
|
second: "%H:%M", |
|
|
|
|
|
|
|
minute: "%H:%M", |
|
|
|
|
|
|
|
hour: "%H:%M", |
|
|
|
|
|
|
|
day: "%d.%m.%y", |
|
|
|
|
|
|
|
week: "%m/%d", |
|
|
|
|
|
|
|
month: "%b '%y", |
|
|
|
|
|
|
|
year: "%Y" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
gridLineWidth: 1, |
|
|
|
|
|
|
|
gridLineColor: "#e6e6e6" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
yAxis: { |
|
|
|
|
|
|
|
title: { |
|
|
|
|
|
|
|
text: " Pool Hash Rate", |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
color: "#000" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
labels: { |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
color: "#000" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
gridLineWidth: 1, |
|
|
|
|
|
|
|
gridLineColor: "#e6e6e6" |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
plotLines: [{ |
|
|
|
|
|
|
|
value: 0, |
|
|
|
|
|
|
|
width: 1, |
|
|
|
|
|
|
|
color: "#000" |
|
|
|
|
|
|
|
}], |
|
|
|
|
|
|
|
legend: { |
|
|
|
|
|
|
|
enabled: false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
tooltip: { |
|
|
|
|
|
|
|
formatter: function() { |
|
|
|
|
|
|
|
function scale(v) { |
|
|
|
|
|
|
|
var f = v; |
|
|
|
|
|
|
|
var units = ['', 'K', 'M', 'G', 'T']; |
|
|
|
|
|
|
|
for (var i = 0; i < 5 && f > 1000; i++) { |
|
|
|
|
|
|
|
f /= 1000; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return f.toFixed(2) + ' ' + units[i]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var h = scale(this.point.y); |
|
|
|
|
|
|
|
|
|
|
|
cachedLogin: Ember.computed("login", { |
|
|
|
return "<b>" + this.point.d + "</b><br />" + |
|
|
|
get() { |
|
|
|
"<b>Pool Hashrate " + h + "H/s</b>" |
|
|
|
return this.get("login") || Ember.$.cookie("login"); |
|
|
|
}, |
|
|
|
}, |
|
|
|
useHTML: true |
|
|
|
set(key, value) { |
|
|
|
}, |
|
|
|
Ember.$.cookie("login", value); |
|
|
|
exporting: { |
|
|
|
this.set("model.login", value); |
|
|
|
enabled: false |
|
|
|
return value; |
|
|
|
}, |
|
|
|
}, |
|
|
|
plotOptions: { |
|
|
|
|
|
|
|
line: { |
|
|
|
|
|
|
|
pointInterval: 5 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
pointInterval:10 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
series: [{ |
|
|
|
|
|
|
|
color: "#1994b8", |
|
|
|
|
|
|
|
name: "Hashrate", |
|
|
|
|
|
|
|
shadow: true, |
|
|
|
|
|
|
|
data: function() { |
|
|
|
|
|
|
|
var a = []; |
|
|
|
|
|
|
|
if (null != t) { |
|
|
|
|
|
|
|
t.forEach(function(d) { |
|
|
|
|
|
|
|
var x = new Date(1000 * d.x); |
|
|
|
|
|
|
|
var l = x.toLocaleString(); |
|
|
|
|
|
|
|
var y = d.y; |
|
|
|
|
|
|
|
a.push({x: x, y: y, d: l}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var l = now.toLocaleString(); |
|
|
|
|
|
|
|
var y = e.getWithDefault("model.hashrate"); |
|
|
|
|
|
|
|
var last = {x: now, y: y, d: l}; |
|
|
|
|
|
|
|
var interval = e.get('config.highcharts.main.interval') || 60000; |
|
|
|
|
|
|
|
if (a.length > 0 && now - a[a.length - 1].x > interval) { |
|
|
|
|
|
|
|
a.push(last); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return a; |
|
|
|
|
|
|
|
}() |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
a.title.text = this.getWithDefault('config.highcharts.main.title', ""); |
|
|
|
|
|
|
|
a.yAxis.title.text = this.getWithDefault('config.highcharts.main.ytitle', "Pool Hashrate"); |
|
|
|
|
|
|
|
a.chart.height = this.getWithDefault('config.highcharts.main.height', 300); |
|
|
|
|
|
|
|
a.chart.type = this.getWithDefault('config.highcharts.main.type', 'spline'); |
|
|
|
|
|
|
|
a.chart.backgroundColor = this.getWithDefault('config.highcharts.main.backgroundColor', "rgba(255, 255, 255, 0.1)"); |
|
|
|
|
|
|
|
a.xAxis.labels.style.color = this.getWithDefault('config.highcharts.main.labelColor', "#000"); |
|
|
|
|
|
|
|
a.yAxis.labels.style.color = this.getWithDefault('config.highcharts.main.labelColor', "#000"); |
|
|
|
|
|
|
|
a.yAxis.title.style.color = this.getWithDefault('config.highcharts.main.labelColor', "#000"); |
|
|
|
|
|
|
|
a.xAxis.gridLineColor = this.getWithDefault('config.highcharts.main.gridLineColor', "#e6e6e6"); |
|
|
|
|
|
|
|
a.yAxis.gridLineColor = this.getWithDefault('config.highcharts.main.gridLineColor', "#e6e6e6"); |
|
|
|
|
|
|
|
a.xAxis.gridLineWidth = this.getWithDefault('config.highcharts.main.gridLineWidthX', "0"); |
|
|
|
|
|
|
|
a.yAxis.gridLineWidth = this.getWithDefault('config.highcharts.main.gridLineWidthY', "1"); |
|
|
|
|
|
|
|
a.xAxis.lineColor = this.getWithDefault('config.highcharts.main.lineColor', "#ccd6eb"); |
|
|
|
|
|
|
|
a.yAxis.lineColor = this.getWithDefault('config.highcharts.main.lineColor', "#ccd6eb"); |
|
|
|
|
|
|
|
a.xAxis.tickColor = this.getWithDefault('config.highcharts.main.tickColor', "#ccd6eb"); |
|
|
|
|
|
|
|
a.yAxis.tickColor = this.getWithDefault('config.highcharts.main.tickColor', "#ccd6eb"); |
|
|
|
|
|
|
|
return a; |
|
|
|
|
|
|
|
} |
|
|
|
}), |
|
|
|
}), |
|
|
|
|
|
|
|
|
|
|
|
chartOptions: Ember.computed("model.hashrate", "model.poolCharts", "model.netCharts", { |
|
|
|
chartDiff: Ember.computed("model.hashrate", { |
|
|
|
get() { |
|
|
|
get() { |
|
|
|
var now = new Date(); |
|
|
|
var now = new Date(); |
|
|
|
var e = this, |
|
|
|
var e = this, |
|
|
|
t = e.getWithDefault("model.poolCharts", []), |
|
|
|
t = e.getWithDefault("stats.model.netCharts"), |
|
|
|
netCharts = e.getWithDefault("model.netCharts", []), |
|
|
|
|
|
|
|
a = { |
|
|
|
a = { |
|
|
|
chart: { |
|
|
|
chart: { |
|
|
|
backgroundColor: "rgba(48, 97, 63, 0.0) ", |
|
|
|
backgroundColor: "rgba(255, 255, 255, 0.1)", |
|
|
|
type: "areaspline", |
|
|
|
type: "spline", |
|
|
|
height: 270, |
|
|
|
height: 300, |
|
|
|
ignoreHiddenSeries: !1, |
|
|
|
marginRight: 10, |
|
|
|
events: { |
|
|
|
events: { |
|
|
|
load: function () { |
|
|
|
load: function() { |
|
|
|
var self = this; |
|
|
|
var self = this; |
|
|
|
|
|
|
|
var chartInterval = setInterval(function() { |
|
|
|
var chartInterval = setInterval(function () { |
|
|
|
if (!self.series) { |
|
|
|
var series = self.series; |
|
|
|
|
|
|
|
if (!series) { |
|
|
|
|
|
|
|
clearInterval(chartInterval); |
|
|
|
clearInterval(chartInterval); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var series = self.series[0]; |
|
|
|
t = e.getWithDefault("model.poolCharts", []); |
|
|
|
|
|
|
|
netCharts = e.getWithDefault("model.netCharts", []); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Hashrate chart
|
|
|
|
|
|
|
|
var hashData = []; |
|
|
|
|
|
|
|
t.forEach(function (entry) { |
|
|
|
|
|
|
|
var x = new Date(1000 * entry.x); |
|
|
|
|
|
|
|
var l = x.toLocaleString(); |
|
|
|
|
|
|
|
var y = entry.y; |
|
|
|
|
|
|
|
hashData.push({ x: x, y: y, d: l }); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Point for now
|
|
|
|
|
|
|
|
var now = new Date(); |
|
|
|
var now = new Date(); |
|
|
|
var l = now.toLocaleString(); |
|
|
|
|
|
|
|
var y = e.getWithDefault("model.hashrate"); |
|
|
|
|
|
|
|
var lastHash = { x: now, y: y, d: l }; |
|
|
|
|
|
|
|
{ hashData.push(lastHash); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Network Difficulty chart
|
|
|
|
|
|
|
|
var netDiffData = []; |
|
|
|
|
|
|
|
netCharts.forEach(function (entry) { |
|
|
|
|
|
|
|
var x = new Date(1000 * entry.x); |
|
|
|
|
|
|
|
var l = x.toLocaleString(); |
|
|
|
|
|
|
|
var y = entry.y; |
|
|
|
|
|
|
|
netDiffData.push({ x: x, y: y, d: l }); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
series[0].setData(hashData, true, {}, true); |
|
|
|
var shift = false; |
|
|
|
series[1].setData(netDiffData, true, {}, true); |
|
|
|
// partially update chart
|
|
|
|
|
|
|
|
if (now - series.data[0].x > 18*60*60*1000) { |
|
|
|
}, 88 * 1000); |
|
|
|
// show 18 hours ~ 15(min) * 74(points) ~ poolChartsNum: 74, poolChars: "0 */15 ..."
|
|
|
|
}, |
|
|
|
shift = true; |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
// check latest added temporary point and remove tempory added point for less than 5 minutes
|
|
|
|
|
|
|
|
if (series.data.length > 1 && series.data[series.data.length - 1].x - series.data[series.data.length - 2].x < 5*60*1000) { |
|
|
|
|
|
|
|
series.removePoint(series.data.length - 1, false, false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var x = now, y = e.getWithDefault("stats.model.netCharts"); |
|
|
|
|
|
|
|
var d = x.toLocaleString(); |
|
|
|
|
|
|
|
series.addPoint({x: x, y: y, d:d}, true, shift); |
|
|
|
|
|
|
|
}, e.get('config.highcharts.main.interval') || 60000); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
title: { |
|
|
|
title: { |
|
|
|
text: '<b>Ethereum Classic - PPLNS </b>', |
|
|
|
text: "Our pool's hashrate" |
|
|
|
align: 'center', |
|
|
|
|
|
|
|
x: 0, |
|
|
|
|
|
|
|
y: 15, |
|
|
|
|
|
|
|
useHTML: false, |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
color: "rgba(0,0,0,0.76)", |
|
|
|
|
|
|
|
fontSize: '15px', |
|
|
|
|
|
|
|
fontFamily: 'Arial', |
|
|
|
|
|
|
|
fontWeight: '400' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
xAxis: { |
|
|
|
xAxis: { |
|
|
|
ordinal: false, |
|
|
|
|
|
|
|
gridLineWidth: 1, |
|
|
|
|
|
|
|
type: "datetime", |
|
|
|
|
|
|
|
labels: { |
|
|
|
labels: { |
|
|
|
style: { |
|
|
|
style: { |
|
|
|
color: "#000", |
|
|
|
color: "#000" |
|
|
|
}, |
|
|
|
} |
|
|
|
formatter: function () { |
|
|
|
|
|
|
|
return formatDate(this.value, "hours:minutes"); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
ordinal: false, |
|
|
|
yAxis: [ |
|
|
|
type: "datetime", |
|
|
|
{ |
|
|
|
dateTimeLabelFormats: { |
|
|
|
index: 0, |
|
|
|
millisecond: "%H:%M:%S", |
|
|
|
tickAmount: 4, |
|
|
|
//second: "%H:%M:%S",
|
|
|
|
title: { |
|
|
|
second: "%H:%M", |
|
|
|
text: "Pool Hashrate", |
|
|
|
minute: "%H:%M", |
|
|
|
style: { |
|
|
|
hour: "%H:%M", |
|
|
|
color: "#32e400", |
|
|
|
day: "%d.%m.%y", |
|
|
|
}, |
|
|
|
week: "%m/%d", |
|
|
|
}, |
|
|
|
month: "%b '%y", |
|
|
|
min: 0, |
|
|
|
year: "%Y" |
|
|
|
labels: { |
|
|
|
|
|
|
|
enabled: true, |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
color: "#000", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
formatter: function () { |
|
|
|
|
|
|
|
return formatNumber(this.value); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
gridLineWidth: 1, |
|
|
|
index: 1, |
|
|
|
gridLineColor: "#e6e6e6" |
|
|
|
tickAmount: 4, |
|
|
|
}, |
|
|
|
title: { |
|
|
|
yAxis: { |
|
|
|
text: "NETWORK DIFFICULTY", |
|
|
|
title: { |
|
|
|
style: { |
|
|
|
text: " Pool Hash Rate", |
|
|
|
color: "#007BFF", |
|
|
|
style: { |
|
|
|
}, |
|
|
|
color: "#000" |
|
|
|
}, |
|
|
|
} |
|
|
|
min: 0, |
|
|
|
|
|
|
|
labels: { |
|
|
|
|
|
|
|
enabled: true, |
|
|
|
|
|
|
|
style: { |
|
|
|
|
|
|
|
color: "#000", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
formatter: function () { |
|
|
|
|
|
|
|
return formatNumber(this.value); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
opposite: true, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
labels: { |
|
|
|
plotOptions: { |
|
|
|
style: { |
|
|
|
areaspline: { |
|
|
|
color: "#000" |
|
|
|
marker: { |
|
|
|
} |
|
|
|
enabled: false, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
gridLineWidth: 1, |
|
|
|
|
|
|
|
gridLineColor: "#e6e6e6" |
|
|
|
}, |
|
|
|
}, |
|
|
|
plotLines: [ |
|
|
|
plotLines: [{ |
|
|
|
{ |
|
|
|
value: 0, |
|
|
|
value: 0, |
|
|
|
width: 1, |
|
|
|
width: 1, |
|
|
|
color: "#000" |
|
|
|
color: "#000", |
|
|
|
}], |
|
|
|
}, |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
legend: { |
|
|
|
legend: { |
|
|
|
symbolRadius: 4, |
|
|
|
enabled: false |
|
|
|
borderWidth: 1, |
|
|
|
|
|
|
|
itemStyle: { |
|
|
|
|
|
|
|
color: "rgba(0,0,0,0.76)", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
itemHoverStyle: { |
|
|
|
|
|
|
|
color: "#000000", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
itemHiddenStyle: { |
|
|
|
|
|
|
|
color: "#A8A2A2", |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
tooltip: { |
|
|
|
tooltip: { |
|
|
|
borderRadius: 7, |
|
|
|
formatter: function() { |
|
|
|
borderWidth: 1, |
|
|
|
function scale(v) { |
|
|
|
shared: false, |
|
|
|
var f = v; |
|
|
|
headerFormat: "", |
|
|
|
var units = ['', 'K', 'M', 'G', 'T', 'P']; |
|
|
|
shared: false, |
|
|
|
for (var i = 0; i < 5 && f > 1000; i++) { |
|
|
|
headerFormat: "", |
|
|
|
f /= 1000; |
|
|
|
}, |
|
|
|
|
|
|
|
exporting: { |
|
|
|
|
|
|
|
enabled: false, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
series: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
yAxis: 0, |
|
|
|
|
|
|
|
name: "Pool Hashrate", |
|
|
|
|
|
|
|
fillColor: "rgba(49, 227, 0, 0.22)", |
|
|
|
|
|
|
|
color: "#32e400", |
|
|
|
|
|
|
|
tooltip: { |
|
|
|
|
|
|
|
pointFormatter: function () { |
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
formatDate(this.x, "day.month.year hours:minutes") + |
|
|
|
|
|
|
|
"<br><b>Pool Hashrate: " + |
|
|
|
|
|
|
|
formatHashrate(this.y, true) + |
|
|
|
|
|
|
|
"</b>" |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
states: { |
|
|
|
|
|
|
|
inactive: { |
|
|
|
|
|
|
|
opacity: 0.1, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
data: function () { |
|
|
|
|
|
|
|
var hashData = []; |
|
|
|
|
|
|
|
if (null != t) { |
|
|
|
|
|
|
|
t.forEach(function (entry) { |
|
|
|
|
|
|
|
var x = new Date(1000 * entry.x); |
|
|
|
|
|
|
|
var l = x.toLocaleString(); |
|
|
|
|
|
|
|
var y = entry.y; |
|
|
|
|
|
|
|
hashData.push({ x: x, y: y, d: l }); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return f.toFixed(2) + ' ' + units[i]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var h = scale(this.point.y); |
|
|
|
|
|
|
|
|
|
|
|
var l = now.toLocaleString(); |
|
|
|
return "<b>" + this.point.d + "</b><br />" + |
|
|
|
var y = e.getWithDefault("model.hashrate"); |
|
|
|
"<b>Network Difficulty " + h + "H/s</b>" |
|
|
|
var lastHash = { x: now, y: y, d: l }; |
|
|
|
|
|
|
|
{ hashData.push(lastHash); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return hashData; |
|
|
|
|
|
|
|
}() |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
useHTML: true |
|
|
|
yAxis: 1, |
|
|
|
}, |
|
|
|
name: "NETWORK DIFFICULTY", |
|
|
|
exporting: { |
|
|
|
fillColor: "rgba(212, 175, 55, 0.35)", |
|
|
|
enabled: false |
|
|
|
color: "#007BFF", |
|
|
|
}, |
|
|
|
tooltip: { |
|
|
|
plotOptions: { |
|
|
|
pointFormatter: function () { |
|
|
|
line: { |
|
|
|
return ( |
|
|
|
pointInterval: 5 |
|
|
|
formatDate(this.x, "day.month.year hours:minutes") + |
|
|
|
|
|
|
|
"<br><b>NETWORK DIFFICULTY: " + |
|
|
|
|
|
|
|
formatNumber(this.y) + |
|
|
|
|
|
|
|
"</b>" |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
states: { |
|
|
|
|
|
|
|
inactive: { |
|
|
|
|
|
|
|
opacity: 0.1, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
data: function () { |
|
|
|
|
|
|
|
var netDiffData = []; |
|
|
|
|
|
|
|
if (null != netCharts) { |
|
|
|
|
|
|
|
netCharts.forEach(function (entry) { |
|
|
|
|
|
|
|
var x = new Date(1000 * entry.x); |
|
|
|
|
|
|
|
var l = x.toLocaleString(); |
|
|
|
|
|
|
|
var y = entry.y; |
|
|
|
|
|
|
|
netDiffData.push({ x: x, y: y, d: l }); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return netDiffData; |
|
|
|
|
|
|
|
}() |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
pointStart: Date.UTC(2022, 0, 1), |
|
|
|
|
|
|
|
pointInterval: 24 * 3600 * 1000 // one day
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
series: [{ |
|
|
|
|
|
|
|
color: "#e99002", |
|
|
|
|
|
|
|
name: "Hashrate", |
|
|
|
|
|
|
|
shadow: true, |
|
|
|
|
|
|
|
data: function() { |
|
|
|
|
|
|
|
var a = []; |
|
|
|
|
|
|
|
if (null != t) { |
|
|
|
|
|
|
|
t.forEach(function(d) { |
|
|
|
|
|
|
|
var x = new Date(1000 * d.x); |
|
|
|
|
|
|
|
var l = x.toLocaleString(); |
|
|
|
|
|
|
|
var y = d.y; |
|
|
|
|
|
|
|
a.push({x: x, y: y, d: l}); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var l = now.toLocaleString(); |
|
|
|
|
|
|
|
var y = e.getWithDefault("stats.model.netCharts"); |
|
|
|
|
|
|
|
var last = {x: now, y: y, d: l}; |
|
|
|
|
|
|
|
var interval = e.get('config.highcharts.main.interval') || 60000; |
|
|
|
|
|
|
|
if (a.length > 0 && now - a[a.length - 1].x > interval) { |
|
|
|
|
|
|
|
a.push(last); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return a; |
|
|
|
|
|
|
|
}() |
|
|
|
|
|
|
|
}] |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
a.title.text = this.getWithDefault('config.highcharts.main.title', ""); |
|
|
|
|
|
|
|
a.yAxis.title.text = this.getWithDefault('config.highcharts.main.ytitle', "Pool Hashrate"); |
|
|
|
|
|
|
|
a.chart.height = this.getWithDefault('config.highcharts.main.height', 300); |
|
|
|
|
|
|
|
a.chart.type = this.getWithDefault('config.highcharts.main.type', 'spline'); |
|
|
|
|
|
|
|
a.chart.backgroundColor = this.getWithDefault('config.highcharts.main.backgroundColor', "rgba(255, 255, 255, 0.1)"); |
|
|
|
|
|
|
|
a.xAxis.labels.style.color = this.getWithDefault('config.highcharts.main.labelColor', "#000"); |
|
|
|
|
|
|
|
a.yAxis.labels.style.color = this.getWithDefault('config.highcharts.main.labelColor', "#000"); |
|
|
|
|
|
|
|
a.yAxis.title.style.color = this.getWithDefault('config.highcharts.main.labelColor', "#000"); |
|
|
|
|
|
|
|
a.xAxis.gridLineColor = this.getWithDefault('config.highcharts.main.gridLineColor', "#e6e6e6"); |
|
|
|
|
|
|
|
a.yAxis.gridLineColor = this.getWithDefault('config.highcharts.main.gridLineColor', "#e6e6e6"); |
|
|
|
|
|
|
|
a.xAxis.gridLineWidth = this.getWithDefault('config.highcharts.main.gridLineWidthX', "0"); |
|
|
|
|
|
|
|
a.yAxis.gridLineWidth = this.getWithDefault('config.highcharts.main.gridLineWidthY', "1"); |
|
|
|
|
|
|
|
a.xAxis.lineColor = this.getWithDefault('config.highcharts.main.lineColor', "#ccd6eb"); |
|
|
|
|
|
|
|
a.yAxis.lineColor = this.getWithDefault('config.highcharts.main.lineColor', "#ccd6eb"); |
|
|
|
|
|
|
|
a.xAxis.tickColor = this.getWithDefault('config.highcharts.main.tickColor', "#ccd6eb"); |
|
|
|
|
|
|
|
a.yAxis.tickColor = this.getWithDefault('config.highcharts.main.tickColor', "#ccd6eb"); |
|
|
|
|
|
|
|
|
|
|
|
return a; |
|
|
|
return a; |
|
|
|
}, |
|
|
|
} |
|
|
|
}), |
|
|
|
}), |
|
|
|
|
|
|
|
|
|
|
|
dag: Ember.computed("stats", "model", { |
|
|
|
dag: Ember.computed("stats", "model", { |
|
|
|
get() { |
|
|
|
get() { |
|
|
|
var percent = (this.get("epoch") * 8192) / 1024 / 1024 + 1; |
|
|
|
var percent = (this.get("epoch") * 8192) / 1024 / 1024 + 1; |
|
|
|
@ -309,7 +342,6 @@ export default Ember.Controller.extend({ |
|
|
|
return percent; |
|
|
|
return percent; |
|
|
|
}, |
|
|
|
}, |
|
|
|
}), |
|
|
|
}), |
|
|
|
|
|
|
|
|
|
|
|
epoch: Ember.computed("model.stats", { |
|
|
|
epoch: Ember.computed("model.stats", { |
|
|
|
get() { |
|
|
|
get() { |
|
|
|
return parseInt(this.get("applicationController.height") / 30000); |
|
|
|
return parseInt(this.get("applicationController.height") / 30000); |
|
|
|
|