import { useParams } from 'common' import { ScaffoldContainer, ScaffoldDivider, ScaffoldSection, ScaffoldSectionContent, ScaffoldSectionDetail, } from 'components/layouts/Scaffold' import AlertError from 'components/ui/AlertError' import { GenericSkeletonLoader } from 'components/ui/ShimmeringLoader' import { useProjectUpgradeEligibilityQuery } from 'data/config/project-upgrade-eligibility-query' import { useProjectServiceVersionsQuery } from 'data/projects/project-service-versions' import { useReadReplicasQuery } from 'data/read-replicas/replicas-query' import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled' import { useIsOrioleDb, useSelectedProjectQuery } from 'hooks/misc/useSelectedProject' import { AlertDescription_Shadcn_, AlertTitle_Shadcn_, Alert_Shadcn_, Badge, Input, Tooltip, TooltipContent, TooltipTrigger, } from 'ui' import { ProjectUpgradeAlert } from '../General/Infrastructure/ProjectUpgradeAlert' import InstanceConfiguration from './InfrastructureConfiguration/InstanceConfiguration' import { ObjectsToBeDroppedWarning, ReadReplicasWarning, UnsupportedExtensionsWarning, UserDefinedObjectsInInternalSchemasWarning, } from './UpgradeWarnings' const InfrastructureInfo = () => { const { ref } = useParams() const { data: project } = useSelectedProjectQuery() const authEnabled = useIsFeatureEnabled('project_auth:all') const { data, error, isLoading: isLoadingUpgradeEligibility, isError: isErrorUpgradeEligibility, isSuccess: isSuccessUpgradeEligibility, } = useProjectUpgradeEligibilityQuery({ projectRef: ref, }) const { data: serviceVersions, error: serviceVersionsError, isLoading: isLoadingServiceVersions, isError: isErrorServiceVersions, isSuccess: isSuccessServiceVersions, } = useProjectServiceVersionsQuery({ projectRef: ref }) const { data: databases } = useReadReplicasQuery({ projectRef: ref }) const { current_app_version, current_app_version_release_channel, latest_app_version } = data || {} const isOnLatestVersion = current_app_version === latest_app_version const currentPgVersion = (current_app_version ?? '') .split('supabase-postgres-')[1] ?.replace('-orioledb', '') const isVisibleReleaseChannel = current_app_version_release_channel && !['ga', 'withdrawn'].includes(current_app_version_release_channel) ? current_app_version_release_channel : undefined const isOrioleDb = useIsOrioleDb() const latestPgVersion = (latest_app_version ?? '').split('supabase-postgres-')[1] const isInactive = project?.status === 'INACTIVE' const hasReadReplicas = (databases ?? []).length > 1 const hasObjectsToBeDropped = (data?.objects_to_be_dropped ?? []).length > 0 const hasUnsupportedExtensions = (data?.unsupported_extensions || []).length > 0 const hasObjectsInternalSchema = (data?.user_defined_objects_in_internal_schemas || []).length > 0 return ( <> {project?.cloud_provider !== 'FLY' && ( <> > )} Service Versions Information on your provisioned instance {isInactive ? ( Service versions cannot be retrieved while project is paused Restoring the project will update Postgres to the newest version ) : ( <> {isLoadingUpgradeEligibility && } {isErrorUpgradeEligibility && ( )} {isSuccessUpgradeEligibility && ( <> {isLoadingServiceVersions && } {isErrorServiceVersions && ( )} {isSuccessServiceVersions && ( <> {authEnabled && ( )} {isVisibleReleaseChannel} This project uses a {isVisibleReleaseChannel} database version release ), isOrioleDb && ( OrioleDB This project uses OrioleDB ), isOnLatestVersion && ( Latest Project is on the latest version of Postgres that Supabase supports ), ]} /> > )} {data.eligible ? ( hasReadReplicas ? ( ) : ( ) ) : null} {!data.eligible ? ( hasObjectsToBeDropped ? ( ) : hasUnsupportedExtensions ? ( ) : hasObjectsInternalSchema ? ( ) : null ) : null} > )} > )} > ) } export default InfrastructureInfo
Service Versions
Information on your provisioned instance