Don't show an error in the listing if the server is still installing or suspended
This commit is contained in:
parent
f45c03a449
commit
c4f4f1f5c8
|
@ -56,6 +56,8 @@ class ServerTransformer extends BaseClientTransformer
|
|||
'databases' => $server->database_limit,
|
||||
'allocations' => $server->allocation_limit,
|
||||
],
|
||||
'is_suspended' => $server->suspended !== 0,
|
||||
'is_installing' => $server->installed !== 1,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@ export interface Server {
|
|||
databases: number;
|
||||
allocations: number;
|
||||
};
|
||||
isSuspended: boolean;
|
||||
isInstalling: boolean;
|
||||
}
|
||||
|
||||
export const rawDataToServerObject = (data: any): Server => ({
|
||||
|
@ -50,6 +52,8 @@ export const rawDataToServerObject = (data: any): Server => ({
|
|||
} ],
|
||||
limits: { ...data.limits },
|
||||
featureLimits: { ...data.feature_limits },
|
||||
isSuspended: data.is_suspended,
|
||||
isInstalling: data.is_installing,
|
||||
});
|
||||
|
||||
export default (uuid: string): Promise<[ Server, string[] ]> => {
|
||||
|
|
|
@ -78,6 +78,13 @@ export default ({ server, className }: { server: Server; className: string | und
|
|||
!statsError ?
|
||||
<SpinnerOverlay size={'tiny'} visible={true} backgroundOpacity={0.25}/>
|
||||
:
|
||||
(server.isSuspended || server.isInstalling) ?
|
||||
<div className={'flex-1 text-center'}>
|
||||
<span className={'bg-neutral-500 rounded px-2 py-1 text-neutral-100 text-xs'}>
|
||||
{server.isSuspended ? 'Suspended' : 'Installing'}
|
||||
</span>
|
||||
</div>
|
||||
:
|
||||
<div className={'flex-1 text-center'}>
|
||||
<span className={'bg-red-500 rounded px-2 py-1 text-red-100 text-xs'}>
|
||||
Connection Error
|
||||
|
|
Loading…
Reference in New Issue