Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Fix incorrect upgrade url

Joshen Lima273311c2d20
diff --git a/studio/components/interfaces/BillingV2/Usage/Activity.tsx b/studio/components/interfaces/BillingV2/Usage/Activity.tsx
index d74652e765c..b24cda8644a 100644
--- a/studio/components/interfaces/BillingV2/Usage/Activity.tsx
+++ b/studio/components/interfaces/BillingV2/Usage/Activity.tsx
@@ -32,10 +32,10 @@ const Activity = ({ projectRef }: ActivityProps) => {
const upgradeUrl =
subscription?.tier.supabase_prod_id === PRICING_TIER_PRODUCT_IDS.ENTERPRISE
- ? `/project/${projectRef}/settings/billing/enterprise`
+ ? `/project/${projectRef}/settings/billing/update/enterprise`
: subscription?.tier.supabase_prod_id === PRICING_TIER_PRODUCT_IDS.TEAM
- ? `/project/${projectRef}/settings/billing/team`
- : `/project/${projectRef}/settings/billing/update`
+ ? `/project/${projectRef}/settings/billing/update/team`
+ : `/project/${projectRef}/settings/billing/update/pro`
const { data: mauData, isLoading: isLoadingMauData } = useDailyStatsQuery({
projectRef,
diff --git a/studio/components/interfaces/BillingV2/Usage/Bandwidth.tsx b/studio/components/interfaces/BillingV2/Usage/Bandwidth.tsx
index ec3973b58e8..0f9e79ea5a5 100644
--- a/studio/components/interfaces/BillingV2/Usage/Bandwidth.tsx
+++ b/studio/components/interfaces/BillingV2/Usage/Bandwidth.tsx
@@ -32,10 +32,10 @@ const Bandwidth = ({ projectRef }: BandwidthProps) => {
const upgradeUrl =
subscription?.tier.supabase_prod_id === PRICING_TIER_PRODUCT_IDS.ENTERPRISE
- ? `/project/${projectRef}/settings/billing/enterprise`
+ ? `/project/${projectRef}/settings/billing/update/enterprise`
: subscription?.tier.supabase_prod_id === PRICING_TIER_PRODUCT_IDS.TEAM
- ? `/project/${projectRef}/settings/billing/team`
- : `/project/${projectRef}/settings/billing/update`
+ ? `/project/${projectRef}/settings/billing/update/team`
+ : `/project/${projectRef}/settings/billing/update/pro`
const { data: dbEgressData, isLoading: isLoadingDbEgressData } = useDailyStatsQuery({
projectRef,
diff --git a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx
index fbd2b232409..7325ccd2032 100644
--- a/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx
+++ b/studio/components/interfaces/BillingV2/Usage/Infrastructure.tsx
@@ -80,9 +80,47 @@ const Infrastructure = ({ projectRef }: InfrastructureProps) => {
return (
<SectionContent key={attribute.key} section={attribute}>
+ {attribute.key === 'disk_io_budget' && (
+ // [Joshen] Eventually should show the overview of the io bandwidth in mbps for burst, baseline and duration
+ <>
+ <div className="space-y-1">
+ <p>What is Disk IO Bandwidth?</p>
+ <p className="text-sm text-scale-1000">
+ Smaller compute instances can burst up to the maximum disk IO bandwidth for 30
+ minutes in a day. Beyond that, the performance reverts to the baseline disk IO
+ bandwidth.
+ </p>
+ </div>
+ {/* <div>
+ <div className="flex items-center justify-between border-b py-1">
+ <p className="text-xs text-scale-1000">
+ Included in {subscription?.tier.name.toLowerCase()}
+ </p>
+ {usageMeta?.limit === -1 ? (
+ <p className="text-xs">None</p>
+ ) : (
+ <p className="text-xs">{(usageMeta?.limit ?? 0).toLocaleString()}</p>
+ )}
+ </div>
+ <div className="flex items-center justify-between border-b py-1">
+ <p className="text-xs text-scale-1000">Used</p>
+ <p className="text-xs">{(usageMeta?.usage ?? 0).toLocaleString()}</p>
+ </div>
+ <div className="flex items-center justify-between py-1">
+ <p className="text-xs text-scale-1000">Extra volume used this month</p>
+ <p className="text-xs">
+ {((usageMeta?.limit ?? 0) === -1 || usageExcess < 0
+ ? 0
+ : usageExcess
+ ).toLocaleString()}
+ </p>
+ </div>
+ </div> */}
+ </>
+ )}
<div className="space-y-1">
{attribute.key === 'disk_io_budget' ? (
- <p>{attribute.name} remaining per day</p>
+ <p>IO Budget remaining each day</p>
) : (
<p>
Max{' '}
diff --git a/studio/components/interfaces/BillingV2/Usage/SizeAndCounts.tsx b/studio/components/interfaces/BillingV2/Usage/SizeAndCounts.tsx
index dcdfdcd1197..e21c2573c4c 100644
--- a/studio/components/interfaces/BillingV2/Usage/SizeAndCounts.tsx
+++ b/studio/components/interfaces/BillingV2/Usage/SizeAndCounts.tsx
@@ -33,10 +33,10 @@ const SizeAndCounts = ({ projectRef }: SizeAndCountsProps) => {
const upgradeUrl =
subscription?.tier.supabase_prod_id === PRICING_TIER_PRODUCT_IDS.ENTERPRISE
- ? `/project/${projectRef}/settings/billing/enterprise`
+ ? `/project/${projectRef}/settings/billing/update/enterprise`
: subscription?.tier.supabase_prod_id === PRICING_TIER_PRODUCT_IDS.TEAM
- ? `/project/${projectRef}/settings/billing/team`
- : `/project/${projectRef}/settings/billing/update`
+ ? `/project/${projectRef}/settings/billing/update/team`
+ : `/project/${projectRef}/settings/billing/update/pro`
const { data: dbSizeData, isLoading: isLoadingDbSizeData } = useDailyStatsQuery({
projectRef,
@@ -65,16 +65,19 @@ const SizeAndCounts = ({ projectRef }: SizeAndCountsProps) => {
const chartMeta: any = {
db_size: {
isLoading: isLoadingDbSizeData,
+ margin: 14,
data: dbSizeData?.data ?? [],
showLastUpdated: dbSizeData?.hasNoData === false,
},
storage_size: {
isLoading: isLoadingStorageSizeData,
+ margin: 14,
data: storageSizeData?.data ?? [],
showLastUpdated: storageSizeData?.hasNoData === false,
},
func_count: {
isLoading: isLoadingFunctionCountData,
+ margin: 0,
data: functionCountData?.data ?? [],
showLastUpdated: functionCountData?.hasNoData === false,
},
@@ -224,7 +227,7 @@ const SizeAndCounts = ({ projectRef }: SizeAndCountsProps) => {
attribute={attribute.attribute}
data={chartData}
yLimit={usageMeta?.limit ?? 0}
- yLeftMargin={14}
+ yLeftMargin={chartMeta[attribute.key].margin}
yFormatter={(value) =>
attribute.unit === 'bytes'
? formatBytes(value, 1, 'GB').replace(/\s/g, '')
diff --git a/studio/components/interfaces/BillingV2/Usage/Usage.tsx b/studio/components/interfaces/BillingV2/Usage/Usage.tsx
index 77fbf4f1d34..184ee892bc1 100644
--- a/studio/components/interfaces/BillingV2/Usage/Usage.tsx
+++ b/studio/components/interfaces/BillingV2/Usage/Usage.tsx
@@ -13,6 +13,7 @@ import Infrastructure from './Infrastructure'
import SizeAndCounts from './SizeAndCounts'
import { USAGE_CATEGORIES, USAGE_STATUS } from './Usage.constants'
import { getUsageStatus } from './Usage.utils'
+import dayjs from 'dayjs'
const Usage = () => {
const { ref } = useParams()
@@ -29,6 +30,9 @@ const Usage = () => {
projectRef: selectedProjectRef,
})
+ const billingCycleStart = dayjs.unix(subscription?.billing?.current_period_start ?? 0).utc()
+ const billingCycleEnd = dayjs.unix(subscription?.billing?.current_period_end ?? 0).utc()
+
const scrollTo = (id: 'infra' | 'bandwidth' | 'sizeCount' | 'activity') => {
switch (id) {
case 'infra':
@@ -75,6 +79,7 @@ const Usage = () => {
<ShimmeringLoader className="w-[200px]" />
) : (
<Listbox
+ disabled
size="small"
id="projectRef"
name="projectRef"
@@ -97,9 +102,14 @@ const Usage = () => {
{isLoadingSubscription ? (
<IconLoader className="animate-spin" size={14} />
) : subscription !== undefined ? (
- <p className={clsx('text-sm transition', isLoadingSubscription && 'opacity-50')}>
- Project is on {subscription.tier.name}
- </p>
+ <div>
+ <p className={clsx('text-sm transition', isLoadingSubscription && 'opacity-50')}>
+ Project is on {subscription.tier.name}
+ </p>
+ <p className="text-xs text-scale-1000">
+ {billingCycleStart.format('DD MMM YY')} - {billingCycleEnd.format('DD MMM YY')}
+ </p>
+ </div>
) : null}
</div>
<div className="flex items-center space-x-2">
@@ -127,7 +137,7 @@ const Usage = () => {
className="flex items-center opacity-50 space-x-2 py-3 hover:opacity-100 transition cursor-pointer"
>
{status === USAGE_STATUS.NORMAL ? (
- <IconCheckCircle size={15} strokeWidth={2} className="text-brand-900" />
+ <IconCheckCircle size={15} strokeWidth={2} className="text-scale-1100" />
) : status === USAGE_STATUS.APPROACHING ? (
<IconAlertCircle size={15} strokeWidth={2} className="text-amber-900" />
) : status === USAGE_STATUS.EXCEEDED ? (