chore: replace all cn comments of fe to en version by volc api (#320)

This commit is contained in:
tecvan
2025-07-31 10:32:15 +08:00
committed by GitHub
parent 716ec0cba8
commit 71f6245a01
2960 changed files with 15545 additions and 15545 deletions

View File

@@ -42,7 +42,7 @@
& svg {
width: 16px;
height: 16px;
/* stylelint-disable-next-line declaration-no-important -- 覆盖icon颜色 */
/* stylelint-disable-next-line declaration-no-important -- Override icon color */
color: var(--semi-color-text-2) !important;
}
}

View File

@@ -66,9 +66,9 @@ enum PageSource {
}
enum PageMode {
/** 整页 UI类似全覆盖浮层 */
/** Full page UI similar to full coverage floating layer */
FULL_PAGE = 'full_page',
/** 嵌入(左侧有菜单栏) */
/** Embed (with menu bar on the left) */
EMBED = 'embed',
}
@@ -87,16 +87,16 @@ const MockSetDetail: FC<{
[],
);
const routeResponse = usePageJumpResponse(PageType.PLUGIN_MOCK_DATA);
// API 详情
// API Details
const [apiInfo, setApiInfo] = useState<PluginAPIInfo>({
name: routeResponse?.toolName,
});
// mock set 详情
// Mock set details
const [mockSetInfo, setMockSetInfo] = useState<MockSet>({
id: mocksetID,
name: routeResponse?.mockSetName,
});
// API 对应 schema
// API correspondence schema
const [toolSchema, setToolSchema] = useState<string>('');
const [perm, setPerm] = useState<{
readOnly: boolean;
@@ -109,9 +109,9 @@ const MockSetDetail: FC<{
const listRef = useRef<MockDataListActions>(null);
const contentEleRef = useRef<HTMLDivElement>(null);
// 页面展示模式
// page display mode
const pageMode = params.hideMenu ? PageMode.FULL_PAGE : PageMode.EMBED;
// 页面来源
// page source
const fromSource = routeResponse?.fromSource
? (routeResponse.fromSource as PageSource)
: PageSource.FROM_MOCK_SET;
@@ -142,7 +142,7 @@ const MockSetDetail: FC<{
[toolID, pluginID],
);
// 获取当前 tool 信息
// Get current tool information
const getPluginToolInfo = async () => {
try {
const { api_info = [] } = await PluginDevelopApi.GetPluginAPIs(
@@ -164,7 +164,7 @@ const MockSetDetail: FC<{
}
};
// 获取当前 mock set 信息
// Get current mock set information
const getMockSetInfo = async () => {
if (!mocksetID) {
return;

View File

@@ -65,7 +65,7 @@ import { getDisplayCols } from './get-col';
import styles from './index.module.less';
interface ListParams {
pageNo?: number; // 用于前端计算数量
pageNo?: number; // Quantity for front-end computing
pageSize?: number;
pageToken?: string;
order?: {
@@ -80,13 +80,13 @@ const TOOL_NOT_FOUND_CODE = '600303108';
const MockSetList: FC<{ toolID: string }> = ({ toolID }) => {
const resourceNavigate = usePluginNavigate();
// user信息
// User information
const userInfo = userStoreService.useUserInfo();
// 路由信息
// routing information
const [params, setParams] = useState<ListParams>({
//请求参数
//request parameters
pageSize: PAGE_SIZE,
pageNo: 1,
});
@@ -101,11 +101,11 @@ const MockSetList: FC<{ toolID: string }> = ({ toolID }) => {
})),
);
// space信息
// Space information
const space = useSpace(spaceID);
const isPersonal = space?.space_type === SpaceType.Personal;
// API 详情
// API Details
const [apiInfo, setApiInfo] = useState<PluginAPIInfo>();
const [showCreateModal, setShowCreateModal] = useState(false);
@@ -118,7 +118,7 @@ const MockSetList: FC<{ toolID: string }> = ({ toolID }) => {
const [editDisabled, setEditDisabled] = useState(false);
// 后端需要的mock上下文信息
// The mock context information required by the backend
const ctxInfo = {
bizCtx: {
trafficScene: TrafficScene.Undefined,
@@ -216,7 +216,7 @@ const MockSetList: FC<{ toolID: string }> = ({ toolID }) => {
}
};
// 获取当前tool信息
// Get current tool information
const getPluginToolInfo = async () => {
try {
const { api_info = [] } = await PluginDevelopApi.GetPluginAPIs({
@@ -351,13 +351,13 @@ const MockSetList: FC<{ toolID: string }> = ({ toolID }) => {
if (!editDisabled) {
handleEdit(record);
}
}, // 点击行
}, // Click line
}),
onChange: e => {
if (e.sorter?.sortOrder) {
tableRef.current?.reset();
//时间排序
//chronological sorting
setParams(p => ({
...p,
pageSize: PAGE_SIZE,
@@ -410,7 +410,7 @@ const MockSetList: FC<{ toolID: string }> = ({ toolID }) => {
></MockSetEditModal>
) : null}
{
// 删除弹窗
// Delete pop-up window
deleteMockSet ? (
<MockSetDeleteModal
visible={!!deleteMockSet}

View File

@@ -35,8 +35,8 @@ interface UseCreateToolProps {
plugin_id: string;
onClickWrapper?: (fn: () => void) => () => Promise<void>;
/**
* 点击创建工具按钮前的回调函数
* @returns {boolean | void} 返回false时将阻止后续动作
* The callback function before clicking the Create Tool button
* @Returns {boolean | void} returns false to block subsequent actions
*/
onBeforeClick?: () => void;
disabled: boolean;
@@ -151,7 +151,7 @@ export const useCreateTool = ({
};
/**
* @description 创建工具
* @description creation tool
*/
export const CreateTool: FC<CreateToolProps> = props => {
const { content } = useCreateTool({

View File

@@ -155,7 +155,7 @@ const PluginDetailPage = ({
);
const [params, setParams] = useState<GetPluginAPIsRequest>({
//请求参数
//request parameters
page: 1,
size: 10,
plugin_id: pluginID,
@@ -236,7 +236,7 @@ const PluginDetailPage = ({
const dataSource = data?.api_info;
/** 不再提示 */
/** no longer prompt */
const noTips = async () => {
const res = await PluginDevelopApi.NoUpdatedPrompt({
plugin_id: pluginID,
@@ -248,7 +248,7 @@ const PluginDetailPage = ({
const checkPublish = async () => {
if (!pluginInfo?.published) {
//未发布过点击直接发布
//It has not been published. Click to publish directly.
setPublishPopShow(true);
return;
}
@@ -264,7 +264,7 @@ const PluginDetailPage = ({
setPublishPopData(res);
setShowPublishCheckPop(true);
} else {
//没有修改api直接发布
//Publish directly without modifying the api
setPublishPopShow(true);
}
};
@@ -308,14 +308,14 @@ const PluginDetailPage = ({
onStatusChange?.('error');
}
}, [initSuccessed]);
// 区分ide的跳转
// Differentiate IDE jumps
const handleIdeJump = (
initialAction = InitialAction.DEFAULT,
toolId = '',
) => {
// ide 逻辑
// IDE logic
if (isCloudIDEPlugin) {
// 改变路由地址 返回的时候会清掉
// Change the routing address and it will be cleared when returning.
preloadIDE?.handleShowIde({ initialAction, toolId });
} else if (toolId) {
resourceNavigate.tool?.(toolId);
@@ -337,7 +337,7 @@ const PluginDetailPage = ({
canEdit ? { mode: 'preview' } : {},
);
}
}, // 点击行
}, // Click line
});
const { exampleNode, openExample } = useEditExample({
@@ -445,7 +445,7 @@ const PluginDetailPage = ({
) : null}
<Layout.Content className={s['layout-content']}>
{/* 已发布且有更新展示 */}
{/* Published and updated */}
{pluginInfo?.status &&
pluginInfo?.published &&
canEdit &&
@@ -470,7 +470,7 @@ const PluginDetailPage = ({
}
/>
) : null}
{/* plugin简介 */}
{/* Plugin Introduction */}
{pluginInfo ? (
<PluginHeader
pluginInfo={pluginInfo}
@@ -502,7 +502,7 @@ const PluginDetailPage = ({
onBeforeClick={() => {
setShowDropDownItem(undefined);
if (isCloudIDEPlugin) {
// 改变路由地址 返回的时候会清掉
// Change the routing address and it will be cleared when returning.
preloadIDE?.handleShowIde({
initialAction: InitialAction.CREATE_TOOL,
toolId: '',
@@ -529,7 +529,7 @@ const PluginDetailPage = ({
{I18n.t('import')}
</Button>
) : null}
{/* ! 发布按钮 */}
{/* ! Post button */}
{isRenderIDEPublishButton ? (
<Tooltip
position="left"
@@ -598,7 +598,7 @@ const PluginDetailPage = ({
}
/>
) : null}
{/* 工具列表表格 */}
{/* Tool List Form */}
{!!dataSource?.length && (
<div className="mb-[24px] mt-[36px] text-[18px] weight-[600]">
{I18n.t('plugin_api_list_table_name')}
@@ -615,7 +615,7 @@ const PluginDetailPage = ({
onRow,
onChange: e => {
if (e.sorter?.sortOrder) {
//时间排序
//chronological sorting
setParams(p => ({
...p,
page: 1,
@@ -634,7 +634,7 @@ const PluginDetailPage = ({
btnText: canEdit ? createToolText : undefined,
btnOnClick: () => {
if (isCloudIDEPlugin) {
// 改变路由地址 返回的时候会清掉
// Change the routing address and it will be cleared when returning.
preloadIDE?.handleShowIde({
initialAction: InitialAction.CREATE_TOOL,
toolId: '',