fix z-index

pull/22091/head
JzoNg 11 months ago
parent f4ed447f39
commit 454d1c0a73

@ -29,7 +29,7 @@ type Props = {
schema: CredentialFormSchema schema: CredentialFormSchema
value: ToolVarInputs value: ToolVarInputs
onChange: (value: any) => void onChange: (value: any) => void
hideTypeSwitch?: boolean inPanel?: boolean
} }
const FormInputItem: FC<Props> = ({ const FormInputItem: FC<Props> = ({
@ -38,7 +38,7 @@ const FormInputItem: FC<Props> = ({
schema, schema,
value, value,
onChange, onChange,
hideTypeSwitch, inPanel,
}) => { }) => {
const { t } = useTranslation() const { t } = useTranslation()
const language = useLanguage() const language = useLanguage()
@ -192,7 +192,7 @@ const FormInputItem: FC<Props> = ({
return ( return (
<div className={cn('gap-1', !(isShowJSONEditor && isConstant) && 'flex')}> <div className={cn('gap-1', !(isShowJSONEditor && isConstant) && 'flex')}>
{showTypeSwitch && !hideTypeSwitch && ( {showTypeSwitch && (
<FormInputTypeSwitch value={varInput?.type || VarKindType.constant} onChange={handleTypeChange}/> <FormInputTypeSwitch value={varInput?.type || VarKindType.constant} onChange={handleTypeChange}/>
)} )}
{isString && ( {isString && (
@ -274,6 +274,7 @@ const FormInputItem: FC<Props> = ({
)} )}
{showVariableSelector && ( {showVariableSelector && (
<VarReferencePicker <VarReferencePicker
zIndex={inPanel ? 1000 : undefined}
className='h-8 grow' className='h-8 grow'
readonly={readOnly} readonly={readOnly}
isShowNodeName isShowNodeName

@ -11,6 +11,7 @@ type Props = {
value: ToolVarInputs value: ToolVarInputs
onChange: (value: ToolVarInputs) => void onChange: (value: ToolVarInputs) => void
onOpen?: (index: number) => void onOpen?: (index: number) => void
inPanel?: boolean
} }
const ToolForm: FC<Props> = ({ const ToolForm: FC<Props> = ({
@ -19,6 +20,7 @@ const ToolForm: FC<Props> = ({
schema, schema,
value, value,
onChange, onChange,
inPanel,
}) => { }) => {
return ( return (
<div className='space-y-1'> <div className='space-y-1'>
@ -31,6 +33,7 @@ const ToolForm: FC<Props> = ({
schema={schema} schema={schema}
value={value} value={value}
onChange={onChange} onChange={onChange}
inPanel={inPanel}
/> />
)) ))
} }

@ -19,6 +19,7 @@ type Props = {
schema: CredentialFormSchema schema: CredentialFormSchema
value: ToolVarInputs value: ToolVarInputs
onChange: (value: ToolVarInputs) => void onChange: (value: ToolVarInputs) => void
inPanel?: boolean
} }
const ToolFormItem: FC<Props> = ({ const ToolFormItem: FC<Props> = ({
@ -27,6 +28,7 @@ const ToolFormItem: FC<Props> = ({
schema, schema,
value, value,
onChange, onChange,
inPanel,
}) => { }) => {
const language = useLanguage() const language = useLanguage()
const { name, label, type, required, tooltip, input_schema } = schema const { name, label, type, required, tooltip, input_schema } = schema
@ -78,6 +80,7 @@ const ToolFormItem: FC<Props> = ({
schema={schema} schema={schema}
value={value} value={value}
onChange={onChange} onChange={onChange}
inPanel={inPanel}
/> />
{isShowSchema && ( {isShowSchema && (

Loading…
Cancel
Save