feat: tools readonly

This commit is contained in:
Joel 2024-03-20 16:56:09 +08:00
parent 0aa984219f
commit 8f311b020a
3 changed files with 4 additions and 2 deletions

View File

@ -62,7 +62,7 @@ const TypeSelector: FC<Props> = ({
onClick={toggleShow}
className={cn(showOption && 'bg-black/5', 'flex items-center h-5 pl-1 pr-0.5 rounded-md text-xs font-semibold text-gray-700 cursor-pointer hover:bg-black/5')}>
<div className={cn(triggerClassName, 'text-sm font-semibold', uppercase && 'uppercase', noValue && 'text-gray-400')}>{!noValue ? item?.label : placeholder}</div>
<DropDownIcon className='w-3 h-3 ' />
{!readonly && <DropDownIcon className='w-3 h-3 ' />}
</div>
)}

View File

@ -198,6 +198,7 @@ const VarReferencePicker: FC<Props> = ({
<TypeSelector
noLeft
triggerClassName='!text-xs'
readonly={readonly}
DropDownIcon={ChevronDown}
value={varKindType}
options={varKindTypes}
@ -217,6 +218,7 @@ const VarReferencePicker: FC<Props> = ({
onChange={handleStaticChange}
onFocus={() => setIsFocus(true)}
onBlur={() => setIsFocus(false)}
readOnly={readonly}
/>
)
: (

View File

@ -22,9 +22,9 @@ const Panel: FC<NodePanelProps<ToolNodeType>> = ({
data,
}) => {
const { t } = useTranslation()
const readOnly = false
const {
readOnly,
inputs,
toolInputVarSchema,
setInputVar,