-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.php
More file actions
157 lines (142 loc) · 3.56 KB
/
index.php
File metadata and controls
157 lines (142 loc) · 3.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
<script src="./js/js/highstock.js" type="text/javascript"></script>
<script type="text/javascript" src="./js/js/modules/exporting.js"></script>
<title>Stats</title>
<style type="text/css">
html, body {
height: 100%; /* make the percentage height on placeholder work */
}
.message {
padding-left: 50px;
font-size: smaller;
}
#donation {
font-size: smaller;
color: #A9A9A9;
}
</style>
</head>
<body>
<?php
include("config.php");
if ($cache == 0){
include("global_stats.php");
}
if ($cache == 1){
include("memcached.php");
}
?>
<center><div style="width: 95%;"><div id="container" style="width:1000px;height:600px"></div>
</div>
<?php if ($enable_donation_message == 1) {
echo $donation_message;
} ?></center>
<script type="text/javascript">
var chart1,
chart2; // globally available
$(document).ready(function() {
chart1 = new Highcharts.StockChart({
chart: {
renderTo: 'container',
type: 'line'
},
tooltip: {
formatter: function() {
var s = '<b>'+ Highcharts.dateFormat('%H:%M, %A, %b %e, %Y', this.x) +'</b>';
$.each(this.points, function(i, point) {
color = point.series.color;
if (this.series.name == 'Workers') {
s += '<br /><span style="font-weight: bold; color: '+color+'">'+this.series.name + ':' + '</span>'+ Math.round(point.y);
}
else if (this.series.name == "Buffer") {
s += '<br /><span style="font-weight: bold; color: '+color+'">'+this.series.name + ':' + '</span>'+ Math.round(point.y*1000)/1000 + ' BTC';
}
else if (this.series.name == 'Users') {
s += '<br /><span style="font-weight: bold; color: '+color+'">'+this.series.name + ':' + '</span>'+ Math.round(point.y);
}
else {
s += '<br /><span style="font-weight: bold; color: '+color+'">'+this.series.name + ':' + '</span>'+ Math.round(point.y*1000)/1000;
}
});
return s;
}
},
title: {
text: 'ArsBitcoin Mining Pool'
},
legend: {
align: 'center',
enabled: true,
verticalAlign: 'top',
y: 40
},
rangeSelector: {
enabled: 1,
selected: 1,
buttons: [{
type: 'day',
count: 1,
text: '1d'
}, {
type: 'day',
count: 3,
text: '3d'
},{
type: 'week',
count: 1,
text: '1w'
}, {
type: 'month',
count: 1,
text: '1m'
}, {
type: 'year',
count: 1,
text: '1y'
}],
},
plotOptions: {
series: {
marker: {
enabled: false
}
}
},
xAxis: {
type: 'datetime',
maxZoom: 1 * 24 * 3600000, // fourteen days
title: {
text: null
}
},
yAxis: {
title: {
text: 'value'
}
},
series: [{
name: 'Hashrate',
data: <?php echo $hashrate; ?>
}, {
name: 'Workers',
data: <?php echo $workers; ?>,
visible: false
}, {
name: 'Buffer',
data: <?php echo $buffer; ?>
}, {
name: 'Users',
data: <?php echo $users; ?>
},{
name: '3 hour average',
data: <?php echo $average; ?>,
color: '#00ff00'
}]
});
});
</script>
</body>
</html>