mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 20:35:07 +03:00
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES ## What kind of change does this PR introduce? New UI to help users create partitioned queues when supported with pg_partman. Updated the existing UI from 2024 to be a bit more user friendly ## Walkthrough **Extension management page** <img width="1575" height="155" alt="image" src="https://github.com/user-attachments/assets/4b1895cf-4555-40c5-8a11-54208748b169" /> **pg partman call out in queues** <img width="664" height="771" alt="image" src="https://github.com/user-attachments/assets/92feff48-72bb-4816-b0aa-e24e70fa148e" /> **Updated recommended section with sane defaults** <img width="663" height="918" alt="image" src="https://github.com/user-attachments/assets/716d9411-f708-4b4d-8027-7ca7a41062c8" /> **Warning on disabling extension** <img width="431" height="392" alt="image" src="https://github.com/user-attachments/assets/129ab1eb-2bcc-49ca-a20c-72422460c60e" /> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
56 lines
1.8 KiB
TypeScript
56 lines
1.8 KiB
TypeScript
import { UseFormReturn } from 'react-hook-form'
|
|
import { FormField_Shadcn_, Input, Separator, SheetSection } from 'ui'
|
|
import { FormItemLayout } from 'ui-patterns/form/FormItemLayout/FormItemLayout'
|
|
|
|
import { CreateQueueForm } from './CreateQueueSheet.schema'
|
|
|
|
export function PartitionConfigFields({ form }: { form: UseFormReturn<CreateQueueForm> }) {
|
|
const queueType = form.watch('values.type')
|
|
|
|
if (queueType !== 'partitioned') return null
|
|
|
|
return (
|
|
<>
|
|
<SheetSection className="flex flex-col gap-3">
|
|
<FormField_Shadcn_
|
|
control={form.control}
|
|
name="values.partitionInterval"
|
|
render={({ field: { ref, ...rest } }) => (
|
|
<FormItemLayout
|
|
label="Partition interval"
|
|
description="Number of messages per partition"
|
|
className="gap-1"
|
|
>
|
|
<Input
|
|
{...rest}
|
|
type="number"
|
|
placeholder="10000"
|
|
actions={<p className="text-foreground-light pr-2">messages</p>}
|
|
/>
|
|
</FormItemLayout>
|
|
)}
|
|
/>
|
|
<FormField_Shadcn_
|
|
control={form.control}
|
|
name="values.retentionInterval"
|
|
render={({ field: { ref, ...rest } }) => (
|
|
<FormItemLayout
|
|
label="Retention interval"
|
|
description="Partitions older than this many messages behind the latest will be dropped"
|
|
className="gap-1"
|
|
>
|
|
<Input
|
|
{...rest}
|
|
type="number"
|
|
placeholder="100000"
|
|
actions={<p className="text-foreground-light pr-2">messages</p>}
|
|
/>
|
|
</FormItemLayout>
|
|
)}
|
|
/>
|
|
</SheetSection>
|
|
<Separator />
|
|
</>
|
|
)
|
|
}
|