-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
348 lines (301 loc) · 12.1 KB
/
index.php
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
<?php
ini_set('error_reporting', 0);
/**
* Claymore-PhoenixMiner-Web-Stats
*
* Simple PHP page to connect to any number of Claymore and PhoenixMiner miners and view hashrates, GPU temps, and fan speeds.
*
* @package claymore-phoenixminer-web-stats
* @version 1.0
* @author James D ([email protected])
* @copyright Copyright (c) 2018 James D.
* @license This file is part of claymore-phoenixminer-web-stats - free software licensed under the GNU General Public License version 3
* @link https://github.com/jimok82/claymore-phoenixminer-web-stats
*/
// ------------------------------------------------------------------------
require_once 'inc\conf.php';
require_once 'inc\json_parser.class.php';
$parser = new json_parser();
$parser->server_list = $server_list;
$parser->wait_timeout = $wait_timeout;
$parser->gpu_temp_yellow = $gpu_temp_yellow;
$parser->gpu_temp_red = $gpu_temp_red;
$parser->gpu_fan_yellow = $gpu_fan_yellow;
$parser->gpu_fan_red = $gpu_fan_red;
$parser->parse_all_json_rpc_calls();
file_put_contents('uid.txt',hash('sha1',gethostname()));
?>
<!DOCTYPE html>
<html lang='en' class=''>
<head>
<title><?= $parser->miner_count ?> Miners: <?= $parser->global_hashrate ?> MH/s</title>
<meta charset='UTF-8'>
<meta name="robots" content="noindex">
<meta http-equiv="refresh" content="150">
<link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css'>
<style class="cp-pen-styles">
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);
/* --------------------CSS----------------- */
.box span {
font-family: 'Lato', sans-serif;
font-weight: 300;
font-size: 20px;
position: absolute;
}
.box span:nth-child(2) {
top: 2px;
left: 125px;
}
.box span:nth-child(7) {
top: 85px;
left: 125px;
}
.box span:nth-child(12) {
top: 165px;
left: 125px;
}
.server {
width: 110px;
height: 30px;
background: #3a3a3a;
border-radius: 1px;
}
.server ul {
margin: 0;
padding: 0;
list-style: none;
}
.server:first-child ul li {
width: 6px;
height: 6px;
float: left;
margin-left: 10px;
margin-top: 12px;
background: rgba(149, 244, 118, 0.6);
}
.server ul li:first-child { -webkit-animation: pattern1 0.50s linear infinite; }
.server ul li:nth-child(2) { -webkit-animation: pattern1 0.50s 0.05s linear infinite; }
.server ul li:nth-child(3) { -webkit-animation: pattern1 0.50s 0.10s linear infinite; }
.server ul li:nth-child(4) { -webkit-animation: pattern1 0.50s 0.15s linear infinite; }
.server ul li:nth-child(5) { -webkit-animation: pattern1 0.50s 0.20s linear infinite; }
.server ul li:last-child { -webkit-animation: pattern1 0.50s 0.25s linear infinite; }
@-webkit-keyframes pattern1 {
0% {
background: rgba(149, 244, 118, 0.6);
}
100% {
background: rgba(149, 244, 118, 1);
}
}
.warning ul li {
width: 6px;
height: 6px;
float: left;
margin-left: 10px;
margin-top: 12px;
background: rgba(245, 190, 0, 0.6);
}
/* .warning ul li:first-child { -webkit-animation: pattern2 0.14s linear infinite; }
.warning ul li:nth-child(2) { -webkit-animation: pattern2 0.14s 0.02s linear infinite; }
.warning ul li:last-child { -webkit-animation: pattern2 0.14s 0.05s linear infinite; } */
.warning ul li:first-child { -webkit-animation: pattern2 0.50s linear infinite; }
.warning ul li:nth-child(2) { -webkit-animation: pattern2 0.50s 0.05s linear infinite; }
.warning ul li:nth-child(3) { -webkit-animation: pattern2 0.50s 0.10s linear infinite; }
.warning ul li:nth-child(4) { -webkit-animation: pattern2 0.50s 0.15s linear infinite; }
.warning ul li:nth-child(5) { -webkit-animation: pattern2 0.50s 0.20s linear infinite; }
.warning ul li:last-child { -webkit-animation: pattern2 0.50s 0.25s linear infinite; }
@-webkit-keyframes pattern2 {
0% {
background: rgba(245, 190, 0, 0.6);
}
100% {
background: rgba(245, 190, 0, 1);
}
}
.error ul li {
width: 6px;
height: 6px;
float: left;
margin-left: 10px;
margin-top: 12px;
background: rgba(236, 69, 62, 0.6);
}
/* .error ul li:first-child { -webkit-animation: pattern3 0.9s linear infinite; }
.error ul li:nth-child(2) { -webkit-animation: pattern3 0.9s linear infinite; }
.error ul li:last-child { -webkit-animation: pattern3 0.9s linear infinite; } */
.error ul li:first-child { -webkit-animation: pattern3 0.50s linear infinite; }
.error ul li:nth-child(2) { -webkit-animation: pattern3 0.50s 0.05s linear infinite; }
.error ul li:nth-child(3) { -webkit-animation: pattern3 0.50s 0.10s linear infinite; }
.error ul li:nth-child(4) { -webkit-animation: pattern3 0.50s 0.15s linear infinite; }
.error ul li:nth-child(5) { -webkit-animation: pattern3 0.50s 0.20s linear infinite; }
.error ul li:last-child { -webkit-animation: pattern3 0.50s 0.25s linear infinite; }
@-webkit-keyframes pattern3 {
0% {
background: rgba(236, 69, 62, 0.6);
}
80% {
background: rgba(236, 69, 62, 0.6);
}
100% {
background: rgba(236, 69, 62, 1);
}
}
.box {
background: linear-gradient(#23ba58, #1d8241);
position: relative;
display: inline-block;
border-radius: 5px;
width: 480px;
/* height: 335px; */
vertical-align: top;
margin-bottom: 10px;
text-align: left;
}
.box-down { background: linear-gradient(#9e3935, #993259); }
.box__header {
padding: 10px 25px;
position: relative;
display: inline-block;
}
.box__body { padding: 0 25px; }
/* STATS */
.stats {
color: #fff;
position: relative;
padding-bottom: 18px;
}
.stats__amount {
font-size: 15px;
font-weight: bold;
line-height: 1.1;
}
.stats__name {
font-size: 14px;
font-weight: bold;
line-height: 1.1;
}
.stats__caption {
font-size: 18px;
}
.stats__change {
position: absolute;
top: 6px;
right: 0;
text-align: right;
}
.stats__value { font-size: 18px; }
.stats__period {
font-size: 18px;
font-weight: bold;
}
.stats__value--positive {
color: #AEDC6F;
font-weight: bold;
}
.stats__value--negative {
color: #ee8b8f;
font-weight: bold;
}
.yellow-alert {
color: #d3b715;
font-weight: bold;
}
.red-alert {
color: #ee8b8f;
font-weight: bold;
}
.stats--main .stats__amount { font-size: 40px; }
.stats__name { font-size: 34px; }
</style>
</head>
<body style="background-color:#222;">
<center>
<br>
<br>
<br>
<br>
<div class="stats stats--main">
<div class="stats__amount">Global Hashrate: <?= $parser->global_hashrate ?> MH/s</div>
</div>
<?php
foreach ($parser->miner_data_results as $name => $miner) { ?>
<div class="box <?php if ($parser->miner_status->{$name} != 1) { ?> box-down <?php } ?>">
<div class="box__header">
<?php if ($parser->miner_status->{$name} == 1) { ?>
<div class="server">
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
<?php } else { ?>
<div class="server error">
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</div>
<?php } ?>
</div>
<div class="box__body">
<div class="stats stats--main">
<div class="stats__name"><?= gethostname(); ?> (<?= $miner->coin ?>)</div>
<div class="stats__caption">Miner: <?= $miner->version ?></div>
<div class="stats__change">
<div class="stats__value stats__value--positive">Uptime</div>
<div class="stats__period"><?= $miner->uptime ?></div>
</div>
</div>
<div class="stats">
<div class="stats__amount">Pool</div>
<div class="stats__caption"><?= $miner->pool ?></div>
</div>
<div class="stats">
<div class="stats__amount">Shares (Submitted / Stale / Rejected)</div>
<div class="stats__caption">
<div class="stats__value--positive" style="display: inline;"><?= number_format($miner->stats->shares, 0) ?></div>
/ <?= number_format($miner->stats->stale, 0) ?> /
<div class="stats__value--negative" style="display: inline;"><?= number_format($miner->stats->rejected, 0) ?></div>
</div>
</div>
<div class="stats">
<div class="stats__amount">Video Card Stats</div>
<div class="stats__caption">
<table width="100%">
<thead>
<tr>
<th class="stats__amount">Card</th>
<th class="stats__amount">Hashrate</th>
<th class="stats__amount">GPU Temp</th>
<th class="stats__amount">Fan %</th>
</tr>
</thead>
<tbody>
<?php if(isset($miner->card_stats)){ ?>
<?php foreach ($miner->card_stats as $key => $stat) { ?>
<tr>
<th><?= $stat->name; ?></th>
<th><?= number_format($stat->hashrate, 2) ?> MH/s</th>
<th><?= $parser->show_temp_warning($stat->temp, "° C") ?></th>
<th><?= $parser->show_fan_warning($stat->fan, "%") ?></th>
</tr>
<?php } ?>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php } ?>
</center>
</body>
</html>