Skip to content

Commit 85956bf

Browse files
authored
Merge pull request #275 from shiqkuangsan/docs/add-chinese-translation
docs: add Chinese (zh) translation
2 parents 786f996 + 98f9c04 commit 85956bf

44 files changed

Lines changed: 14984 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/docs.json

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,103 @@
202202
]
203203
}
204204
]
205+
},
206+
{
207+
"language": "zh",
208+
"tabs": [
209+
{
210+
"tab": "文档",
211+
"groups": [
212+
{
213+
"group": "快速开始",
214+
"pages": [
215+
"zh/index",
216+
"zh/quickstart",
217+
"zh/installation",
218+
"zh/changelog"
219+
]
220+
},
221+
{
222+
"group": "数据库连接",
223+
"pages": [
224+
"zh/databases/overview",
225+
"zh/databases/connection-urls",
226+
"zh/databases/mysql",
227+
"zh/databases/postgresql",
228+
"zh/databases/sqlite",
229+
"zh/databases/mongodb",
230+
"zh/databases/redis",
231+
"zh/databases/redshift",
232+
"zh/databases/oracle",
233+
"zh/databases/clickhouse",
234+
"zh/databases/mssql",
235+
"zh/databases/oracle",
236+
"zh/databases/ssh-tunneling"
237+
]
238+
},
239+
{
240+
"group": "功能特性",
241+
"pages": [
242+
"zh/features/sql-editor",
243+
"zh/features/data-grid",
244+
"zh/features/autocomplete",
245+
"zh/features/table-structure",
246+
"zh/features/table-operations",
247+
"zh/features/filtering",
248+
"zh/features/change-tracking",
249+
"zh/features/tabs",
250+
"zh/features/import-export",
251+
"zh/features/query-history",
252+
"zh/features/ai-chat",
253+
"zh/features/keyboard-shortcuts",
254+
"zh/features/deep-links",
255+
"zh/features/safe-mode"
256+
]
257+
},
258+
{
259+
"group": "自定义",
260+
"pages": [
261+
"zh/customization/settings",
262+
"zh/customization/appearance",
263+
"zh/customization/editor-settings"
264+
]
265+
}
266+
]
267+
},
268+
{
269+
"tab": "API",
270+
"groups": [
271+
{
272+
"group": "API 参考",
273+
"pages": ["zh/api/overview"]
274+
},
275+
{
276+
"group": "许可证",
277+
"icon": "key",
278+
"pages": [
279+
"zh/api/activate",
280+
"zh/api/validate",
281+
"zh/api/deactivate"
282+
]
283+
}
284+
]
285+
},
286+
{
287+
"tab": "开发",
288+
"groups": [
289+
{
290+
"group": "参与贡献",
291+
"pages": [
292+
"zh/development/setup",
293+
"zh/development/architecture",
294+
"zh/development/code-style",
295+
"zh/development/building",
296+
"zh/development/plugin-registry"
297+
]
298+
}
299+
]
300+
}
301+
]
205302
}
206303
],
207304
"global": {

docs/zh/api/activate.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: 激活许可证
3+
openapi: POST /v1/license/activate
4+
---

docs/zh/api/deactivate.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: 停用许可证
3+
openapi: POST /v1/license/deactivate
4+
---

docs/zh/api/overview.mdx

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
title: 概述
3+
description: 用于许可证激活、验证和停用的 REST API,支持 RSA-SHA256 签名响应
4+
---
5+
6+
## 基础 URL
7+
8+
```
9+
https://api.tablepro.app/v1
10+
```
11+
12+
## 端点
13+
14+
三个端点用于许可证生命周期管理:
15+
16+
| 方法 | 端点 | 描述 |
17+
| ------ | -------- | ----------- |
18+
| `POST` | `/license/activate` | 在某台设备上激活许可证 |
19+
| `POST` | `/license/validate` | 验证已激活的许可证 |
20+
| `POST` | `/license/deactivate` | 从某台设备停用许可证 |
21+
22+
## 请求格式
23+
24+
所有请求必须为 JSON 格式,并携带 `Content-Type: application/json` 头部。
25+
26+
### 公共参数
27+
28+
| 参数 | 类型 | 描述 |
29+
| --------- | ---- | ----------- |
30+
| `license_key` | `string` | 许可证密钥,格式为 `XXXXX-XXXXX-XXXXX-XXXXX-XXXXX`(字母数字) |
31+
| `machine_id` | `string` | 设备标识符的 SHA-256 哈希值(64 位十六进制字符) |
32+
33+
## 响应格式
34+
35+
成功的激活和验证响应会返回已签名的许可证数据:
36+
37+
```json
38+
{
39+
"data": {
40+
"email": "john@example.com",
41+
"expires_at": "2027-02-11T00:00:00+00:00",
42+
"issued_at": "2026-02-12T10:30:00+00:00",
43+
"license_key": "ABCDE-12345-FGHIJ-67890-KLMNO",
44+
"status": "active"
45+
},
46+
"signature": "base64-encoded-signature"
47+
}
48+
```
49+
50+
`signature` 字段是 `data` 对象的 RSA-SHA256 加密签名。可在客户端使用公钥验证以确保响应完整性。
51+
52+
## 响应签名
53+
54+
所有成功的激活和验证响应都经过加密签名:
55+
56+
1. `data` 对象的字段按键名字母顺序排序
57+
2. 排序后的对象进行 JSON 编码
58+
3. JSON 字符串使用 RSA-SHA256 签名
59+
4. 签名以 Base64 格式返回
60+
61+
这使客户端能够验证许可证数据未被篡改。
62+
63+
## 速率限制
64+
65+
所有端点都有速率限制。速率限制信息包含在响应头中:
66+
67+
| 头部 | 描述 |
68+
| ------ | ----------- |
69+
| `X-RateLimit-Limit` | 当前窗口期内允许的最大请求数 |
70+
| `X-RateLimit-Remaining` | 当前窗口期内剩余的请求数 |
71+
| `X-RateLimit-Reset` | 窗口期重置的 Unix 时间戳 |
72+
73+
超出限制时,API 返回 `429`
74+
75+
```json
76+
{
77+
"message": "Too many requests.",
78+
"retry_after": 60
79+
}
80+
```
81+
82+
## 错误处理
83+
84+
错误响应采用统一格式:
85+
86+
```json
87+
{
88+
"message": "Human-readable error message."
89+
}
90+
```
91+
92+
### 状态码
93+
94+
| 状态码 | 描述 |
95+
| ---- | ----------- |
96+
| `200` | 成功 |
97+
| `403` | 许可证已暂停、已过期或设备未激活 |
98+
| `404` | 未找到许可证密钥 |
99+
| `409` | 已达激活数量上限 |
100+
| `422` | 验证错误(请求参数无效) |
101+
| `429` | 超出速率限制 |
102+
103+
### 验证错误
104+
105+
`422` 响应包含字段级别的详细信息:
106+
107+
```json
108+
{
109+
"message": "The given data was invalid.",
110+
"errors": {
111+
"license_key": ["The license key field is required."],
112+
"machine_id": ["The machine id must be 64 characters."]
113+
}
114+
}
115+
```
116+
117+
## 许可证状态
118+
119+
| 状态 | 描述 |
120+
| ------ | ----------- |
121+
| `active` | 许可证有效且可用 |
122+
| `suspended` | 许可证已暂停,无法激活或验证 |

docs/zh/api/validate.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: 验证许可证
3+
openapi: POST /v1/license/validate
4+
---

0 commit comments

Comments
 (0)