mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 21:00:58 +03:00
add vector stores
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { useState } from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import { FormControl, Switch } from '@mui/material'
|
||||
|
||||
export const SwitchInput = ({ value, onChange, disabled = false }) => {
|
||||
const [myValue, setMyValue] = useState(!!value ?? false)
|
||||
|
||||
return (
|
||||
<>
|
||||
<FormControl sx={{ mt: 1, width: '100%' }} size='small'>
|
||||
<Switch
|
||||
disabled={disabled}
|
||||
checked={myValue}
|
||||
onChange={(event) => {
|
||||
setMyValue(event.target.checked)
|
||||
onChange(event.target.checked)
|
||||
}}
|
||||
/>
|
||||
</FormControl>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
SwitchInput.propTypes = {
|
||||
value: PropTypes.string,
|
||||
onChange: PropTypes.func,
|
||||
disabled: PropTypes.bool
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import { IconArrowsMaximize } from '@tabler/icons'
|
||||
import { Dropdown } from 'ui-component/dropdown/Dropdown'
|
||||
import { Input } from 'ui-component/input/Input'
|
||||
import { File } from 'ui-component/file/File'
|
||||
import { SwitchInput } from 'ui-component/switch/Switch'
|
||||
import { flowContext } from 'store/context/ReactFlowContext'
|
||||
import { isValidConnection, getAvailableNodesForVariable } from 'utils/genericHelper'
|
||||
|
||||
@@ -146,6 +147,13 @@ const NodeInputHandler = ({ inputAnchor, inputParam, data, disabled = false }) =
|
||||
value={data.inputs[inputParam.name] ?? inputParam.default ?? 'Choose a file to upload'}
|
||||
/>
|
||||
)}
|
||||
{inputParam.type === 'boolean' && (
|
||||
<SwitchInput
|
||||
disabled={disabled}
|
||||
onChange={(newValue) => (data.inputs[inputParam.name] = newValue)}
|
||||
value={data.inputs[inputParam.name] ?? inputParam.default ?? false}
|
||||
/>
|
||||
)}
|
||||
{(inputParam.type === 'string' || inputParam.type === 'password' || inputParam.type === 'number') && (
|
||||
<Input
|
||||
disabled={disabled}
|
||||
|
||||
Reference in New Issue
Block a user