- Allows you to setup several configurations for Realtime, including configuration channel
- restrictions where you can enable or disable public channels from being able to connect.
- Learn more about how Realtime Authorization works{' '}
-
Enabling this preview will:
-Query pattern
-{x.name}
-{formattedValue}
-{x.name}
+ {percentage && totalTime ? ( ++ + {percentage.toFixed(1)}% + {' '} + /{' '} + + {formatDuration(totalTime / 1000)} + +
+ ) : ( +–
+ )} +{x.name}
+ {typeof rawValue === 'number' && !isNaN(rawValue) && isFinite(rawValue) ? ( ++ {rawValue.toLocaleString()} +
+ ) : ( +–
+ )} +{x.name}
+ {typeof rawValue === 'string' ? ( ++ {cacheHitRateToNumber(rawValue).toLocaleString(undefined, { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + })} + % +
+ ) : ( +–
+ )} +{x.name}
++ {formattedValue} +
+- {value.toFixed(1)}% -
- ) : ( -–
- )} -- {(value / 1000).toLocaleString(undefined, { - minimumFractionDigits: 2, - maximumFractionDigits: 2, - })} - s -
+ {percentage && totalTime ? ( + + + {percentage.toFixed(1)}% + {' '} + / + + {(totalTime / 1000).toLocaleString(undefined, { + minimumFractionDigits: 2, + maximumFractionDigits: 2, + })} + s + + ) : (–
)} diff --git a/apps/studio/components/interfaces/Realtime/RealtimeSettings.tsx b/apps/studio/components/interfaces/Realtime/RealtimeSettings.tsx index c755fb5118572..b7b4b05a9e520 100644 --- a/apps/studio/components/interfaces/Realtime/RealtimeSettings.tsx +++ b/apps/studio/components/interfaces/Realtime/RealtimeSettings.tsx @@ -40,11 +40,12 @@ const formId = 'realtime-configuration-form' export const RealtimeSettings = () => { const { ref: projectRef } = useParams() const { data: project } = useSelectedProjectQuery() - const { data: organization } = useSelectedOrganizationQuery() - const { can: canUpdateConfig } = useAsyncCheckPermissions( - PermissionAction.REALTIME_ADMIN_READ, - '*' - ) + const { data: organization, isSuccess: isSuccessOrganization } = useSelectedOrganizationQuery() + const { + can: canUpdateConfig, + isLoading: isLoadingPermissions, + isSuccess: isPermissionsLoaded, + } = useAsyncCheckPermissions(PermissionAction.REALTIME_ADMIN_READ, '*') const { data: maxConn } = useMaxConnectionsQuery({ projectRef: project?.ref, @@ -134,7 +135,11 @@ export const RealtimeSettings = () => { className="!p-0 !pt-2" header={You need additional permissions to update realtime settings
diff --git a/apps/studio/components/layouts/RealtimeLayout/RealtimeLayout.tsx b/apps/studio/components/layouts/RealtimeLayout/RealtimeLayout.tsx index e4cef928a7312..004a528e6b431 100644 --- a/apps/studio/components/layouts/RealtimeLayout/RealtimeLayout.tsx +++ b/apps/studio/components/layouts/RealtimeLayout/RealtimeLayout.tsx @@ -1,11 +1,9 @@ import { useRouter } from 'next/router' import { PropsWithChildren } from 'react' -import { useIsRealtimeSettingsEnabled } from 'components/interfaces/App/FeaturePreview/FeaturePreviewContext' import { ProductMenu } from 'components/ui/ProductMenu' import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject' import { withAuth } from 'hooks/misc/withAuth' -import { useIsRealtimeSettingsFFEnabled } from 'hooks/ui/useFlag' import ProjectLayout from '../ProjectLayout/ProjectLayout' import { generateRealtimeMenu } from './RealtimeMenu.utils' @@ -15,10 +13,6 @@ export interface RealtimeLayoutProps { const RealtimeLayout = ({ title, children }: PropsWithChildren