The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Adds new language around free project limit
Terry Suttona2dd852194e7
diff --git a/studio/components/interfaces/Organization/NewProject/FreeProjectLimitWarning.tsx b/studio/components/interfaces/Organization/NewProject/FreeProjectLimitWarning.tsxindex 04d314f86ca..9b4269d8002 100644--- a/studio/components/interfaces/Organization/NewProject/FreeProjectLimitWarning.tsx+++ b/studio/components/interfaces/Organization/NewProject/FreeProjectLimitWarning.tsx@@ -17,7 +17,7 @@ const FreeProjectLimitWarning: FC<Props> = ({ limit }) => {description={<div className="space-y-3"><p className="text-sm leading-normal">- {`Your account can only have up to ${limit} free projects - to create another free project, you'll need to delete an existing free project first. Otherwise, you may create a project on the Pro tier instead.`}+ {`Your account can only have up to ${limit} free projects - to create another free project, you'll need to delete or pause an existing free project first. Otherwise, you may create a project on the Pro tier instead.`}</p></div>}diff --git a/studio/hooks/queries/useSubscriptionStats.ts b/studio/hooks/queries/useSubscriptionStats.tsindex 3557413d527..42bd7dad73d 100644--- a/studio/hooks/queries/useSubscriptionStats.ts+++ b/studio/hooks/queries/useSubscriptionStats.ts@@ -16,7 +16,7 @@ export function useSubscriptionStats() {return {total_paid_projects: data?.total_paid_projects ?? 0,- total_free_projects: data?.total_free_projects ?? 0,+ total_free_projects: data?.total_free_projects ?? 0, // set this to force limit locallytotal_pro_projects: data?.total_pro_projects ?? 0,total_payg_projects: data?.total_payg_projects ?? 0,isLoading: !anyError && !data,diff --git a/studio/pages/project/[ref]/settings/general.tsx b/studio/pages/project/[ref]/settings/general.tsxindex 7b91c74a96c..48c7fb8c5ae 100644--- a/studio/pages/project/[ref]/settings/general.tsx+++ b/studio/pages/project/[ref]/settings/general.tsx@@ -4,7 +4,7 @@ import { observer } from 'mobx-react-lite'import { toJS } from 'mobx'import { projects } from 'stores/jsonSchema'import { AutoField } from 'uniforms-bootstrap4'-import { Alert, Button, Input, IconRefreshCcw } from '@supabase/ui'+import { Alert, Button, Input, IconRefreshCcw, IconPause } from '@supabase/ui'import { API_URL } from 'lib/constants'import { pluckJsonSchemaFields, pluckObjectFields } from 'lib/helpers'@@ -79,6 +79,52 @@ const RestartServerButton: FC<RestartServerButtonProps> = observer(({ projectRef)})+interface PauseProjectButtonProps {+ projectId: number+ projectRef: string+}+const PauseProjectButton: FC<PauseProjectButtonProps> = observer(({ projectRef, projectId }) => {+ const { ui, app } = useStore()+ const router = useRouter()+ const [loading, setLoading] = useState(false)+ const [isModalOpen, setIsModalOpen] = useState(false)++ const openModal = () => setIsModalOpen(true)+ const closeModal = () => setIsModalOpen(false)++ const requestPauseProject = async () => {+ setLoading(true)+ try {+ await post(`${API_URL}/projects/${projectRef}/restart`, {})+ app.onProjectPostgrestStatusUpdated(projectId, 'OFFLINE')+ ui.setNotification({ category: 'success', message: 'Restarting server' })+ router.push(`/project/${projectRef}`)+ } catch (error) {+ ui.setNotification({ error, category: 'error', message: 'Unable to restart server' })+ setLoading(false)+ }+ closeModal()+ }++ return (+ <>+ <ConfirmModal+ danger+ visible={isModalOpen}+ title="Pause this project?"+ description={`Are you sure you want to pause this project? It will not be accessible until you unpause it.`}+ buttonLabel="Pause project"+ buttonLoadingLabel="Pausing project"+ onSelectCancel={closeModal}+ onSelectConfirm={requestPauseProject}+ />+ <Button type="default" icon={<IconPause />} onClick={openModal} loading={loading}>+ Pause Project+ </Button>+ </>+ )+})+const GeneralSettings = observer(() => {const { app, ui } = useStore()const project = ui.selectedProject@@ -109,6 +155,7 @@ const GeneralSettings = observer(() => {onSubmit={(model: any) => handleUpdateProject(pluckObjectFields(model, BASIC_FIELDS))}><AutoField name="name" showInlineError errorMessage="Please enter a project name" />+ eeeee</SchemaFormPanel></section>@@ -145,6 +192,19 @@ const GeneralSettings = observer(() => {{project && <RestartServerButton projectId={project.id} projectRef={project.ref} />}</div></Panel.Content>+ <Panel.Content className="border-panel-border-interior-light dark:border-panel-border-interior-dark border-t">+ <div className="flex w-full items-center justify-between">+ <div>+ <p>Pause project</p>+ <div style={{ maxWidth: '420px' }}>+ <p className="text-sm opacity-50">+ Your project will not be accessible while it is paused.+ </p>+ </div>+ </div>+ {project && <PauseProjectButton projectId={project.id} projectRef={project.ref} />}+ </div>+ </Panel.Content></Panel></section>