The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
Chore/rr improvements (#19584)
Joshen Lim7d04868760f7
diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsxindex 15573e726f2..1cbda74d9cd 100644--- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsx+++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/MapView.tsx@@ -50,8 +50,7 @@ const MapView = ({const [tooltip, setTooltip] = useState<{x: numbery: number- region?: { key: string; country?: string; name?: string }- network?: any+ region: { key: string; country?: string; name?: string }}>()const { data } = useReadReplicasQuery({ projectRef: ref })@@ -85,7 +84,7 @@ const MapView = ({}, [])return (- <div className="bg-background h-[500px]">+ <div className="bg-background h-[500px] relative"><ComposableMap projectionConfig={{ scale: 155 }} className="w-full h-full"><ZoomableGroupclassName={mount ? 'transition-all duration-300' : ''}@@ -150,10 +149,10 @@ const MapView = ({<Markerkey={region.key}coordinates={coordinates}- onMouseEnter={(event) =>+ onMouseEnter={() => {setTooltip({- x: event.clientX,- y: event.clientY + 20,+ x: coordinates![0],+ y: coordinates![1],region: {key: region.key,country: region.name,@@ -170,7 +169,7 @@ const MapView = ({} deployed`,},})- }+ }}onMouseLeave={() => setTooltip(undefined)}onClick={() => {if (coordinates) {@@ -182,14 +181,16 @@ const MapView = ({{selectedRegionKey === region.region && (<circler={4}- className={`animate-ping ${hasNoDatabases ? 'fill-white/30' : 'fill-brand'}`}+ className={`animate-ping ${+ hasNoDatabases ? 'fill-border-stronger' : 'fill-brand'+ }`}/>)}<circler={4}className={`cursor-pointer ${hasNoDatabases- ? 'fill-background-surface-300 stroke-white/20'+ ? 'fill-background-surface-300 stroke-border-stronger': hasPrimary? 'fill-brand stroke-brand-500': 'fill-brand-500 stroke-brand-400'@@ -198,36 +199,37 @@ const MapView = ({</Marker>)})}++ {tooltip !== undefined && zoom === 1.5 && (+ <Marker coordinates={[tooltip.x - 47, tooltip.y - 5]}>+ <foreignObject width={220} height={66.25}>+ <div className="bg-background/50 rounded border">+ <div className="px-3 py-2 flex flex-col gap-y-1">+ <div className="flex items-center gap-x-2">+ <img+ alt="region icon"+ className="w-4 rounded-sm"+ src={`${BASE_PATH}/img/regions/${tooltip.region.key}.svg`}+ />+ <p className="text-[11px]">{tooltip.region.country}</p>+ </div>+ <p+ className={`text-[11px] ${+ tooltip.region.name === undefined ? 'text-foreground-light' : ''+ }`}+ >+ {tooltip.region.name ?? 'No databases deployed'}+ </p>+ </div>+ </div>+ </foreignObject>+ </Marker>+ )}</ZoomableGroup></ComposableMap>- {tooltip?.region !== undefined && (- <div- className="absolute w-[220px] bg-black bg-opacity-50 rounded border"- style={{ left: tooltip.x - 420, top: tooltip.y - 130 }}- >- <div className="px-3 py-2 flex flex-col gap-y-2">- <div className="flex items-center gap-x-2">- <img- alt="region icon"- className="w-5 rounded-sm"- src={`${BASE_PATH}/img/regions/${tooltip.region.key}.svg`}- />- <p className="text-xs">{tooltip.region.country}</p>- </div>- <p- className={`text-xs ${- tooltip.region.name === undefined ? 'text-foreground-light' : ''- }`}- >- {tooltip.region.name ?? 'No databases deployed'}- </p>- </div>- </div>- )}-{showRegionDetails && selectedRegion && (- <div className="absolute bottom-4 right-4 flex flex-col bg-black bg-opacity-50 backdrop-blur-sm border rounded w-[400px]">+ <div className="absolute bottom-4 right-4 flex flex-col bg-background/50 backdrop-blur-sm border rounded w-[400px]"><div className="flex items-center justify-between py-4 px-4 border-b"><div><p className="text-xs text-foreground-light">diff --git a/apps/studio/components/ui/DatabaseSelector.tsx b/apps/studio/components/ui/DatabaseSelector.tsxindex 8ce9635066f..cdffd83efbc 100644--- a/apps/studio/components/ui/DatabaseSelector.tsx+++ b/apps/studio/components/ui/DatabaseSelector.tsx@@ -8,6 +8,7 @@ import {Command_Shadcn_,IconCheck,IconChevronDown,+ IconPlus,PopoverContent_Shadcn_,PopoverTrigger_Shadcn_,Popover_Shadcn_,@@ -17,6 +18,8 @@ import {import { useReadReplicasQuery } from 'data/read-replicas/replicas-query'import { formatDatabaseID, formatDatabaseRegion } from 'data/read-replicas/replicas.utils'+import Link from 'next/link'+import { useRouter } from 'next/router'interface DatabaseSelectorProps {selectedDatabaseId?: string@@ -29,10 +32,13 @@ const DatabaseSelector = ({variant = 'regular',onChangeDatabaseId,}: DatabaseSelectorProps) => {+ const router = useRouter()const { ref: projectRef } = useParams()const [open, setOpen] = useState(false)+const { data } = useReadReplicasQuery({ projectRef })const databases = data ?? []+const selectedDatabase = databases.find((db) => db.identifier === selectedDatabaseId)const selectedDatabaseRegion = formatDatabaseRegion(selectedDatabase?.region ?? '')const formattedDatabaseId = formatDatabaseID(selectedDatabaseId ?? '')@@ -101,6 +107,27 @@ const DatabaseSelector = ({})}</ScrollArea></CommandGroup_Shadcn_>+ <CommandGroup_Shadcn_ className="border-t">+ <CommandItem_Shadcn_+ className="cursor-pointer w-full"+ onSelect={() => {+ setOpen(false)+ router.push(`/project/${projectRef}/settings/infrastructure`)+ }}+ onClick={() => setOpen(false)}+ >+ <Link+ href={`/project/${projectRef}/settings/infrastructure`}+ onClick={() => {+ setOpen(false)+ }}+ className="w-full flex items-center gap-2"+ >+ <IconPlus size={14} strokeWidth={1.5} />+ <p>Create a new read replica</p>+ </Link>+ </CommandItem_Shadcn_>+ </CommandGroup_Shadcn_></CommandList_Shadcn_></Command_Shadcn_></PopoverContent_Shadcn_>