Add build info

This commit is contained in:
Kieran 2022-03-08 22:15:56 +00:00
parent dbfde5c70e
commit 57dc0aadd7
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 42 additions and 19 deletions

View File

@ -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;
}

View File

@ -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,6 +20,7 @@ export function GlobalStats(props) {
useEffect(() => loadStats(), []);
return (
<Fragment>
<dl className="stats">
<div>
<FeatherIcon icon="upload-cloud"/>
@ -37,5 +39,11 @@ export function GlobalStats(props) {
{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>
);
}