diff --git a/frontend/packages/common/src/components/aoplatform/TableBtnWithPermission.tsx b/frontend/packages/common/src/components/aoplatform/TableBtnWithPermission.tsx index 7c938271..b951a7c5 100644 --- a/frontend/packages/common/src/components/aoplatform/TableBtnWithPermission.tsx +++ b/frontend/packages/common/src/components/aoplatform/TableBtnWithPermission.tsx @@ -1,10 +1,10 @@ -import { Button, Tooltip } from 'antd' -import { useState, useMemo, useEffect, useCallback } from 'react' -import { useGlobalContext } from '@common/contexts/GlobalStateContext' -import { useNavigate } from 'react-router-dom' import { PERMISSION_DEFINITION } from '@common/const/permissions' -import { Icon } from '@iconify/react/dist/iconify.js' +import { useGlobalContext } from '@common/contexts/GlobalStateContext' import { $t } from '@common/locales' +import { Icon } from '@iconify/react/dist/iconify.js' +import { Button, Tooltip } from 'antd' +import { useCallback, useEffect, useMemo, useState } from 'react' +import { useNavigate } from 'react-router-dom' type TableBtnWithPermissionProps = { btnTitle: string @@ -25,6 +25,7 @@ const TableIconName = { copy: 'ic:baseline-file-copy', view: 'ic:baseline-remove-red-eye', publish: 'ic:baseline-publish', + offline: 'ic:baseline-file-download-off', approval: 'ic:baseline-approval', stop: 'ic:baseline-stop-circle', online: 'ic:baseline-check-circle', @@ -86,7 +87,7 @@ const TableBtnWithPermission = ({ - { - type !== 'apiDetail' && () - } + + )} } > @@ -298,7 +298,7 @@ const AiServiceInsideRouterCreate = () => { spinning={loading} wrapperClassName=" pb-PAGE_INSIDE_B pr-PAGE_INSIDE_X" > - +
{ - - { + return { label: $t(value), value: key } + })} + /> + ) + } } - return (form.setFieldsValue({})) - }, []); - - - const translatedMatchConfig = useMemo(()=>{ - return MATCH_CONFIG.map((item)=>{ - if(item.key === 'position'){ - return ({...item,component:{ - return { label:$t(value), value:key} - })}/>}) - } - return {...item} - }) + if (item.key === 'matchType') { + return { + ...item, + component: ( + - - - - - - { - if((e.target.value as string).endsWith('/*')){ - form.setFieldValue('path',e.target.value.slice(0,-2)) - form.setFieldValue('pathMatch','prefix') - } - }}/> - - - + + + + } + > + } spinning={loading} className=""> + +
+ + {' '} + + {$t('API 基础信息')} + + + + label={$t('拦截该接口的请求')} + name="disable" + extra={$t('开启拦截后,网关会拦截所有该路径的请求,相当于防火墙禁用了特定路径的访问。')} + > + + - - label={$t("请求方式")} - name="methods" - rules={[{ required: true }]} - > - - + label={$t('请求协议')} name="protocols" rules={[{ required: true }]}> + + + + + + { + if ((e.target.value as string).endsWith('/*')) { + form.setFieldValue('path', e.target.value.slice(0, -2)) + form.setFieldValue('pathMatch', 'prefix') + } + }} + /> + + + - - label={$t("描述")} - name="description" - > - - + label={$t('请求方式')} name="methods" rules={[{ required: true }]}> + + - - label={$t("高级匹配")} - name="match" - > - - configFields={translatedMatchConfig} - /> - + label={$t('描述')} name="description"> + + - {$t('转发规则设置')} - - className="mb-0 bg-transparent border-none p-0" - name="proxy" - > - - -
- -
-
+ label={$t('高级匹配')} name="match"> + configFields={translatedMatchConfig} /> +
+ + + + {$t('转发规则设置')} + + + className="p-0 mb-0 bg-transparent border-none" name="proxy"> + + + + + + ) -}) -export default SystemInsideRouterCreate \ No newline at end of file + } +) +export default SystemInsideRouterCreate diff --git a/frontend/prompt/Translate.md b/frontend/prompt/Translate.md new file mode 100644 index 00000000..72fb216d --- /dev/null +++ b/frontend/prompt/Translate.md @@ -0,0 +1,24 @@ +# Translation Workflow in Windsurf + +Follow these steps to manage translations in the project: + +1. **Scan for New Translations** + * Navigate to the `frontend` directory + * Run `pnpm run scan` to detect new translatable content + +2. **Locate New Translation Fields** + * Go to `packages/common/src/locales/scan/newJson` + * Find the language-specific JSON files (e.g., en-US.json, ja-JP.json) + * These files contain the new fields that need translation + +3. **Apply Translations** + * After translating the content, go to `packages/common/src/locales/scan` + * Open the corresponding language JSON file include ja-JP.json,en-US.json,zh-CH.json,zh-TW.json + * Paste the translated content into the appropriate file + +4. **Save and Apply** + * Save the file + * Changes will take effect immediately + * No additional build or restart is required + +Note: Available language files are en-US.json, ja-JP.json, zh-CN.json, and zh-TW.json. \ No newline at end of file