Remove create backup button if limit = 0, display message none can be created

Removes the create button if the limit is 0, just like it does with the database page
Also once limit is reached the create button is removed from view.
This commit is contained in:
Charles Morgan 2020-06-02 23:14:16 -04:00
parent 0795f8763d
commit 48869d2eda
No known key found for this signature in database
GPG key ID: D71946CD723249BD

View file

@ -12,7 +12,7 @@ import { ServerContext } from '@/state/server';
import PageContentBlock from '@/components/elements/PageContentBlock';
export default () => {
const { uuid } = useServer();
const { uuid, featureLimits } = useServer();
const { addError, clearFlashes } = useFlash();
const [ loading, setLoading ] = useState(true);
@ -50,10 +50,17 @@ export default () => {
/>)}
</div>
}
{featureLimits.backups === 0 &&
<p className="text-center text-sm text-neutral-400">
Backups cannot be created for this server.
</p>
}
<Can action={'backup.create'}>
{featureLimits.backups > 0 && featureLimits.backups !== backups.length &&
<div className={'mt-6 flex justify-end'}>
<CreateBackupButton/>
</div>
}
</Can>
</PageContentBlock>
);