Skip to content

Commit

Permalink
Update ServerRow.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
kokofixcomputers authored Oct 6, 2024
1 parent e33ad22 commit ca54e98
Showing 1 changed file with 34 additions and 24 deletions.
58 changes: 34 additions & 24 deletions resources/scripts/components/dashboard/ServerRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const StatusIndicatorBox = styled(GreyRowBox)<{ $status: ServerPowerState | unde
&:hover .status-bar {
${tw`opacity-75`};
}
`;
};
type Timer = ReturnType<typeof setInterval>;
Expand Down Expand Up @@ -99,29 +99,39 @@ export default ({ server, className }: { server: Server; className?: string }) =
))}
</p>
</div>
{!stats ||
(isSuspended &&
(isSuspended ? (
<div css={tw`flex-1 text-center`}>
<span css={tw`bg-red-500 rounded px-2 py-1 text-red-100 text-xs`}>
{server.status === 'suspended' ? 'Suspended' : 'Connection Error'}
</span>
</div>
) : server.isTransferring || server.status ? (
<div css={tw`flex-1 text-center`}>
<span css={tw`bg-neutral-500 rounded px-2 py-1 text-neutral-100 text-xs`}>
{server.isTransferring
? 'Transferring'
: server.status === 'installing'
? 'Installing'
: server.status === 'restoring_backup'
? 'Restoring Backup'
: 'Unavailable'}
</span>
</div>
) : (
<Spinner size={'small'} />
)))}
{!stats ? (
<Spinner size={'small'} />
) : isSuspended ? (
<div css={tw`flex-1 text-center`}>
<span css={tw`bg-red-500 rounded px-2 py-1 text-red-100 text-xs`}>
{server.status === 'suspended' ? 'Suspended' : 'Connection Error'}
</span>
</div>
) : server.isTransferring ? (
<div css={tw`flex-1 text-center`}>
<span css={tw`bg-neutral-500 rounded px-2 py-1 text-neutral-100 text-xs`}>
{'Transferring'}
</span>
</div>
) : server.status === 'installing' ? (
<div css={tw`flex-1 text-center`}>
<span css={tw`bg-neutral-500 rounded px-2 py-1 text-neutral-100 text-xs`}>
{'Installing'}
</span>
</div>
) : server.status === 'restoring_backup' ? (
<div css={tw`flex-1 text-center`}>
<span css={tw`bg-neutral-500 rounded px-2 py-1 text-neutral-100 text-xs`}>
{'Restoring Backup'}
</span>
</div>
) : (
<div css={tw`flex-1 text-center`}>
<span css={tw`bg-neutral-500 rounded px-2 py-1 text-neutral-100 text-xs`}>
{'Unavailable'}
</span>
</div>
)}
</div>
{stats && (
<div css={tw`hidden col-span-12 sm:flex items-baseline justify-center items-center`}>
Expand Down

0 comments on commit ca54e98

Please sign in to comment.