diff --git a/studio/components/interfaces/BillingV2/Usage/Usage.constants.tsx b/studio/components/interfaces/BillingV2/Usage/Usage.constants.tsx index 30ae0d4cc3c..b876fb1fc66 100644 --- a/studio/components/interfaces/BillingV2/Usage/Usage.constants.tsx +++ b/studio/components/interfaces/BillingV2/Usage/Usage.constants.tsx @@ -243,6 +243,12 @@ export const USAGE_CATEGORIES: CategoryMeta[] = [ description: "Count of messages going through Realtime.\nUsage example: If you do a database change and 5 clients listen to that change via Realtime, that's 5 messages. If you broadcast a message and 4 clients listen to that, that's 5 messages (1 message sent, 4 received).\nBilling is based on the total amount of messages throughout your billing period.", chartDescription: 'The data refreshes every 24 hours.', + links: [ + { + name: 'Realtime Rate Limits', + url: 'https://supabase.com/docs/guides/realtime/rate-limits', + }, + ], }, { anchor: 'realtimePeakConnection', @@ -254,6 +260,12 @@ export const USAGE_CATEGORIES: CategoryMeta[] = [ description: 'Total number of successful connections. Connections attempts are not counted towards usage.\nBilling is based on the maximum amount of concurrent peak connections throughout your billing period.', chartDescription: 'The data refreshes every 24 hours.', + links: [ + { + name: 'Realtime Rate Limits', + url: 'https://supabase.com/docs/guides/realtime/rate-limits', + }, + ], }, ], }, diff --git a/studio/components/interfaces/BillingV2/Usage/UsageSection.tsx b/studio/components/interfaces/BillingV2/Usage/UsageSection.tsx index d30c3d8d6ad..7ccc83cf579 100644 --- a/studio/components/interfaces/BillingV2/Usage/UsageSection.tsx +++ b/studio/components/interfaces/BillingV2/Usage/UsageSection.tsx @@ -68,166 +68,199 @@ const UsageSection = ({ return (
{attribute.name} usage
- {currentBillingCycleSelected && - usageBasedBilling === false && - usageRatio >= USAGE_APPROACHING_THRESHOLD && ( -Exceeded limit
-Approaching limit
-- Exceeding your plans included usage will lead to restrictions to - your project. -
-- Upgrade to a usage-based plan or disable the spend cap to avoid - restrictions. -
-{attribute.name} usage
+ {currentBillingCycleSelected && + usageBasedBilling === false && + usageRatio >= USAGE_APPROACHING_THRESHOLD && ( ++ Exceeded limit +
+Approaching limit
++ Exceeding your plans included usage will lead to restrictions + to your project. +
++ Upgrade to a usage-based plan or disable the spend cap to + avoid restrictions. +
+- Included in {subscription?.plan?.name.toLowerCase()} plan -
-- {attribute.unit === 'bytes' - ? formatBytes(usageMeta?.limit ?? 0) - : (usageMeta?.limit ?? 0).toLocaleString()} -
-- {attribute.chartPrefix || 'Used '}in period -
-- {attribute.unit === 'bytes' - ? formatBytes(usageMeta?.usage ?? 0) - : (usageMeta?.usage ?? 0).toLocaleString()} -
-Overage in period
-- {usageExcess < 0 - ? attribute.unit === 'bytes' - ? formatBytes(0) - : 0 - : attribute.unit === 'bytes' - ? formatBytes(usageExcess) - : usageExcess.toLocaleString()} -
+ {currentBillingCycleSelected && + !usageBasedBilling && + usageRatio >= USAGE_APPROACHING_THRESHOLD && ( + + + + + + )}+ Included in {subscription?.plan?.name.toLowerCase()} plan +
+ {usageMeta?.limit === -1 ? ( +None
+ ) : usageMeta?.limit === 0 ? ( +Unlimited
+ ) : ( ++ {attribute.unit === 'bytes' + ? formatBytes(usageMeta?.limit ?? 0) + : (usageMeta?.limit ?? 0).toLocaleString()} +
+ )} ++ {attribute.chartPrefix || 'Used '}in period +
++ {attribute.unit === 'bytes' + ? formatBytes(usageMeta?.usage ?? 0) + : (usageMeta?.usage ?? 0).toLocaleString()} +
+Overage in period
++ {(usageMeta?.limit ?? 0) === -1 || usageExcess < 0 + ? 0 + : attribute.unit === 'bytes' + ? formatBytes(usageExcess) + : usageExcess.toLocaleString()} +
++ {attribute.chartPrefix || ''} + {attribute.name} per day +
+ {attribute.chartDescription.split('\n').map((paragraph, idx) => ( ++ {paragraph} +
+ ))} +No data in period
+May take up to 24 hours to show
+- {attribute.chartPrefix || ''} - {attribute.name} per day -
- {attribute.chartDescription.split('\n').map((paragraph, idx) => ( -- {paragraph} -
- ))} -No data in period
-May take up to 24 hours to show
+Not included in plan
++ You need to be on a higher plan in order to use this feature. +
+