mirror of
https://github.com/supabase/supabase.git
synced 2026-10-08 19:05:06 +03:00
Frontend changes for new privatelink functionality. The updates to the API are already live, but will be putting the UI changes behind a feature flag while we do some full end to end testing. Changes to Integration page: <img width="744" height="456" alt="image" src="https://github.com/user-attachments/assets/02026083-4b61-4f36-927b-1bac42cb73e2" /> Changes to create associations page: <img width="859" height="411" alt="image" src="https://github.com/user-attachments/assets/303b4ec5-3b5a-4eaf-8d22-45e1e63a0705" /> Fixes SEC-919 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - AWS PrivateLink connections can target the primary database or a read replica. - Connection lists and confirmation dialogs now identify the selected database clearly. - Replica details include improved status information and a “Manage replica” link. - **Bug Fixes** - Replica removal errors now provide clearer guidance and link to integration settings when PrivateLink issues occur. - **Updates** - Infrastructure diagrams focus on visualization, with replica management actions moved to dedicated management views. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
64 lines
1.5 KiB
TypeScript
64 lines
1.5 KiB
TypeScript
import { REPLICA_STATUS } from '../Replication.constants'
|
|
import { ReplicaInitializationStatus } from '@/data/read-replicas/replicas-status-query'
|
|
|
|
export const getIsInTransition = ({
|
|
initStatus,
|
|
status,
|
|
}: {
|
|
initStatus?: string
|
|
status?: string
|
|
}) => {
|
|
return (
|
|
(
|
|
[
|
|
REPLICA_STATUS.UNKNOWN,
|
|
REPLICA_STATUS.COMING_UP,
|
|
REPLICA_STATUS.GOING_DOWN,
|
|
REPLICA_STATUS.RESTORING,
|
|
REPLICA_STATUS.RESTARTING,
|
|
REPLICA_STATUS.RESIZING,
|
|
REPLICA_STATUS.INIT_READ_REPLICA,
|
|
] as string[]
|
|
).includes(status ?? '') || initStatus === ReplicaInitializationStatus.InProgress
|
|
)
|
|
}
|
|
|
|
export const getStatusLabel = ({
|
|
initStatus,
|
|
status,
|
|
}: {
|
|
initStatus?: string
|
|
status?: string
|
|
}) => {
|
|
if (
|
|
initStatus === ReplicaInitializationStatus.InProgress ||
|
|
status === REPLICA_STATUS.COMING_UP ||
|
|
status === REPLICA_STATUS.UNKNOWN ||
|
|
status === REPLICA_STATUS.INIT_READ_REPLICA
|
|
) {
|
|
return 'Coming up'
|
|
}
|
|
|
|
if (
|
|
initStatus === ReplicaInitializationStatus.Failed ||
|
|
status === REPLICA_STATUS.INIT_READ_REPLICA_FAILED
|
|
) {
|
|
return 'Failed'
|
|
}
|
|
|
|
switch (status) {
|
|
case REPLICA_STATUS.GOING_DOWN:
|
|
return 'Going down'
|
|
case REPLICA_STATUS.RESTARTING:
|
|
return 'Restarting'
|
|
case REPLICA_STATUS.RESIZING:
|
|
return 'Resizing'
|
|
case REPLICA_STATUS.RESTORING:
|
|
return 'Restoring'
|
|
case REPLICA_STATUS.ACTIVE_HEALTHY:
|
|
return 'Healthy'
|
|
default:
|
|
return 'Unhealthy'
|
|
}
|
|
}
|