The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Wrap up updates according to endpoint changes
Joshen Lime0b554a2472d
diff --git a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsxindex 2789f1e139b..39c3c24459a 100644--- a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx+++ b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx@@ -186,16 +186,14 @@ const Infrastructure = ({<CPUWarningsisFreePlan={isFreePlan}upgradeUrl={upgradeUrl}- isBeyondThreshold={projectResourceWarnings?.is_cpu_load_beyond_threshold ?? false}+ severity={projectResourceWarnings?.cpu_exhaustion}/>)}{attribute.key === 'ram_usage' && (<RAMWarningsisFreePlan={isFreePlan}upgradeUrl={upgradeUrl}- isBeyondThreshold={- projectResourceWarnings?.is_memory_and_swap_usage_beyond_threshold ?? false- }+ severity={projectResourceWarnings?.memory_and_swap_exhaustion}/>)}diff --git a/studio/components/interfaces/BillingV2/Usage/UsageWarningAlerts/CPUWarnings.tsx b/studio/components/interfaces/BillingV2/Usage/UsageWarningAlerts/CPUWarnings.tsxindex 818e649f4ac..8a207e12518 100644--- a/studio/components/interfaces/BillingV2/Usage/UsageWarningAlerts/CPUWarnings.tsx+++ b/studio/components/interfaces/BillingV2/Usage/UsageWarningAlerts/CPUWarnings.tsx@@ -5,16 +5,11 @@ import { AlertDescription_Shadcn_, Alert_Shadcn_, Button, IconAlertCircle } frominterface CPUWarningsProps {isFreePlan: booleanupgradeUrl: string- isBeyondThreshold: boolean+ severity?: 'warning' | 'critical' | null}-const CPUWarnings = ({ isFreePlan, upgradeUrl, isBeyondThreshold }: CPUWarningsProps) => {- // [Joshen TODO] Need to implement the necessary conditionals for rendering the warnings once- // endpoint is updated to return text instead of boolean- const isApproaching = isBeyondThreshold- const isExceeded = false-- if (isApproaching) {+const CPUWarnings = ({ isFreePlan, upgradeUrl, severity }: CPUWarningsProps) => {+ if (severity === 'warning') {return (<Alert_Shadcn_ variant="warning"><IconAlertCircle />@@ -42,7 +37,7 @@ const CPUWarnings = ({ isFreePlan, upgradeUrl, isBeyondThreshold }: CPUWarningsP)}- if (isExceeded) {+ if (severity === 'critical') {return (<Alert_Shadcn_ variant="destructive"><IconAlertCircle />diff --git a/studio/components/interfaces/BillingV2/Usage/UsageWarningAlerts/RAMWarnings.tsx b/studio/components/interfaces/BillingV2/Usage/UsageWarningAlerts/RAMWarnings.tsxindex 8006c3d079d..fe233f08695 100644--- a/studio/components/interfaces/BillingV2/Usage/UsageWarningAlerts/RAMWarnings.tsx+++ b/studio/components/interfaces/BillingV2/Usage/UsageWarningAlerts/RAMWarnings.tsx@@ -5,16 +5,11 @@ import { AlertDescription_Shadcn_, Alert_Shadcn_, Button, IconAlertCircle } frominterface RAMWarningsProps {isFreePlan: booleanupgradeUrl: string- isBeyondThreshold: boolean+ severity?: 'warning' | 'critical' | null}-const RAMWarnings = ({ isFreePlan, upgradeUrl, isBeyondThreshold }: RAMWarningsProps) => {- // [Joshen TODO] Need to implement the necessary conditionals for rendering the warnings once- // endpoint is updated to return text instead of boolean- const isApproaching = isBeyondThreshold- const isExceeded = false-- if (isApproaching) {+const RAMWarnings = ({ isFreePlan, upgradeUrl, severity }: RAMWarningsProps) => {+ if (severity === 'warning') {return (<Alert_Shadcn_ variant="warning"><IconAlertCircle />@@ -42,7 +37,7 @@ const RAMWarnings = ({ isFreePlan, upgradeUrl, isBeyondThreshold }: RAMWarningsP)}- if (isExceeded) {+ if (severity === 'critical') {return (<Alert_Shadcn_ variant="destructive"><IconAlertCircle />diff --git a/studio/components/interfaces/Settings/Infrastructure/InfrastructureActivity.tsx b/studio/components/interfaces/Settings/Infrastructure/InfrastructureActivity.tsxindex 28e6dce7415..1594655f2da 100644--- a/studio/components/interfaces/Settings/Infrastructure/InfrastructureActivity.tsx+++ b/studio/components/interfaces/Settings/Infrastructure/InfrastructureActivity.tsx@@ -308,18 +308,14 @@ const InfrastructureActivity = () => {<CPUWarningsisFreePlan={isFreePlan}upgradeUrl={upgradeUrl}- isBeyondThreshold={- projectResourceWarnings?.is_cpu_load_beyond_threshold ?? false- }+ severity={projectResourceWarnings?.cpu_exhaustion}/>)}{attribute.key === 'ram_usage' && (<RAMWarningsisFreePlan={isFreePlan}upgradeUrl={upgradeUrl}- isBeyondThreshold={- projectResourceWarnings?.is_memory_and_swap_usage_beyond_threshold ?? false- }+ severity={projectResourceWarnings?.memory_and_swap_exhaustion}/>)}diff --git a/studio/components/ui/UsageWarnings/UsageWarningBanner.tsx b/studio/components/ui/UsageWarnings/UsageWarningBanner.tsxindex 647882dd84c..19b7fd6e1d8 100644--- a/studio/components/ui/UsageWarnings/UsageWarningBanner.tsx+++ b/studio/components/ui/UsageWarnings/UsageWarningBanner.tsx@@ -100,8 +100,8 @@ const UsageWarningBanner = () => {// Don't show banner if no warnings, or on usage/infra pageif (activeWarnings.length === 0 ||- router.pathname.endsWith('/usage') ||- router.pathname.endsWith('/infrastructure')+ ((router.pathname.endsWith('/usage') || router.pathname.endsWith('/infrastructure')) &&+ !activeWarnings.includes('is_readonly_mode_enabled')))return nulldiff --git a/studio/data/usage/resource-warnings-query.ts b/studio/data/usage/resource-warnings-query.tsindex 7249b41e989..d7ecd7c350e 100644--- a/studio/data/usage/resource-warnings-query.ts+++ b/studio/data/usage/resource-warnings-query.ts@@ -8,25 +8,6 @@ import { components } from 'data/api'export async function getResourceWarnings(signal?: AbortSignal) {const { data, error } = await get(`/platform/projects-resource-warnings`, { signal })if (error) throw error-- return [- {- project: 'iqixcyokaezexqncgirb',- is_readonly_mode_enabled: false,- disk_io_exhaustion: null,- disk_space_exhaustion: null,- cpu_exhaustion: null,- memory_and_swap_exhaustion: null,- },- {- project: 'yhkgeeesimzjzbigwxwv',- is_readonly_mode_enabled: false,- disk_io_exhaustion: null,- disk_space_exhaustion: null,- cpu_exhaustion: 'critical',- memory_and_swap_exhaustion: null,- },- ] as ResourceWarning[]return data}diff --git a/studio/pages/projects.tsx b/studio/pages/projects.tsxindex 909a567dad3..c7e183eced8 100644--- a/studio/pages/projects.tsx+++ b/studio/pages/projects.tsx@@ -48,7 +48,7 @@ const ProjectsPage: NextPageWithLayout = () => {</div>)}- {true && (+ {isError && (<divclassName={`py-4 px-5 ${navLayoutV2 ? 'h-full flex items-center justify-center' : ''}`}>