mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:28:10 +08:00
Merge branch 'main' into feat/tool-oauth
This commit is contained in:
@ -462,6 +462,7 @@ const formatItem = (
|
||||
return {
|
||||
variable: `env.${env.name}`,
|
||||
type: env.value_type,
|
||||
description: env.description,
|
||||
}
|
||||
}) as Var[]
|
||||
break
|
||||
@ -472,7 +473,7 @@ const formatItem = (
|
||||
return {
|
||||
variable: `conversation.${chatVar.name}`,
|
||||
type: chatVar.value_type,
|
||||
des: chatVar.description,
|
||||
description: chatVar.description,
|
||||
}
|
||||
}) as Var[]
|
||||
break
|
||||
|
||||
@ -22,6 +22,7 @@ const nodeDefault: NodeDefault<HttpNodeType> = {
|
||||
type: BodyType.none,
|
||||
data: [],
|
||||
},
|
||||
ssl_verify: true,
|
||||
timeout: {
|
||||
max_connect_timeout: 0,
|
||||
max_read_timeout: 0,
|
||||
|
||||
@ -10,6 +10,7 @@ import type { HttpNodeType } from './types'
|
||||
import Timeout from './components/timeout'
|
||||
import CurlPanel from './components/curl-panel'
|
||||
import cn from '@/utils/classnames'
|
||||
import Switch from '@/app/components/base/switch'
|
||||
import Field from '@/app/components/workflow/nodes/_base/components/field'
|
||||
import Split from '@/app/components/workflow/nodes/_base/components/split'
|
||||
import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars'
|
||||
@ -47,6 +48,7 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
|
||||
showCurlPanel,
|
||||
hideCurlPanel,
|
||||
handleCurlImport,
|
||||
handleSSLVerifyChange,
|
||||
} = useConfig(id, data)
|
||||
// To prevent prompt editor in body not update data.
|
||||
if (!isDataReady)
|
||||
@ -124,6 +126,18 @@ const Panel: FC<NodePanelProps<HttpNodeType>> = ({
|
||||
onChange={setBody}
|
||||
/>
|
||||
</Field>
|
||||
<Field
|
||||
title={t(`${i18nPrefix}.verifySSL.title`)}
|
||||
tooltip={t(`${i18nPrefix}.verifySSL.warningTooltip`)}
|
||||
operations={
|
||||
<Switch
|
||||
defaultValue={!!inputs.ssl_verify}
|
||||
onChange={handleSSLVerifyChange}
|
||||
size='md'
|
||||
disabled={readOnly}
|
||||
/>
|
||||
}>
|
||||
</Field>
|
||||
</div>
|
||||
<Split />
|
||||
<Timeout
|
||||
|
||||
@ -81,4 +81,5 @@ export type HttpNodeType = CommonNodeType & {
|
||||
body: Body
|
||||
authorization: Authorization
|
||||
timeout: Timeout
|
||||
ssl_verify?: boolean
|
||||
}
|
||||
|
||||
@ -141,6 +141,13 @@ const useConfig = (id: string, payload: HttpNodeType) => {
|
||||
setInputs(newInputs)
|
||||
}, [inputs, setInputs])
|
||||
|
||||
const handleSSLVerifyChange = useCallback((checked: boolean) => {
|
||||
const newInputs = produce(inputs, (draft: HttpNodeType) => {
|
||||
draft.ssl_verify = checked
|
||||
})
|
||||
setInputs(newInputs)
|
||||
}, [inputs, setInputs])
|
||||
|
||||
return {
|
||||
readOnly,
|
||||
isDataReady,
|
||||
@ -164,6 +171,8 @@ const useConfig = (id: string, payload: HttpNodeType) => {
|
||||
toggleIsParamKeyValueEdit,
|
||||
// body
|
||||
setBody,
|
||||
// ssl verify
|
||||
handleSSLVerifyChange,
|
||||
// authorization
|
||||
isShowAuthorization,
|
||||
showAuthorization,
|
||||
|
||||
@ -282,6 +282,11 @@ const Panel: FC<NodePanelProps<LLMNodeType>> = ({
|
||||
type='string'
|
||||
description={t(`${i18nPrefix}.outputVars.output`)}
|
||||
/>
|
||||
<VarItem
|
||||
name='usage'
|
||||
type='object'
|
||||
description={t(`${i18nPrefix}.outputVars.usage`)}
|
||||
/>
|
||||
{inputs.structured_output_enabled && (
|
||||
<>
|
||||
<Split className='mt-3' />
|
||||
|
||||
@ -190,12 +190,17 @@ const Panel: FC<NodePanelProps<ParameterExtractorNodeType>> = ({
|
||||
<VarItem
|
||||
name='__is_success'
|
||||
type={VarType.number}
|
||||
description={t(`${i18nPrefix}.isSuccess`)}
|
||||
description={t(`${i18nPrefix}.outputVars.isSuccess`)}
|
||||
/>
|
||||
<VarItem
|
||||
name='__reason'
|
||||
type={VarType.string}
|
||||
description={t(`${i18nPrefix}.errorReason`)}
|
||||
description={t(`${i18nPrefix}.outputVars.errorReason`)}
|
||||
/>
|
||||
<VarItem
|
||||
name='__usage'
|
||||
type='object'
|
||||
description={t(`${i18nPrefix}.outputVars.usage`)}
|
||||
/>
|
||||
</>
|
||||
</OutputVars>
|
||||
|
||||
@ -129,6 +129,11 @@ const Panel: FC<NodePanelProps<QuestionClassifierNodeType>> = ({
|
||||
type='string'
|
||||
description={t(`${i18nPrefix}.outputVars.className`)}
|
||||
/>
|
||||
<VarItem
|
||||
name='usage'
|
||||
type='object'
|
||||
description={t(`${i18nPrefix}.outputVars.usage`)}
|
||||
/>
|
||||
</>
|
||||
</OutputVars>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user