diff --git a/.changeset/hip-ducks-occur.md b/.changeset/hip-ducks-occur.md new file mode 100644 index 000000000..56b0cfe2f --- /dev/null +++ b/.changeset/hip-ducks-occur.md @@ -0,0 +1,5 @@ +--- +'renterd': minor +--- + +The node profile details now include uptime. diff --git a/.changeset/wicked-sloths-breathe.md b/.changeset/wicked-sloths-breathe.md new file mode 100644 index 000000000..cba3ca606 --- /dev/null +++ b/.changeset/wicked-sloths-breathe.md @@ -0,0 +1,5 @@ +--- +'hostd': minor +--- + +The node profile details now include uptime. Closes https://github.com/SiaFoundation/hostd/issues/92 diff --git a/apps/hostd/components/Profile/index.tsx b/apps/hostd/components/Profile/index.tsx index cfcf51818..a3ae1507c 100644 --- a/apps/hostd/components/Profile/index.tsx +++ b/apps/hostd/components/Profile/index.tsx @@ -13,6 +13,7 @@ import { import { useSyncStatus } from '../../hooks/useSyncStatus' import { useDialog } from '../../contexts/dialog' import { useSiascanUrl } from '../../hooks/useSiascanUrl' +import { humanTime } from '@siafoundation/units' export function Profile() { const { openDialog } = useDialog() @@ -38,6 +39,11 @@ export function Profile() { const versionUrl = version?.match(/^v\d+\.\d+\.\d+/) ? `https://github.com/SiaFoundation/hostd/releases/${version}` : `https://github.com/SiaFoundation/hostd/tree/${version}` + + const uptime = state.data + ? new Date().getTime() - new Date(state.data?.startTime).getTime() + : 0 + return ( + {state.data && ( +
+ +
+ {humanTime(uptime, { format: 'long' })} +
+
+ )}
+ {state.data && ( +
+ +
+ {humanTime(uptime, { format: 'long' })} +
+
+ )}