Merge pull request #2088 from Sir3lit/changebackup
Backup page edits, Shows client x of x backups when limit > 0. Removes create button if limit is reached or limit is 0
This commit is contained in:
commit
24852b8982
1 changed files with 13 additions and 1 deletions
|
@ -12,7 +12,7 @@ import { ServerContext } from '@/state/server';
|
||||||
import PageContentBlock from '@/components/elements/PageContentBlock';
|
import PageContentBlock from '@/components/elements/PageContentBlock';
|
||||||
|
|
||||||
export default () => {
|
export default () => {
|
||||||
const { uuid } = useServer();
|
const { uuid, featureLimits } = useServer();
|
||||||
const { addError, clearFlashes } = useFlash();
|
const { addError, clearFlashes } = useFlash();
|
||||||
const [ loading, setLoading ] = useState(true);
|
const [ loading, setLoading ] = useState(true);
|
||||||
|
|
||||||
|
@ -37,6 +37,11 @@ export default () => {
|
||||||
return (
|
return (
|
||||||
<PageContentBlock>
|
<PageContentBlock>
|
||||||
<FlashMessageRender byKey={'backups'} className={'mb-4'}/>
|
<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 ?
|
{!backups.length ?
|
||||||
<p className="text-center text-sm text-neutral-400">
|
<p className="text-center text-sm text-neutral-400">
|
||||||
There are no backups stored for this server.
|
There are no backups stored for this server.
|
||||||
|
@ -50,10 +55,17 @@ export default () => {
|
||||||
/>)}
|
/>)}
|
||||||
</div>
|
</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'}>
|
<Can action={'backup.create'}>
|
||||||
|
{featureLimits.backups > 0 && featureLimits.backups !== backups.length &&
|
||||||
<div className={'mt-6 flex justify-end'}>
|
<div className={'mt-6 flex justify-end'}>
|
||||||
<CreateBackupButton/>
|
<CreateBackupButton/>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</Can>
|
</Can>
|
||||||
</PageContentBlock>
|
</PageContentBlock>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue