mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-24 23:46:52 +08:00
Feat: add s3-compatible storage boxes (#11313)
### What problem does this PR solve? PR for implementing s3 compatible storage units #11240 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -67,6 +67,7 @@ export interface FormFieldConfig {
|
||||
) => string | boolean | Promise<string | boolean>;
|
||||
dependencies?: string[];
|
||||
schema?: ZodSchema;
|
||||
shouldRender?: (formValues: any) => boolean;
|
||||
}
|
||||
|
||||
// Component props interface
|
||||
@ -654,6 +655,9 @@ const DynamicForm = {
|
||||
}
|
||||
};
|
||||
|
||||
// Watch all form values to re-render when they change (for shouldRender checks)
|
||||
const formValues = form.watch();
|
||||
|
||||
return (
|
||||
<Form {...form}>
|
||||
<form
|
||||
@ -664,11 +668,19 @@ const DynamicForm = {
|
||||
}}
|
||||
>
|
||||
<>
|
||||
{fields.map((field) => (
|
||||
<div key={field.name} className={cn({ hidden: field.hidden })}>
|
||||
{renderField(field)}
|
||||
</div>
|
||||
))}
|
||||
{fields.map((field) => {
|
||||
const shouldShow = field.shouldRender
|
||||
? field.shouldRender(formValues)
|
||||
: true;
|
||||
return (
|
||||
<div
|
||||
key={field.name}
|
||||
className={cn({ hidden: field.hidden || !shouldShow })}
|
||||
>
|
||||
{renderField(field)}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
{children}
|
||||
</>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user