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,
|
'databases' => $server->database_limit,
|
||||||
'allocations' => $server->allocation_limit,
|
'allocations' => $server->allocation_limit,
|
||||||
],
|
],
|
||||||
|
'is_suspended' => $server->suspended !== 0,
|
||||||
|
'is_installing' => $server->installed !== 1,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,8 @@ export interface Server {
|
||||||
databases: number;
|
databases: number;
|
||||||
allocations: number;
|
allocations: number;
|
||||||
};
|
};
|
||||||
|
isSuspended: boolean;
|
||||||
|
isInstalling: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const rawDataToServerObject = (data: any): Server => ({
|
export const rawDataToServerObject = (data: any): Server => ({
|
||||||
|
@ -50,6 +52,8 @@ export const rawDataToServerObject = (data: any): Server => ({
|
||||||
} ],
|
} ],
|
||||||
limits: { ...data.limits },
|
limits: { ...data.limits },
|
||||||
featureLimits: { ...data.feature_limits },
|
featureLimits: { ...data.feature_limits },
|
||||||
|
isSuspended: data.is_suspended,
|
||||||
|
isInstalling: data.is_installing,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default (uuid: string): Promise<[ Server, string[] ]> => {
|
export default (uuid: string): Promise<[ Server, string[] ]> => {
|
||||||
|
|
|
@ -78,11 +78,18 @@ export default ({ server, className }: { server: Server; className: string | und
|
||||||
!statsError ?
|
!statsError ?
|
||||||
<SpinnerOverlay size={'tiny'} visible={true} backgroundOpacity={0.25}/>
|
<SpinnerOverlay size={'tiny'} visible={true} backgroundOpacity={0.25}/>
|
||||||
:
|
:
|
||||||
<div className={'flex-1 text-center'}>
|
(server.isSuspended || server.isInstalling) ?
|
||||||
<span className={'bg-red-500 rounded px-2 py-1 text-red-100 text-xs'}>
|
<div className={'flex-1 text-center'}>
|
||||||
Connection Error
|
<span className={'bg-neutral-500 rounded px-2 py-1 text-neutral-100 text-xs'}>
|
||||||
</span>
|
{server.isSuspended ? 'Suspended' : 'Installing'}
|
||||||
</div>
|
</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
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
:
|
:
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<div className={'flex-1 flex ml-4 justify-center'}>
|
<div className={'flex-1 flex ml-4 justify-center'}>
|
||||||
|
|
Loading…
Reference in New Issue