mirror of
https://github.com/supabase/supabase.git
synced 2026-05-06 08:56:46 -04:00
chore: cleanup changes from merge into master
This commit is contained in:
@@ -156,7 +156,6 @@ export const USAGE_CATEGORIES: CategoryMeta[] = [
|
||||
|
||||
const isApproachingLimit = hasLimit && usageRatio >= USAGE_APPROACHING_THRESHOLD
|
||||
const isExceededLimit = hasLimit && usageRatio >= 1
|
||||
console.log({ usageMeta, isApproachingLimit, isExceededLimit })
|
||||
|
||||
return subscription?.plan?.id !== 'free' ? (
|
||||
<div>
|
||||
@@ -177,10 +176,10 @@ export const USAGE_CATEGORIES: CategoryMeta[] = [
|
||||
</Link>
|
||||
</div>
|
||||
<p className="text-sm text-scale-1000 mt-3">
|
||||
Your disk storage expands automatically when the database reaches 90% of the disk
|
||||
size. The disk is expanded to be 50% larger. Auto-scaling can only take place once
|
||||
every 6 hours. If you reach 95% of the disk space, your project will enter read-only
|
||||
mode. You can also{' '}
|
||||
If you reach 95% of the disk space, your project will enter read-only mode. Your
|
||||
disk storage expands automatically when the database reaches 90% of the disk size.
|
||||
The disk is expanded to be 50% larger. Auto-scaling can only take place once every 6
|
||||
hours. You can also{' '}
|
||||
<Link passHref href={`/project/${ref}/settings/database#diskManagement`}>
|
||||
<a className="text-brand-900 transition hover:text-brand-1000">preprovision</a>
|
||||
</Link>{' '}
|
||||
@@ -324,8 +323,8 @@ export const USAGE_CATEGORIES: CategoryMeta[] = [
|
||||
chartDescription: 'The data refreshes every 24 hours.',
|
||||
links: [
|
||||
{
|
||||
name: 'Realtime Rate Limits',
|
||||
url: 'https://supabase.com/docs/guides/realtime/rate-limits',
|
||||
name: 'Realtime Quotas',
|
||||
url: 'https://supabase.com/docs/guides/realtime/quotas',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -341,8 +340,8 @@ export const USAGE_CATEGORIES: CategoryMeta[] = [
|
||||
chartDescription: 'The data refreshes every 24 hours.',
|
||||
links: [
|
||||
{
|
||||
name: 'Realtime Rate Limits',
|
||||
url: 'https://supabase.com/docs/guides/realtime/rate-limits',
|
||||
name: 'Realtime Quotas',
|
||||
url: 'https://supabase.com/docs/guides/realtime/quotas',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -148,7 +148,7 @@ const UsageSection = ({
|
||||
barClass={clsx(
|
||||
usageRatio >= 1
|
||||
? usageBasedBilling
|
||||
? 'bg-amber-900'
|
||||
? 'bg-scale-1100'
|
||||
: 'bg-red-900'
|
||||
: usageBasedBilling === false &&
|
||||
usageRatio >= USAGE_APPROACHING_THRESHOLD
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
import { useMutation, UseMutationOptions, useQueryClient } from '@tanstack/react-query'
|
||||
import { patch } from 'lib/common/fetch'
|
||||
import { API_ADMIN_URL } from 'lib/constants'
|
||||
import { edgeFunctionsKeys } from './keys'
|
||||
|
||||
export type EdgeFunctionsUpdateVariables = {
|
||||
projectRef: string
|
||||
slug: string
|
||||
payload: {
|
||||
name?: string
|
||||
verifyJwt?: boolean
|
||||
importMap?: boolean
|
||||
}
|
||||
}
|
||||
|
||||
export async function updateEdgeFunction({
|
||||
projectRef,
|
||||
slug,
|
||||
payload,
|
||||
}: EdgeFunctionsUpdateVariables) {
|
||||
if (!projectRef) throw new Error('projectRef is required')
|
||||
|
||||
const response = await patch(`${API_ADMIN_URL}/projects/${projectRef}/functions/${slug}`, payload)
|
||||
if (response.error) throw response.error
|
||||
|
||||
return response
|
||||
}
|
||||
|
||||
type EdgeFunctionsUpdateData = Awaited<ReturnType<typeof updateEdgeFunction>>
|
||||
|
||||
export const useEdgeFunctionUpdateMutation = ({
|
||||
onSuccess,
|
||||
...options
|
||||
}: Omit<
|
||||
UseMutationOptions<EdgeFunctionsUpdateData, unknown, EdgeFunctionsUpdateVariables>,
|
||||
'mutationFn'
|
||||
> = {}) => {
|
||||
const queryClient = useQueryClient()
|
||||
|
||||
return useMutation<EdgeFunctionsUpdateData, unknown, EdgeFunctionsUpdateVariables>(
|
||||
(vars) => updateEdgeFunction(vars),
|
||||
{
|
||||
async onSuccess(data, variables, context) {
|
||||
const { projectRef, slug } = variables
|
||||
await queryClient.invalidateQueries(edgeFunctionsKeys.detail(projectRef, slug))
|
||||
await onSuccess?.(data, variables, context)
|
||||
},
|
||||
...options,
|
||||
}
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user