mirror of
https://git.v0l.io/Kieran/void.cat.git
synced 2025-04-09 18:29:03 +02:00
Add build info
This commit is contained in:
parent
dbfde5c70e
commit
57dc0aadd7
@ -18,8 +18,23 @@
|
||||
margin: 0 10px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.stats svg {
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
.build-info {
|
||||
width: 100vw;
|
||||
}
|
||||
}
|
||||
|
||||
.build-info {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
color: #888;
|
||||
text-align: center;
|
||||
font-size: x-small;
|
||||
padding: 10px;
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
import {useEffect, useState} from "react";
|
||||
import {Fragment, useEffect, useState} from "react";
|
||||
import FeatherIcon from "feather-icons-react";
|
||||
import {FormatBytes} from "./Util";
|
||||
|
||||
import "./GlobalStats.css";
|
||||
import {useApi} from "./Api";
|
||||
import moment from "moment";
|
||||
|
||||
export function GlobalStats(props) {
|
||||
const {Api} = useApi();
|
||||
@ -19,23 +20,30 @@ export function GlobalStats(props) {
|
||||
useEffect(() => loadStats(), []);
|
||||
|
||||
return (
|
||||
<dl className="stats">
|
||||
<div>
|
||||
<FeatherIcon icon="upload-cloud"/>
|
||||
{FormatBytes(stats?.bandwidth?.ingress ?? 0, 2)}
|
||||
</div>
|
||||
<div>
|
||||
<FeatherIcon icon="download-cloud"/>
|
||||
{FormatBytes(stats?.bandwidth?.egress ?? 0, 2)}
|
||||
</div>
|
||||
<div>
|
||||
<FeatherIcon icon="hard-drive"/>
|
||||
{FormatBytes(stats?.totalBytes ?? 0, 2)}
|
||||
</div>
|
||||
<div>
|
||||
<FeatherIcon icon="hash"/>
|
||||
{stats?.count ?? 0}
|
||||
</div>
|
||||
</dl>
|
||||
<Fragment>
|
||||
<dl className="stats">
|
||||
<div>
|
||||
<FeatherIcon icon="upload-cloud"/>
|
||||
{FormatBytes(stats?.bandwidth?.ingress ?? 0, 2)}
|
||||
</div>
|
||||
<div>
|
||||
<FeatherIcon icon="download-cloud"/>
|
||||
{FormatBytes(stats?.bandwidth?.egress ?? 0, 2)}
|
||||
</div>
|
||||
<div>
|
||||
<FeatherIcon icon="hard-drive"/>
|
||||
{FormatBytes(stats?.totalBytes ?? 0, 2)}
|
||||
</div>
|
||||
<div>
|
||||
<FeatherIcon icon="hash"/>
|
||||
{stats?.count ?? 0}
|
||||
</div>
|
||||
</dl>
|
||||
{stats.buildInfo ? <div className="build-info">
|
||||
{stats.buildInfo.version}-{stats.buildInfo.gitHash}
|
||||
<br/>
|
||||
{moment(stats.buildInfo.buildTime).fromNow()}
|
||||
</div> : null}
|
||||
</Fragment>
|
||||
);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user