Files
nodeinfo/templates/index.html.tera
Arthur 0396f19fa6 Added elided hash
And a couple of bits cleaned up
2024-05-27 19:10:30 +01:00

165 lines
6.3 KiB
Plaintext

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>XMR Node Info</title>
<style>
.infocards {
display: flex;
flex-wrap: wrap;
}
.infocard {
margin: 20px;
}
p.subheading {
font-size: 80%;
}
p.restart {
font-weight: bold;
color: red;
}
.success {
font-weight: bold;
color: green;
}
.warning {
color: yellow;
}
.error {
color: red;
}
.node_data {
font-family: monospace, monospace;
}
table {
border: 2px solid;
}
thead {
}
th, td {
border: 1px solid;
padding: 7px;
}
</style>
</head>
<body>
<h1>Node Device Info</h1>
<div class="infocards">
<div class="infocard">
<h2>Sys Info</h2>
<p>Hostname: <span class="node_data">{{ system.hostname }}</span></p>
<p>Uptime: <span class="node_data">{{ system.uptime }}</span></p>
<p>OS: <span class="node_data">{{ system.operating_system }}</span></p>
<p>Average Load: <span class="node_data">{{ system.average_load.0 }} {{ system.average_load.1 }} {{ system.average_load.2 }}</span></p>
{% if system.restart_needed %}
<p class="restart">RESTART NEEDED</p>
{% endif %}
</div>
<div class="infocard">
<h2>HDD Info</h2>
{% for disk in system.disks %}
<h3 class="node_data">{{disk.name}}</h3>
<p class="subheading">Mounted at: <span class="node_data">{{disk.mount_point}}</span></p>
<p><span class="node_data">{{disk.available_space}}</span> of <span class="node_data">{{disk.total_space}}</span> available</p>
<progress class="diskspace" max="{{disk.total_space_bytes}}" value="{{disk.consumed_space_bytes}}"></progress>
{% if not loop.last %}
<hr>
{% endif %}
{% endfor %}
</div>
<div class="infocard">
<h2>Temperatures</h2>
{% for comp in system.components %}
<p class="temperature"><span class="node_data">{{ comp.name }}</span> - <span class="node_data">{{ comp.temperature }}°C</span></p>
{% if not loop.last %}
<hr>
{% endif %}
{% endfor %}
</div>
<div class="infocard">
<h2>RAM</h2>
<p><span class="node_data">{{ system.ram.used_memory_pretty }}</span> of <span class="node_data">{{ system.ram.total_memory_pretty }}</span> RAM current in use</p>
<progress class="ramspace" max="{{ system.ram.total_memory }}" value="{{ system.ram.used_memory }}"></progress>
<p><span class="node_data">{{ system.ram.used_swap_pretty }}</span> of <span class="node_data">{{ system.ram.total_swap_pretty }}</span> swap currently in use</p>
<progress class="ramspace" max="{{ system.ram.total_swap }}" value="{{ system.ram.used_swap }}"></progress>
</div>
<div class="infocard">
<h2>Network Interfaces</h2>
{% for network_if in system.network_ifs %}
<h3 class="node_data">{{ network_if.name }}</h3>
<p>Total Sent Today: <span class="node_data">{{ network_if.total_sent_today }}</span></p>
<p>Total Received Today: <span class="node_data">{{ network_if.total_received_today }}</span></p>
<p>Average Rate: <span class="node_data">{{ network_if.average_rate_today }}</span></p>
{% endfor %}
{% for network_if in system.network_ifs_errored %}
<h3 class="error">interface <span class="node_data">{{ network_if[0] }}</span> has an error</h3>
<p>Error: <span class="node_data">{{ network_if[1] }}</span></p>
{% endfor %}
</div>
</div>
<h1>Monerod Status</h1>
<div class="infocards">
<div class="infocard">
{% if node_info.synchronized %}
<p><span class="success">Synchronised</span> to {{ node_info.nettype }}</p>
{% else %}
<p><span class="warning">Synchronising</span> to {{ node_info.nettype }}</p>
{% endif %}
<p> Running version <span class="node_data">{{ node_info.version }}</span>
{% if node_info.update_available %}
<span class="warning">Which can be updated</span>
{% endif %}
</p>
<p>Monerod Time Up: <span class="node_data">{{ node_info.time_up_pretty }}</span></p>
</div>
<div class="infocard">
<p>Txs in pool: <span class="node_data">{{ node_info.tx_pool_size }}</span></p>
<p>Total Txs: <span class="node_data">{{ node_info.tx_count }}</span></p>
</div>
<div class="infocard">
<p>Incoming Connections: <span class="node_data">{{ node_info.incoming_connections_count }}</span></p>
<p>Outgoing Connections: <span class="node_data">{{ node_info.outgoing_connections_count }}</span></p>
<p>RPC Connections: <span class="node_data">{{ node_info.rpc_connections_count }}</span></p>
</div>
<div class="infocard">
<p>Blockheight: <span class="node_data">{{ node_info.height }}</span></p>
<p>Latest block hash: <span class="node_data">{{ node_info.top_block_hash_elided }}</span></p>
</div>
<div class="infocard">
<p>Free Space: <span class="node_data">{{ node_info.free_space_pretty }}</span></p>
<p>Database Size: <span class="node_data"> {{ node_info.db_size_pretty }}</span></p>
</div>
</div>
<h1>Latest 20 Blocks</h1>
<div>
<table>
<thead>
<tr>
<th scope="col">Height</th>
<th scope="col">Size (Bytes)</th>
<th scope="col">Transactions</th>
<th scope="col">Timestamp (UTC)</th>
<th scope="col">Hash</th>
</tr>
</thead>
<tbody>
{% for block in latest_twenty_blocks | reverse %}
<tr>
<th scope="row" class="node_data">{{ block.height }}</th>
<td class="node_data">{{ block.block_size }}</td>
<td class="node_data">{{ block.num_txes }}</td>
<td class="node_data">{{ block.timestamp_pretty }}</td>
<td class="node_data">{{ block.hash }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<hr>
{{__tera_context}}
</body>
</html>