Only show limit warnings when necessary and relevant

This commit is contained in:
Dane Everitt 2020-06-23 20:13:58 -07:00
parent b78aa180ea
commit 497f73d820
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 10 additions and 10 deletions

View File

@ -37,11 +37,6 @@ export default () => {
return (
<PageContentBlock>
<FlashMessageRender byKey={'backups'} className={'mb-4'}/>
{featureLimits.backups !== 0 &&
<p className="text-center text-md text-neutral-400">
You are currently using {backups.length} of {featureLimits.backups} backups.
</p>
}
{!backups.length ?
<p className="text-center text-sm text-neutral-400">
There are no backups stored for this server.
@ -61,6 +56,11 @@ export default () => {
</p>
}
<Can action={'backup.create'}>
{(featureLimits.backups > 0 && backups.length > 0) &&
<p className="text-center text-xs text-neutral-400 mt-2">
{backups.length} of {featureLimits.backups} backups have been created for this server.
</p>
}
{featureLimits.backups > 0 && featureLimits.backups !== backups.length &&
<div className={'mt-6 flex justify-end'}>
<CreateBackupButton/>

View File

@ -36,11 +36,6 @@ export default () => {
return (
<PageContentBlock>
<FlashMessageRender byKey={'databases'} className={'mb-4'}/>
{featureLimits.databases !== 0 &&
<p className="text-center text-md text-neutral-400">
You are currently using {databases.length} of {featureLimits.databases} databases.
</p>
}
{(!databases.length && loading) ?
<Spinner size={'large'} centered={true}/>
:
@ -64,6 +59,11 @@ export default () => {
</p>
}
<Can action={'database.create'}>
{(featureLimits.databases > 0 && databases.length > 0) &&
<p className="text-center text-xs text-neutral-400 mt-2">
{databases.length} of {featureLimits.databases} databases have been allocated to this server.
</p>
}
{featureLimits.databases > 0 && featureLimits.databases !== databases.length &&
<div className={'mt-6 flex justify-end'}>
<CreateDatabaseButton/>