If uptime is present in stats output, display it for the server; closes #3653
This commit is contained in:
parent
63e01f9aee
commit
81ba333270
2 changed files with 25 additions and 3 deletions
14
resources/scripts/components/server/UptimeDuration.tsx
Normal file
14
resources/scripts/components/server/UptimeDuration.tsx
Normal 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')}
|
||||
</>
|
||||
);
|
||||
};
|
Reference in a new issue