diff --git a/studio/components/layouts/ProjectLayout/ConnectingState.tsx b/studio/components/layouts/ProjectLayout/ConnectingState.tsx index 7a5c9bbf70a..b57b5edbec5 100644 --- a/studio/components/layouts/ProjectLayout/ConnectingState.tsx +++ b/studio/components/layouts/ProjectLayout/ConnectingState.tsx @@ -1,7 +1,7 @@ import Link from 'next/link' -import { FC, useEffect, useRef } from 'react' +import { FC, useEffect, useRef, useState } from 'react' import { observer } from 'mobx-react-lite' -import { Badge, IconLoader, IconMonitor, IconServer } from '@supabase/ui' +import { Badge, Button, IconLoader, IconMonitor, IconServer, Modal } from '@supabase/ui' import { Project } from 'types' import { useStore } from 'hooks' @@ -16,6 +16,15 @@ const ProjectRestartingState: FC = ({ project }) => { const { app } = useStore() const checkProjectConnectionIntervalRef = useRef() + const [showHelperButton, setShowHelperButton] = useState(false) + const [showModal, setShowModal] = useState(false) + + // Show helper button if still connecting after 30 seconds + useEffect(() => { + const timer = setTimeout(() => setShowHelperButton(true), 30000) + return () => clearTimeout(timer) + }, []) + useEffect(() => { if (!project.restUrl || !project.internalApiKey) return @@ -38,39 +47,102 @@ const ProjectRestartingState: FC = ({ project }) => { } return ( -
-
-
-

{project.name}

-
- -
- - Connecting to project + <> +
+
+
+

{project.name}

+
+ +
+ + Connecting to project +
+
+
+
+
+
+
+ + + +
+ +
+

Connecting to {project.name}

+

setShowModal(true)} + > + This may take a few minutes +

- -
-
-
-
-
- - - + +
+ {showHelperButton && ( + + )} +
-

Connecting to {project.name}

-

- This may take a few minutes, but if your dashboard hasn't connected within 2 minutes, - you can open a support ticket{' '} - - here - - . -

-
+ setShowModal(false)} + header={ +
+
Checking the health of your database
+
+ } + size="medium" + hideFooter + closable + > +
+ +
+

+ Your project might be facing resource constraints and hence is having trouble + connecting. You can verify this by checking your{' '} + + + database's health + + {' '} + or your remaining daily disk IO budget via a{' '} + + + customizable project report + + + . +

+

+ If your project is facing resource constraints, you can{' '} + + + upgrade + + {' '} + your project's subscription to a Pro for access to larger compute sizes. +

+

+ However, if your project still fails to connect thereafter, you can open a support + ticket{' '} + + here + + . +

+
+
+
+
+ ) }