Split cache and storage nodes in admin panel
This commit is contained in:
@@ -4,6 +4,7 @@ import { formatDataVolume, formatThousands, formatDate, formatNumber, formatDura
|
|||||||
import Chart from "../util/Chart.svelte";
|
import Chart from "../util/Chart.svelte";
|
||||||
import { color_by_name } from "../util/Util.svelte";
|
import { color_by_name } from "../util/Util.svelte";
|
||||||
import ServerDiagnostics from "./ServerDiagnostics.svelte";
|
import ServerDiagnostics from "./ServerDiagnostics.svelte";
|
||||||
|
import PeerTable from "./PeerTable.svelte";
|
||||||
|
|
||||||
let graphViews
|
let graphViews
|
||||||
let graphBandwidth
|
let graphBandwidth
|
||||||
@@ -208,45 +209,13 @@ onDestroy(() => {
|
|||||||
<td>{formatNumber(status.db_latency / 1000, 3)} ms</td>
|
<td>{formatNumber(status.db_latency / 1000, 3)} ms</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<h3>Pixelstore peers</h3>
|
|
||||||
<div class="table_scroll">
|
<h3>Cache nodes</h3>
|
||||||
<table>
|
<PeerTable peers={status.peers.reduce((acc, val) => {if (val.role === "cache") {acc.push(val)}; return acc}, [])}/>
|
||||||
<thead>
|
|
||||||
<tr>
|
<h3>Storage nodes</h3>
|
||||||
<td>Address</td>
|
<PeerTable peers={status.peers.reduce((acc, val) => {if (val.role === "storage") {acc.push(val)}; return acc}, [])}/>
|
||||||
<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>Pixelstore stats</h3>
|
<h3>Pixelstore stats</h3>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
|
66
svelte/src/admin_panel/PeerTable.svelte
Normal file
66
svelte/src/admin_panel/PeerTable.svelte
Normal 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>
|
@@ -33,7 +33,7 @@ export let file = {
|
|||||||
</p>
|
</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
Come back next week when your free transfer limit resets
|
Come back tomorrow when your free transfer limit resets
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
Download the file at a rate of {file.download_speed_limit/(1<<10)}
|
Download the file at a rate of {file.download_speed_limit/(1<<10)}
|
||||||
|
Reference in New Issue
Block a user