import type { FC } from 'react' import React from 'react' import { useTranslation } from 'react-i18next' import useConfig from './use-config' import ApiInput from './components/api-input' import KeyValue from './components/key-value' import EditBody from './components/edit-body' import AuthorizationModal from './components/authorization' import type { HttpNodeType } from './types' import VarList from '@/app/components/workflow/nodes/_base/components/variable/var-list' import Field from '@/app/components/workflow/nodes/_base/components/field' import AddButton from '@/app/components/base/button/add-button' import Split from '@/app/components/workflow/nodes/_base/components/split' import OutputVars, { VarItem } from '@/app/components/workflow/nodes/_base/components/output-vars' import { Settings01 } from '@/app/components/base/icons/src/vender/line/general' import type { NodePanelProps } from '@/app/components/workflow/types' import BeforeRunForm from '@/app/components/workflow/nodes/_base/components/before-run-form' import ResultPanel from '@/app/components/workflow/run/result-panel' const i18nPrefix = 'workflow.nodes.http' const Panel: FC> = ({ id, data, }) => { const { t } = useTranslation() const readOnly = false const { inputs, handleVarListChange, handleAddVariable, filterVar, handleMethodChange, handleUrlChange, headers, setHeaders, addHeader, isHeaderKeyValueEdit, toggleIsHeaderKeyValueEdit, params, setParams, addParam, isParamKeyValueEdit, toggleIsParamKeyValueEdit, setBody, isShowAuthorization, showAuthorization, hideAuthorization, setAuthorization, // single run isShowSingleRun, hideSingleRun, runningStatus, handleRun, handleStop, varInputs, inputVarValues, setInputVarValues, runResult, } = useConfig(id, data) // console.log(inputs) return (
} >
{t(`${i18nPrefix}.authorization.authorization`)} {t(`${i18nPrefix}.authorization.${inputs.authorization.type}`)}
} >
{isShowAuthorization && ( )}
<>
{isShowSingleRun && ( } /> )} ) } export default React.memo(Panel)