diff --git a/web/app/components/workflow/nodes/http/components/authorization/index.tsx b/web/app/components/workflow/nodes/http/components/authorization/index.tsx index dd00077dab..a31a2d1f58 100644 --- a/web/app/components/workflow/nodes/http/components/authorization/index.tsx +++ b/web/app/components/workflow/nodes/http/components/authorization/index.tsx @@ -1,5 +1,6 @@ 'use client' import type { FC } from 'react' +import { useTranslation } from 'react-i18next' import React, { useCallback } from 'react' import produce from 'immer' import type { Authorization as AuthorizationPayloadType } from '../../types' @@ -7,6 +8,9 @@ import { APIType, AuthorizationType } from '../../types' import RadioGroup from './radio-group' import Modal from '@/app/components/base/modal' import Button from '@/app/components/base/button' + +const i18nPrefix = 'workflow.nodes.http.authorization' + type Props = { payload: AuthorizationPayloadType onChange: (newPayload: AuthorizationPayloadType) => void @@ -29,6 +33,8 @@ const Authorization: FC = ({ isShow, onHide, }) => { + const { t } = useTranslation() + const [tempPayload, setTempPayload] = React.useState(payload) const handleAuthTypeChange = useCallback((type: string) => { const newPayload = produce(tempPayload, (draft: AuthorizationPayloadType) => { @@ -84,11 +90,11 @@ const Authorization: FC = ({ >
- + = ({ {tempPayload.type === AuthorizationType.apiKey && ( <> - + {tempPayload.config?.type === APIType.custom && ( - + = ({ )} - + = ({ )}
- - + +
diff --git a/web/app/components/workflow/nodes/http/panel.tsx b/web/app/components/workflow/nodes/http/panel.tsx index 073f8a3a28..f6f29c5f8d 100644 --- a/web/app/components/workflow/nodes/http/panel.tsx +++ b/web/app/components/workflow/nodes/http/panel.tsx @@ -11,6 +11,7 @@ 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' const i18nPrefix = 'workflow.nodes.http' const Panel: FC = () => { @@ -60,9 +61,13 @@ const Panel: FC = () => { operations={
- API-KEY + +
+ {t(`${i18nPrefix}.authorization.authorization`)} + {t(`${i18nPrefix}.authorization.${inputs.authorization.type}`)} +
} > diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts index 4cada7f7b8..23c6f912af 100644 --- a/web/i18n/en-US/workflow.ts +++ b/web/i18n/en-US/workflow.ts @@ -61,6 +61,18 @@ const translation = { statusCode: 'Response Status Code', headers: 'Response Header List JSON', }, + authorization: { + 'authorization': 'Authorization', + 'authorizationType': 'Authorization Type', + 'no-auth': 'None', + 'api-key': 'API-Key', + 'auth-type': 'Auth Type', + 'basic': 'Basic', + 'bearer': 'Bearer', + 'custom': 'Custom', + 'api-key-title': 'API Key', + 'header': 'Header', + }, }, code: { inputVars: 'Input Variables', diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts index 61d4b9a1fc..6430b4997a 100644 --- a/web/i18n/zh-Hans/workflow.ts +++ b/web/i18n/zh-Hans/workflow.ts @@ -60,6 +60,18 @@ const translation = { statusCode: '响应状态码', headers: '响应头列表 JSON', }, + authorization: { + 'authorization': '鉴权', + 'authorizationType': '鉴权类型', + 'no-auth': '无', + 'api-key': 'API-Key', + 'auth-type': 'API 鉴权类型', + 'basic': '基础', + 'bearer': 'Bearer', + 'custom': '自定义', + 'api-key-title': 'API Key', + 'header': 'Header', + }, }, code: { inputVars: '输入变量',