diff --git a/.env.overseas.example b/.env.overseas.example index b44a620b83582ec04422c9d5af30dc134d247409..d45224dda1163c9a9f908e7bd53137bb86611eab 100644 --- a/.env.overseas.example +++ b/.env.overseas.example @@ -1,9 +1,9 @@ # 生产环境 -DOCS_CDN_PREFIX=https://moark.ai/docs -DOCS_API_URL=https://moark.ai -DOCS_SITE_URL=https://moark.ai +#DOCS_CDN_PREFIX=https://moark.ai/docs +#DOCS_API_URL=https://moark.ai +#DOCS_SITE_URL=https://moark.ai # 开发环境 -#DOCS_CDN_PREFIX=/docs -#DOCS_SITE_URL=https://moark.ai -#DOCS_API_URL=https://moark.ai \ No newline at end of file +DOCS_CDN_PREFIX=/docs +DOCS_SITE_URL=https://moark.ai +DOCS_API_URL=https://moark.ai \ No newline at end of file diff --git a/README.md b/README.md index d3b9fe96765908d870f10538ffd10cc8b0786d4f..69cf856f63282c723eec1f136be24fb935faab1a 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,18 @@ # 模力方舟文档 -该仓库是模力方舟平台的文档项目,包含了使用手册以及 API 文档。其中 API 文档使用了 [Scalar](https://scalar.com/) 进行展示。对应网址是 https://ai.gitee.com/docs 。 +该仓库是模力方舟平台的文档项目,包含了使用手册以及 API 文档。其中 API 文档使用了 [Scalar](https://scalar.com/) +进行展示。对应网址是 https://ai.gitee.com/docs 。 ### 安装依赖 ``` -$ yarn +yarn ``` ### 添加 env 文件 ``` -$ cp .env.example .env +cp .env.example .env ``` 修改 .evn 文件,注释掉生产环境的配置项,取消开发环境的配置项注释。 @@ -19,7 +20,7 @@ $ cp .env.example .env ### 启动开发环境 ``` -$ yarn start +yarn start ``` 这个命令会启动本地开发服务器,并自动打开浏览器窗口。大多数更改都会实时生效,无需重启服务器。 @@ -29,7 +30,22 @@ $ yarn start 构建之前请将 .env 文件中的开发环境配置项注释掉,取消生产环境的配置项注释。 ``` -$ yarn build +yarn build ``` 这个命令会将静态内容生成到 build 目录中,可以通过任何静态资源托管服务进行部署。 + + +# 海外版 + +### 添加 env 文件 + +``` +cp .env.overseas.example .env.overseas +``` + +### 启动服务 + +``` +yarn start:overseas +``` \ No newline at end of file diff --git a/i18n/en/code.json b/i18n/en/code.json index 0db6dbba33675bcd8f9e78981e79928b49bba153..c0ef0fda07c7a2b3ed26b2dfc3016a69671cf3c7 100644 --- a/i18n/en/code.json +++ b/i18n/en/code.json @@ -362,5 +362,45 @@ "theme.tags.tagsPageTitle": { "message": "Tags", "description": "The title of the tag list page" + }, + "serverlessAPI.error.fetchFailed": { + "message": "Unable to fetch Serverless API service list. Please send us an email to report this issue:", + "description": "Error message when failed to fetch serverless API services" + }, + "serverlessAPI.error.details": { + "message": "Error details:", + "description": "Label for error details" + }, + "serverlessAPI.loading": { + "message": "Loading Serverless API service list...", + "description": "Loading message for serverless API services" + }, + "serverlessAPI.filter.category": { + "message": "Category:", + "description": "Label for category filter" + }, + "serverlessAPI.filter.allCategories": { + "message": "All Categories", + "description": "Option for all categories in filter" + }, + "serverlessAPI.stats.summary": { + "message": "{serviceCount} models, {operationCount} interfaces", + "description": "Summary of services and operations count" + }, + "serverlessAPI.table.modelName": { + "message": "Model Name", + "description": "Table header for model name" + }, + "serverlessAPI.table.category": { + "message": "Category", + "description": "Table header for category" + }, + "serverlessAPI.table.description": { + "message": "Description", + "description": "Table header for description" + }, + "serverlessAPI.table.interface": { + "message": "Interface", + "description": "Table header for interface" } } diff --git a/i18n/zh-Hans/code.json b/i18n/zh-Hans/code.json index b6f9b151dc52f98a4ff1656363e0b6af69bd8a51..4540c3530ca7f4cfe83b065dad816f9387b79efa 100644 --- a/i18n/zh-Hans/code.json +++ b/i18n/zh-Hans/code.json @@ -362,5 +362,45 @@ "theme.tags.tagsPageTitle": { "message": "标签", "description": "The title of the tag list page" + }, + "serverlessAPI.error.fetchFailed": { + "message": "无法获取 Serverless API 服务列表,请向我们发送邮件反馈该问题:", + "description": "Error message when failed to fetch serverless API services" + }, + "serverlessAPI.error.details": { + "message": "错误信息:", + "description": "Label for error details" + }, + "serverlessAPI.loading": { + "message": "加载 Serverless API 服务列表...", + "description": "Loading message for serverless API services" + }, + "serverlessAPI.filter.category": { + "message": "分类:", + "description": "Label for category filter" + }, + "serverlessAPI.filter.allCategories": { + "message": "全部分类", + "description": "Option for all categories in filter" + }, + "serverlessAPI.stats.summary": { + "message": "共 {serviceCount} 个模型, {operationCount} 个接口", + "description": "Summary of services and operations count" + }, + "serverlessAPI.table.modelName": { + "message": "模型名称", + "description": "Table header for model name" + }, + "serverlessAPI.table.category": { + "message": "分类", + "description": "Table header for category" + }, + "serverlessAPI.table.description": { + "message": "简介", + "description": "Table header for description" + }, + "serverlessAPI.table.interface": { + "message": "接口", + "description": "Table header for interface" } } diff --git a/src/components/ServerlessAPIServices.jsx b/src/components/ServerlessAPIServices.jsx index 60fd31c40505792cb05d464514fc6f9095d8c7b0..7ff5bb144c0b80c0d77a838102c189427baf0843 100644 --- a/src/components/ServerlessAPIServices.jsx +++ b/src/components/ServerlessAPIServices.jsx @@ -1,5 +1,6 @@ import React, { useEffect, useState } from 'react'; import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import Translate, { translate } from '@docusaurus/Translate'; /** API 请求配置 */ const API_CONFIG = { @@ -121,7 +122,12 @@ function ErrorMessage({ error }) { padding: 10, }} > - 无法获取 Serverless API 服务列表,请向我们发送邮件反馈该问题: + + 无法获取 Serverless API 服务列表,请向我们发送邮件反馈该问题: +
- 错误信息:{error} + + 错误信息: + + {error} )}

@@ -144,7 +156,12 @@ function ErrorMessage({ error }) { function LoadingMessage() { return (

- 加载 Serverless API 服务列表... + + 加载 Serverless API 服务列表... +

); } @@ -245,7 +262,12 @@ function FilterControls({ whiteSpace: 'nowrap', }} > - 分类: + + 分类: +