mirror of https://github.com/SChernykh/p2pool
add miner stats to web server output
Signed-off-by: Florian Brandes <florian.brandes@posteo.de>pull/297/head
parent
36a6e8dcbe
commit
0db8dc2433
|
@ -60,6 +60,14 @@ def render():
|
||||||
network_stats = json.loads(reader.read())
|
network_stats = json.loads(reader.read())
|
||||||
with open("/data/local/stratum", "r") as reader:
|
with open("/data/local/stratum", "r") as reader:
|
||||||
local_stats = json.loads(reader.read())
|
local_stats = json.loads(reader.read())
|
||||||
|
workers = local_stats["workers"][:30] # limit workers output list
|
||||||
|
workers_concat = []
|
||||||
|
for w in workers:
|
||||||
|
w_list = w.split(",")
|
||||||
|
w_list[1] = humanfriendly.format_timespan(int(w_list[1]))
|
||||||
|
w_list[2] = human_numbers(int(w_list[2]))
|
||||||
|
w_list[3] = human_numbers(int(w_list[3]))
|
||||||
|
workers_concat.append(w_list)
|
||||||
return render_template(
|
return render_template(
|
||||||
"index.html",
|
"index.html",
|
||||||
my_bday=my_bday,
|
my_bday=my_bday,
|
||||||
|
@ -67,6 +75,7 @@ def render():
|
||||||
pool_stats=pool_stats,
|
pool_stats=pool_stats,
|
||||||
network_stats=network_stats,
|
network_stats=network_stats,
|
||||||
local_stats=local_stats,
|
local_stats=local_stats,
|
||||||
|
workers=workers_concat,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return render_template("oops.html", error=str(e))
|
return render_template("oops.html", error=str(e))
|
||||||
|
|
|
@ -64,6 +64,29 @@
|
||||||
<td>Block reward share</td>
|
<td>Block reward share</td>
|
||||||
<td>{{ local_stats["block_reward_share_percent"] }}%</td>
|
<td>{{ local_stats["block_reward_share_percent"] }}%</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Workers
|
||||||
|
<h6 class="card-subtitle text-muted" style="font-size:80%;">(note: limited to the first 30 workers)</h6>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<table style="font-size:65%;">
|
||||||
|
<tr>
|
||||||
|
<th>IP:Port</th>
|
||||||
|
<th>Uptime</th>
|
||||||
|
<th>Difficulty</th>
|
||||||
|
<th>Hashrate</th>
|
||||||
|
<th>Name</th>
|
||||||
|
</tr>
|
||||||
|
{% for w in workers %}
|
||||||
|
<tr>
|
||||||
|
{% for w_detail in w %}
|
||||||
|
<td>{{ w_detail }}</td>
|
||||||
|
{% endfor %}
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue