If uptime is present in stats output, display it for the server; closes #3653

This commit is contained in:
Dane Everitt 2021-10-03 12:59:44 -07:00
parent 63e01f9aee
commit 81ba333270
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
2 changed files with 25 additions and 3 deletions

View file

@ -0,0 +1,14 @@
import React from 'react';
export default ({ uptime }: { uptime: number }) => {
const hours = Math.floor(Math.floor(uptime) / 60 / 60);
const remainder = Math.floor(uptime - (hours * 60 * 60));
const minutes = Math.floor(remainder / 60);
const seconds = remainder % 60;
return (
<>
{hours.toString().padStart(2, '0')}:{minutes.toString().padStart(2, '0')}:{seconds.toString().padStart(2, '0')}
</>
);
};