Merge pull request #13510 from supabase/pitr-hint-backups-page

chore: add hint about daily backups when PITR enabled
This commit is contained in:
Kevin Grüneberg authored and GitHub committed 2023-04-11 10:42:58 +02:00
commit d61597b2bc
2 files changed
+41 -7

No files matched your search

@@ -23,6 +23,8 @@ const BackupsList: FC<Props> = ({}) => {
'queue_job.restore.prepare'
)
const isPitrEnabled = backups?.configuration?.walg_enabled
if (backups.isLoading) return <Loading />
if (backups.error) return <BackupsError />
@@ -43,7 +45,11 @@ const BackupsList: FC<Props> = ({}) => {
return (
<div className="space-y-6">
{!sortedBackups?.length && tierKey !== 'FREE' ? (
<BackupsEmpty />
!isPitrEnabled ? (
<BackupsEmpty />
) : (
<></>
)
) : (
<>
{!canTriggerScheduledBackups && (
@@ -1,6 +1,6 @@
import { useRouter } from 'next/router'
import { observer } from 'mobx-react-lite'
import { Tabs } from 'ui'
import { IconAlertCircle, IconHelpCircle, IconInfo, IconMessageCircle, Tabs } from 'ui'
import { PermissionAction } from '@supabase/shared-types/out/constants'
import { NextPageWithLayout } from 'types'
@@ -9,12 +9,15 @@ import { DatabaseLayout } from 'components/layouts'
import { BackupsList } from 'components/interfaces/Database'
import NoPermission from 'components/ui/NoPermission'
import { FormsContainer } from 'components/ui/Forms'
import InformationBox from 'components/ui/InformationBox'
const DatabaseScheduledBackups: NextPageWithLayout = () => {
const { ui } = useStore()
const { ui, backups } = useStore()
const router = useRouter()
const ref = ui.selectedProject?.ref
const isPitrEnabled = backups?.configuration?.walg_enabled
const canReadScheduledBackups = checkPermissions(PermissionAction.READ, 'back_ups')
return (
@@ -35,10 +38,35 @@ const DatabaseScheduledBackups: NextPageWithLayout = () => {
</Tabs>
<div className="space-y-4">
<p className="text-sm text-scale-1100">
Projects are backed up daily around midnight of your project's region and can be
restored at any time.
</p>
{!isPitrEnabled && (
<p className="text-sm text-scale-1100">
Projects are backed up daily around midnight of your project's region and can be
restored at any time.
</p>
)}
{isPitrEnabled && (
<InformationBox
hideCollapse
defaultVisibility
icon={<IconInfo strokeWidth={2} />}
title="Point-In-Time-Recovery (PITR) enabled"
description={
<div>
Your project uses PITR and full daily backups are no longer taken. They're not
needed, as PITR supports a superset of functionality, in terms of the granular
recovery that can be performed.{' '}
<a
className="text-brand-900 transition-colors hover:text-brand-1200"
href="https://supabase.io/docs/guides/database/backups"
>
Learn more
</a>
</div>
}
/>
)}
{canReadScheduledBackups ? (
<BackupsList />
) : (