Skip to content

Commit 0d0c595

Browse files
committed
Show starting/stopping correctly in stats; closes pterodactyl#4209
1 parent 3120e1d commit 0d0c595

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

resources/scripts/components/server/console/ServerDetailsBlock.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import UptimeDuration from '@/components/server/UptimeDuration';
1515
import StatBlock from '@/components/server/console/StatBlock';
1616
import useWebsocketEvent from '@/plugins/useWebsocketEvent';
1717
import classNames from 'classnames';
18+
import { capitalize } from '@/lib/strings';
1819

1920
type Stats = Record<'memory' | 'cpu' | 'disk' | 'uptime' | 'rx' | 'tx', number>;
2021

@@ -97,7 +98,13 @@ const ServerDetailsBlock = ({ className }: { className?: string }) => {
9798
title={'Uptime'}
9899
color={getBackgroundColor(status === 'running' ? 0 : status !== 'offline' ? 9 : 10, 10)}
99100
>
100-
{stats.uptime > 0 ? <UptimeDuration uptime={stats.uptime / 1000} /> : 'Offline'}
101+
{status === 'starting' || status === 'stopping' ? (
102+
capitalize(status)
103+
) : stats.uptime > 0 ? (
104+
<UptimeDuration uptime={stats.uptime / 1000} />
105+
) : (
106+
'Offline'
107+
)}
101108
</StatBlock>
102109
<StatBlock icon={faMicrochip} title={'CPU Load'} color={getBackgroundColor(stats.cpu, limits.cpu)}>
103110
{status === 'offline' ? (

0 commit comments

Comments
 (0)