Split cache and storage nodes in admin panel

This commit is contained in:
2023-09-13 15:48:56 +02:00
parent 91144ed14b
commit 0d15b89fe1
3 changed files with 75 additions and 40 deletions

View File

@@ -4,6 +4,7 @@ import { formatDataVolume, formatThousands, formatDate, formatNumber, formatDura
import Chart from "../util/Chart.svelte";
import { color_by_name } from "../util/Util.svelte";
import ServerDiagnostics from "./ServerDiagnostics.svelte";
import PeerTable from "./PeerTable.svelte";
let graphViews
let graphBandwidth
@@ -208,45 +209,13 @@ onDestroy(() => {
<td>{formatNumber(status.db_latency / 1000, 3)} ms</td>
</tr>
</table>
<h3>Pixelstore peers</h3>
<div class="table_scroll">
<table>
<thead>
<tr>
<td>Address</td>
<td>Role</td>
<td>Err</td>
<td>1m</td>
<td>5m</td>
<td>15m</td>
<td>Ping</td>
<td>Netload</td>
<td>Free</td>
<td>Min free</td>
</tr>
</thead>
<tbody>
{#each status.peers as peer}
<tr style="text-align: left; border: none;"
class:highlight_red={peer.free_space < peer.min_free_space / 2 || !peer.reachable}
class:highlight_yellow={peer.free_space < peer.min_free_space}
class:highlight_green={peer.reachable}
>
<td>{peer.address}</td>
<td>{peer.role}</td>
<td>{peer.unreachable_count}</td>
<td>{peer.load_1_min.toFixed(1)}</td>
<td>{peer.load_5_min.toFixed(1)}</td>
<td>{peer.load_15_min.toFixed(1)}</td>
<td>{(peer.latency/1000).toPrecision(3)}</td>
<td>{formatDataVolume(peer.avg_network_load, 4)}/s</td>
<td>{formatDataVolume(peer.free_space, 4)}</td>
<td>{formatDataVolume(peer.min_free_space, 3)}</td>
</tr>
{/each}
</tbody>
</table>
</div>
<h3>Cache nodes</h3>
<PeerTable peers={status.peers.reduce((acc, val) => {if (val.role === "cache") {acc.push(val)}; return acc}, [])}/>
<h3>Storage nodes</h3>
<PeerTable peers={status.peers.reduce((acc, val) => {if (val.role === "storage") {acc.push(val)}; return acc}, [])}/>
<h3>Pixelstore stats</h3>
<table>
<thead>

View File

@@ -0,0 +1,66 @@
<script>
import { formatDataVolume } from "../util/Formatting.svelte";
export let peers = [];
</script>
<div class="table_scroll">
<table>
<thead>
<tr>
<td>Address</td>
<td>Err</td>
<td>1m</td>
<td>5m</td>
<td>15m</td>
<td>Ping</td>
<td>Netload</td>
<td>Free</td>
<td>Min free</td>
</tr>
</thead>
<tbody>
{#each peers as peer}
<tr style="text-align: left; border: none;"
class:highlight_red={peer.free_space < peer.min_free_space / 2 || !peer.reachable}
class:highlight_yellow={peer.free_space < peer.min_free_space}
class:highlight_green={peer.reachable}
>
<td>{peer.address}</td>
<td>{peer.unreachable_count}</td>
<td>{peer.load_1_min.toFixed(1)}</td>
<td>{peer.load_5_min.toFixed(1)}</td>
<td>{peer.load_15_min.toFixed(1)}</td>
<td>{(peer.latency/1000).toPrecision(3)}</td>
<td>{formatDataVolume(peer.avg_network_load, 4)}/s</td>
<td>{formatDataVolume(peer.free_space, 4)}</td>
<td>{formatDataVolume(peer.min_free_space, 3)}</td>
</tr>
{/each}
<tr style="text-align: left;">
<td>Total ({peers.length})</td>
<td>{peers.reduce((acc, val) => acc += val.unreachable_count, 0)}</td>
<td>{peers.reduce((acc, val) => acc += val.load_1_min, 0).toFixed(1)}</td>
<td>{peers.reduce((acc, val) => acc += val.load_5_min, 0).toFixed(1)}</td>
<td>{peers.reduce((acc, val) => acc += val.load_15_min, 0).toFixed(1)}</td>
<td>{(peers.reduce((acc, val) => acc += val.latency, 0)/1000).toFixed(0)}</td>
<td>{formatDataVolume(peers.reduce((acc, val) => acc += val.avg_network_load, 0), 4)}/s</td>
<td>{formatDataVolume(peers.reduce((acc, val) => acc += val.free_space, 0), 4)}</td>
<td>{formatDataVolume(peers.reduce((acc, val) => acc += val.min_free_space, 0), 3)}</td>
</tr>
<tr style="text-align: left;">
<td>Average</td>
<td></td>
<td>{(peers.reduce((acc, val) => acc += val.load_1_min, 0) / peers.length).toFixed(1)}</td>
<td>{(peers.reduce((acc, val) => acc += val.load_5_min, 0) / peers.length).toFixed(1)}</td>
<td>{(peers.reduce((acc, val) => acc += val.load_15_min, 0) / peers.length).toFixed(1)}</td>
<td>{(peers.reduce((acc, val) => acc += val.latency, 0) / 1000 / peers.length).toFixed(0)}</td>
<td>{formatDataVolume(peers.reduce((acc, val) => acc += val.avg_network_load, 0) / peers.length, 4)}/s</td>
<td>{formatDataVolume(peers.reduce((acc, val) => acc += val.free_space, 0) / peers.length, 4)}</td>
<td>{formatDataVolume(peers.reduce((acc, val) => acc += val.min_free_space, 0) / peers.length, 3)}</td>
</tr>
</tbody>
</table>
</div>

View File

@@ -33,7 +33,7 @@ export let file = {
</p>
<ul>
<li>
Come back next week when your free transfer limit resets
Come back tomorrow when your free transfer limit resets
</li>
<li>
Download the file at a rate of {file.download_speed_limit/(1<<10)}