From 48869d2eda81cc09ce593475f328e0e59a6bfc51 Mon Sep 17 00:00:00 2001 From: Charles Morgan Date: Tue, 2 Jun 2020 23:14:16 -0400 Subject: [PATCH] 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. --- .../components/server/backups/BackupContainer.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/scripts/components/server/backups/BackupContainer.tsx b/resources/scripts/components/server/backups/BackupContainer.tsx index 438c201fb..1d162493c 100644 --- a/resources/scripts/components/server/backups/BackupContainer.tsx +++ b/resources/scripts/components/server/backups/BackupContainer.tsx @@ -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 () => { />)} } + {featureLimits.backups === 0 && +

+ Backups cannot be created for this server. +

+ } + {featureLimits.backups > 0 && featureLimits.backups !== backups.length &&
+ }
);