mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-14 12:23:44 +02:00
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:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user