From 09df62753a837efc999291c62db1ed2af99abc26 Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Mon, 29 Jul 2024 00:50:11 +0800 Subject: [PATCH 01/14] New translations current.json (en) --- i18n/en/docusaurus-plugin-content-docs/current.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/i18n/en/docusaurus-plugin-content-docs/current.json b/i18n/en/docusaurus-plugin-content-docs/current.json index 2483118..a4ee08a 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current.json +++ b/i18n/en/docusaurus-plugin-content-docs/current.json @@ -18,5 +18,9 @@ "sidebar.docs.category.编写一个插件": { "message": "Write a plugin", "description": "The label for category 编写一个插件 in sidebar docs" + }, + "sidebar.api.category.One OpenBMCLAPI Dashboard": { + "message": "One OpenBMCLAPI Dashboard", + "description": "The label for category One OpenBMCLAPI Dashboard in sidebar api" } } From 2cc4a360971dde4d7da236a16dc481f779cb5a70 Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Mon, 29 Jul 2024 00:50:12 +0800 Subject: [PATCH 02/14] New translations api.mdx (en) --- i18n/en/docusaurus-plugin-content-docs/current/api/api.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/api/api.mdx b/i18n/en/docusaurus-plugin-content-docs/current/api/api.mdx index 2ccc11d..388503a 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/api/api.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/api/api.mdx @@ -1,5 +1,6 @@ --- title: API +sidebar_position: 1 --- 该系列文档将会介绍 python-openbmclapi 的 API。 From d3ff36b6e5e531f2826013c20e3a4a13275cb06f Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Mon, 29 Jul 2024 00:50:13 +0800 Subject: [PATCH 03/14] New translations one-openbmclapi-dashboard.mdx (en) --- .../one-openbmclapi-dashboard.mdx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/api/one-openbmclapi-dashboard/one-openbmclapi-dashboard.mdx diff --git a/i18n/en/docusaurus-plugin-content-docs/current/api/one-openbmclapi-dashboard/one-openbmclapi-dashboard.mdx b/i18n/en/docusaurus-plugin-content-docs/current/api/one-openbmclapi-dashboard/one-openbmclapi-dashboard.mdx new file mode 100644 index 0000000..d2408e4 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/api/one-openbmclapi-dashboard/one-openbmclapi-dashboard.mdx @@ -0,0 +1,15 @@ +--- +title: One OpenBMCLAPI Dashboard +sidebar_position: 2 +--- + +使用 one-openbmclapi-dashboard 的方法非常简单,只需要在后端提供一个 API 接口。 + +```mermaid +graph LR; + A(前端 Axios) -- GET --> B(后端 API) +``` + +> **_“后端只需要提供数据,而前端要考虑的就多了。”_** + +该系列文档会简要介绍如何为 one-openbmclapi-dashboard 提供所需要的 API 接口。 From 1aa026e989b1f4e4ae8f5bb156691f343704bd3b Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Mon, 29 Jul 2024 00:50:14 +0800 Subject: [PATCH 04/14] New translations status.mdx (en) --- .../api/one-openbmclapi-dashboard/status.mdx | 703 ++++++++++++++++++ 1 file changed, 703 insertions(+) create mode 100644 i18n/en/docusaurus-plugin-content-docs/current/api/one-openbmclapi-dashboard/status.mdx diff --git a/i18n/en/docusaurus-plugin-content-docs/current/api/one-openbmclapi-dashboard/status.mdx b/i18n/en/docusaurus-plugin-content-docs/current/api/one-openbmclapi-dashboard/status.mdx new file mode 100644 index 0000000..85b96e6 --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/current/api/one-openbmclapi-dashboard/status.mdx @@ -0,0 +1,703 @@ +--- +title: 服务器状态信息(status) +sidebar_position: 1 +--- + +## 接口地址 {#address} + +`/api/status`。 + +## 请求方式 {#method} + +GET。 + +## 请求参数 {#parameter} + +无。 + +## 响应数据 {#response} + +| 字段名 | 类型 | 说明 | +| ----------- | ----------- | ----------------------------------------------------------------- | +| `status` | `number` | 服务器的运行状态。`-1` 代表同步中,`1` 代表运行中。 | +| `startTime` | `number` | 服务器的启动时间(格式为时间戳,精确到毫秒,例:`1722179843534`)。 | +| `stats` | `Stats` | 最新的一批数据,详见类型定义。 | +| `prevStats` | `Stats` | 先前的一批数据,详见类型定义。 | +| `accesses` | `UserAgent` | 下载文件的来源 UA(User-Agent)统计。详见类型定义 | + +## 类型定义 {#types} + +### `Stats` + +`Stats` 类型的数据用于为 `HitsChart` 提供数据。 + +这是一个“当日请求”图表(`HitsChart`)的例子。 + +![](https://s21.ax1x.com/2024/07/28/pkqO6SA.png) + +上面的图片很好地解释了 `prevStats` 和 `stats` 的联系与区别。 + +`prevStats` 为前一天的数据,类型为 `StatsData[]`。 + +`stats` 为当天数据,类型为 `StatsData[]`。 + +以此类推,`Stats` 类型中的 `hours`(每天中的每小时)、`days`(每月中的每天)、`months`(每年中的每月)在 `prevStats` 和 `stats` 中所代表的 +含义也是如此。 + +前端会根据请求到的 `prevStats` 和 `stat` 以及当前时间来处理并显示数据。 + +在提供数据时,以 `hours` 为例,`hours[0]` 代表当天 1 点的数据,提供 24 个数组元素(到 `hours[23]`)。 + +`days` 提供数据时按照当月的天数进行提供,例:如果是闰年的二月份的话,则提供到 `days[27]`。 + +`months` 提供到 `months[11]`。 + +```ts +export interface Stats { + hours: StatsData[]; + days: StatsData[]; + months: StatsData[]; +} +``` + +### `StatsData` + +这是 `Stats` 使用的基本数据类型,`hits` 代表访问量,`bytes` 代表流量的**字节数(即 B)**。 + +```ts +export interface StatsData { + hits: number; + bytes: number; +} +``` + +### `UserAgent` + +该类型用于记录访问者的 User-Agent 信息。 + +例: + +```json + "openbmclapi": 54224 +``` + +`openbmclapi` 代表的是 User-Agent,`54224` 代表的是访问量。 + +```ts +export interface UserAgent { + [ua: string]: number; +} +``` + +## 响应示例 {#example} + +```json +{ + "status": 1, + "startTime": 1722010274916, + "stats": { + "hours": [ + { + "hits": 104776, + "bytes": 265270404978 + }, + { + "hits": 136736, + "bytes": 322697713310 + }, + { + "hits": 185299, + "bytes": 432999873764 + }, + { + "hits": 200626, + "bytes": 449115696709 + }, + { + "hits": 211966, + "bytes": 482390240164 + }, + { + "hits": 271805, + "bytes": 604009644683 + }, + { + "hits": 297484, + "bytes": 648838098313 + }, + { + "hits": 283999, + "bytes": 695941998207 + }, + { + "hits": 283277, + "bytes": 640229162823 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + } + ], + "days": [ + { + "hits": 1907983, + "bytes": 5497892044454 + }, + { + "hits": 2313730, + "bytes": 6127344928501 + }, + { + "hits": 2992126, + "bytes": 7704666757615 + }, + { + "hits": 2137785, + "bytes": 5056813383402 + }, + { + "hits": 2781913, + "bytes": 6873421694291 + }, + { + "hits": 2713781, + "bytes": 6539368526253 + }, + { + "hits": 3765494, + "bytes": 8324045959526 + }, + { + "hits": 2869199, + "bytes": 6534375706052 + }, + { + "hits": 3750990, + "bytes": 8523354158192 + }, + { + "hits": 3466073, + "bytes": 8312138028716 + }, + { + "hits": 3718479, + "bytes": 8407499071794 + }, + { + "hits": 4177111, + "bytes": 9560855489848 + }, + { + "hits": 4587997, + "bytes": 10710135458744 + }, + { + "hits": 4457882, + "bytes": 10314101088953 + }, + { + "hits": 4259148, + "bytes": 9941037670516 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + } + ], + "months": [ + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 63916891, + "bytes": 158094242725019 + }, + { + "hits": 102320608, + "bytes": 274138019834783 + }, + { + "hits": 85897622, + "bytes": 257165505654276 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + } + ] + }, + "prevStats": { + "hours": [ + { + "hits": 74910, + "bytes": 204268947605 + }, + { + "hits": 143015, + "bytes": 353992570691 + }, + { + "hits": 173399, + "bytes": 433595371392 + }, + { + "hits": 208231, + "bytes": 480808834184 + }, + { + "hits": 227107, + "bytes": 573313040456 + }, + { + "hits": 278404, + "bytes": 644623007424 + }, + { + "hits": 313317, + "bytes": 688708558160 + }, + { + "hits": 307603, + "bytes": 685920887509 + }, + { + "hits": 303763, + "bytes": 690628496352 + }, + { + "hits": 275867, + "bytes": 623764402173 + }, + { + "hits": 242191, + "bytes": 575176194821 + }, + { + "hits": 266518, + "bytes": 649828509229 + }, + { + "hits": 316985, + "bytes": 754864319680 + }, + { + "hits": 299764, + "bytes": 705201353885 + }, + { + "hits": 270707, + "bytes": 640315720069 + }, + { + "hits": 180348, + "bytes": 438740242001 + }, + { + "hits": 117058, + "bytes": 260574440967 + }, + { + "hits": 71723, + "bytes": 160257397438 + }, + { + "hits": 45353, + "bytes": 89248570393 + }, + { + "hits": 30912, + "bytes": 64739154136 + }, + { + "hits": 23421, + "bytes": 47256003055 + }, + { + "hits": 17950, + "bytes": 34378572581 + }, + { + "hits": 22033, + "bytes": 35530873482 + }, + { + "hits": 48569, + "bytes": 105302202833 + } + ], + "days": [ + { + "hits": 4486331, + "bytes": 10659201088831 + }, + { + "hits": 3597623, + "bytes": 10061721667113 + }, + { + "hits": 2661480, + "bytes": 8937660502831 + }, + { + "hits": 2543871, + "bytes": 8486330089963 + }, + { + "hits": 2462107, + "bytes": 7803694039865 + }, + { + "hits": 2043512, + "bytes": 6080799416358 + }, + { + "hits": 4150728, + "bytes": 11787705385423 + }, + { + "hits": 3163704, + "bytes": 8632954070357 + }, + { + "hits": 3053826, + "bytes": 8236233048919 + }, + { + "hits": 2819633, + "bytes": 7995353655580 + }, + { + "hits": 1911708, + "bytes": 5981006049451 + }, + { + "hits": 2735575, + "bytes": 8653939256856 + }, + { + "hits": 1848667, + "bytes": 5808834226969 + }, + { + "hits": 3377711, + "bytes": 10815987567685 + }, + { + "hits": 873675, + "bytes": 2872528007704 + }, + { + "hits": 3649898, + "bytes": 12060713847385 + }, + { + "hits": 2701106, + "bytes": 9886362384990 + }, + { + "hits": 2616389, + "bytes": 9646878746718 + }, + { + "hits": 2632272, + "bytes": 9333936552200 + }, + { + "hits": 2791662, + "bytes": 9843531592131 + }, + { + "hits": 4020527, + "bytes": 11712746069274 + }, + { + "hits": 4316091, + "bytes": 11820690646521 + }, + { + "hits": 3392119, + "bytes": 9339115870586 + }, + { + "hits": 2789523, + "bytes": 7861731176946 + }, + { + "hits": 1981113, + "bytes": 5697934451626 + }, + { + "hits": 2594541, + "bytes": 7692258167924 + }, + { + "hits": 2799675, + "bytes": 7813572582806 + }, + { + "hits": 3083333, + "bytes": 8628776083599 + }, + { + "hits": 3262317, + "bytes": 8737045815352 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + } + ], + "months": [ + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + }, + { + "hits": 0, + "bytes": 0 + } + ] + }, + "accesses": { + "AndroidDownloadManager": 1, + "Apache-Maven": 1, + "BMCLNG": 1091, + "BakaXL": 445892, + "Boat_H2CO3": 728, + "Chrome": 3, + "ColorMC": 120, + "CurseTheBeast": 27, + "Dalvik": 883374, + "Downloader": 69, + "FCL": 10535218, + "FileDownloader": 204, + "Gradle": 55, + "HMCL": 17522739, + "HMCL-PE": 57, + "Java": 3329, + "Java-http-client": 2279, + "LauncherX": 4315, + "MCL": 5, + "MCSLSync": 1, + "MCinaBox": 36, + "ML": 130, + "MMozilla": 3, + "MSL": 46, + "Mozilla": 4447, + "Natsurainko.FluentLauncher": 9, + "NsisoLauncher": 199, + "Opera": 27, + "PCL2": 74479241, + "Pojav": 56, + "PojavLauncher": 465, + "PolarDownloadCore": 52, + "PrismLauncher": 6, + "Python": 3503, + "SLauncher": 95, + "SharpCraftLauncher": 321, + "VQRL": 69, + "[Unknown]": 29342, + "bmclapi-ctrl": 1147, + "bmclapi-warden": 36533, + "github.com": 118, + "gomclauncher": 1, + "got": 16, + "https:": 1, + "mozilla": 2, + "okhttp": 63, + "openbmclapi-cluster": 537159, + "python-requests": 576, + "quick": 1, + "voxelum": 4395 + } +} +``` From 7c73abe9065cea9a74610a8796603a60a2355452 Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Thu, 5 Sep 2024 08:08:47 +0800 Subject: [PATCH 05/14] New translations code.json (en) --- i18n/en/code.json | 52 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/i18n/en/code.json b/i18n/en/code.json index f3b980a..ba2a810 100644 --- a/i18n/en/code.json +++ b/i18n/en/code.json @@ -69,14 +69,6 @@ "message": "Older Post", "description": "The blog post button label to navigate to the older/next post" }, - "theme.blog.post.plurals": { - "message": "One post|{count} posts", - "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" - }, - "theme.blog.tagTitle": { - "message": "{nPosts} tagged with \"{tagName}\"", - "description": "The title of the page for a blog tag" - }, "theme.tags.tagsPageLink": { "message": "View All Tags", "description": "The label of the link targeting the tag list page" @@ -427,6 +419,42 @@ "message": "Search docs", "description": "The placeholder of the input of the DocSearch pop-up modal" }, + "theme.blog.post.plurals": { + "message": "One post|{count} posts", + "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.tagTitle": { + "message": "{nPosts} tagged with \"{tagName}\"", + "description": "The title of the page for a blog tag" + }, + "theme.blog.author.pageTitle": { + "message": "{authorName} - {nPosts}", + "description": "The title of the page for a blog author" + }, + "theme.blog.authorsList.pageTitle": { + "message": "Authors", + "description": "The title of the authors page" + }, + "theme.blog.authorsList.viewAll": { + "message": "View All Authors", + "description": "The label of the link targeting the blog authors page" + }, + "theme.contentVisibility.unlistedBanner.title": { + "message": "未列出页", + "description": "The unlisted content banner title" + }, + "theme.contentVisibility.unlistedBanner.message": { + "message": "此页面未列出。搜索引擎不会对其索引,只有拥有直接链接的用户才能访问。", + "description": "The unlisted content banner message" + }, + "theme.contentVisibility.draftBanner.title": { + "message": "Draft page", + "description": "The draft content banner title" + }, + "theme.contentVisibility.draftBanner.message": { + "message": "This page is a draft. It will only be visible in dev and be excluded from the production build.", + "description": "The draft content banner message" + }, "theme.ErrorPageContent.tryAgain": { "message": "Try again", "description": "The label of the button to try again rendering when the React error boundary captures an error" @@ -438,13 +466,5 @@ "theme.tags.tagsPageTitle": { "message": "Tags", "description": "The title of the tag list page" - }, - "theme.unlistedContent.title": { - "message": "Unlisted page", - "description": "The unlisted content banner title" - }, - "theme.unlistedContent.message": { - "message": "This page is unlisted. Search engines will not index it, and only users having a direct link can access it.", - "description": "The unlisted content banner message" } } From 45d5204f230fab85c5a42b54624b643d95d03d1a Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Thu, 5 Sep 2024 08:08:48 +0800 Subject: [PATCH 06/14] New translations configuration.mdx (en) --- .../use-source-code/configuration.mdx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-source-code/configuration.mdx b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-source-code/configuration.mdx index 8146585..2f24963 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-source-code/configuration.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-source-code/configuration.mdx @@ -9,6 +9,29 @@ import Asciinema from "@site/src/components/Asciinema"; 1. 运行一次主程序生成配置文件: + :::info + + 如果你使用 Poetry 安装依赖,你需要先激活虚拟环境。 + + ```sh + poetry shell + ``` + + ```mdx-code-block + + ``` + + ::: + ```sh python main.py ``` From a514c981399678658bbd019345e5eb97503502c6 Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Thu, 5 Sep 2024 08:08:50 +0800 Subject: [PATCH 07/14] New translations installation.mdx (en) --- .../use-source-code/installation.mdx | 80 +++++++++++++++++-- 1 file changed, 75 insertions(+), 5 deletions(-) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-source-code/installation.mdx b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-source-code/installation.mdx index 089b7d2..2401f53 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-source-code/installation.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-source-code/installation.mdx @@ -17,7 +17,7 @@ If you want to use Docker, go to [Use Docker](/docs/deploy-with-docker). :::info - Recommended Python version: 3.10+. + Python 版本:3.12+。 ::: @@ -79,15 +79,77 @@ If you want to use Docker, go to [Use Docker](/docs/deploy-with-docker). 3. Install dependencies: + :::tip + + 你亦可设置 pip 镜像源来加快你在中国大陆地区的下载速度: + ```sh - pip install -r requirements.txt + pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple ``` - :::tip + ::: - You may need to install [Microsoft Visual C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/). + ```mdx-code-block + + + ``` - ::: + 1. 安装 [pipx](https://pipx.pypa.io/latest/): + + ```sh + pip install --user pipx + ``` + + 2. 重新启动终端。 + + 3. 安装 [Poetry](https://python-poetry.org/): + + ```sh + pipx install poetry + pipx ensurepath + ``` + + :::info + + pipx 需要安装 `python3.10-venv` 包来进行依赖的安装: + + ```sh + apt-get install python3.10-venv + ``` + + ::: + + 4. 重新启动终端。 + + 5. 安装依赖: + + ```sh + poetry install + ``` + + ```mdx-code-block + + ``` + + ```mdx-code-block + + + ``` + + 运行安装命令: + + ```sh + pip install -r requirements.txt + ``` ```mdx-code-block + + ``` + + :::tip + + You may need to install [Microsoft Visual C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/). + + ::: From 9f840b9a1f26459fe937816f17871009fbb2399b Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Thu, 5 Sep 2024 08:08:51 +0800 Subject: [PATCH 08/14] New translations use-systemd.mdx (en) --- .../current/getting-started/use-systemd.mdx | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-systemd.mdx b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-systemd.mdx index b530245..6eac7b4 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-systemd.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-systemd.mdx @@ -15,38 +15,40 @@ If you want to use Docker, go to [Use Docker](/docs/deploy-with-docker). Before using a one-click script, make sure you are ready for: - Make sure systemd is your startup process -- [Python](https://www.python.org/) environment (version: 3.10+) +- [Python](https://www.python.org/) 环境(版本:3.12+) ## Install {#installation} -Run install script: +1. 进入系统的 root 用户。 -```sh -curl -fsSL https://raw.githubusercontent.com/TTB-Network/python-openbmclapi/master/installer/installer.sh | sudo bash -s -``` +2. Run install script: -:::tip + ```sh + curl -fsSL https://raw.githubusercontent.com/TTB-Network/python-openbmclapi/master/installer/installer.sh | sudo bash -s + ``` -You can also speed up with mirror sources: + :::tip -```sh -curl -fsSL https://ghproxy.bugungu.top/https://raw.githubusercontent.com/TTB-Network/python-openbmclapi/master/installer/installer.sh | sudo bash -s -``` + You can also speed up with mirror sources: -::: + ```sh + curl -fsSL https://ghproxy.bugungu.top/https://raw.githubusercontent.com/TTB-Network/python-openbmclapi/master/installer/installer.sh | sudo bash -s + ``` -```mdx-code-block - -``` + ::: + + ```mdx-code-block + + ``` ## Configure {#configuration} From 7f09489d9390eab5f0e82c8c026306c1338c263b Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Thu, 5 Sep 2024 08:08:52 +0800 Subject: [PATCH 09/14] New translations version-1.x.json (en) --- .../version-1.x.json | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 i18n/en/docusaurus-plugin-content-docs/version-1.x.json diff --git a/i18n/en/docusaurus-plugin-content-docs/version-1.x.json b/i18n/en/docusaurus-plugin-content-docs/version-1.x.json new file mode 100644 index 0000000..f61183e --- /dev/null +++ b/i18n/en/docusaurus-plugin-content-docs/version-1.x.json @@ -0,0 +1,26 @@ +{ + "version.label": { + "message": "1.x", + "description": "The label for version 1.x" + }, + "sidebar.docs.category.快速上手": { + "message": "快速上手", + "description": "The label for category 快速上手 in sidebar docs" + }, + "sidebar.docs.category.使用源码运行": { + "message": "使用源码运行", + "description": "The label for category 使用源码运行 in sidebar docs" + }, + "sidebar.docs.category.进阶": { + "message": "进阶", + "description": "The label for category 进阶 in sidebar docs" + }, + "sidebar.docs.category.编写一个插件": { + "message": "编写一个插件", + "description": "The label for category 编写一个插件 in sidebar docs" + }, + "sidebar.api.category.One OpenBMCLAPI Dashboard": { + "message": "One OpenBMCLAPI Dashboard", + "description": "The label for category One OpenBMCLAPI Dashboard in sidebar api" + } +} From bcde4a2a71b2ec1b82fccadb0bf9fd17dd8d6c87 Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:29:59 +0800 Subject: [PATCH 10/14] New translations code.json (en) --- i18n/en/code.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/i18n/en/code.json b/i18n/en/code.json index ba2a810..891133d 100644 --- a/i18n/en/code.json +++ b/i18n/en/code.json @@ -164,6 +164,10 @@ "message": "Tags:", "description": "The label alongside a tag list" }, + "theme.AnnouncementBar.closeButtonAriaLabel": { + "message": "Close", + "description": "The ARIA label for close button of announcement bar" + }, "theme.admonition.caution": { "message": "caution", "description": "The default label used for the Caution admonition (:::caution)" @@ -188,10 +192,6 @@ "message": "warning", "description": "The default label used for the Warning admonition (:::warning)" }, - "theme.AnnouncementBar.closeButtonAriaLabel": { - "message": "Close", - "description": "The ARIA label for close button of announcement bar" - }, "theme.blog.sidebar.navAriaLabel": { "message": "Blog recent posts navigation", "description": "The ARIA label for recent posts in the blog sidebar" From 075eb3b73ce6d2107e71af14db6c00c75111c550 Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:30:00 +0800 Subject: [PATCH 11/14] New translations configuration.mdx (en) --- .../current/getting-started/use-source-code/configuration.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-source-code/configuration.mdx b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-source-code/configuration.mdx index 2f24963..f44493f 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-source-code/configuration.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/getting-started/use-source-code/configuration.mdx @@ -49,7 +49,7 @@ import Asciinema from "@site/src/components/Asciinema"; /> ``` - 如果你看到以下报错信息:`core.exceptions.ClusterIdNotSet`,恭喜你!你可以进行下一步的配置了。 + 如果你看到以下报错信息:`core.exceptions.ClusterIdNotSetError`,恭喜你!你可以进行下一步的配置了。 2. 在 `config/config.yml` 中,填写你的 `id`(即 `CLUSTER_ID`)和 `secret`(即 `CLUSTER_SECRET`)。 From e0c4dfb8007875f1fce70e4ed0738ed2e40a091d Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:30:11 +0800 Subject: [PATCH 12/14] New translations introduction.mdx (en) --- i18n/en/docusaurus-plugin-content-docs/current/introduction.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/introduction.mdx b/i18n/en/docusaurus-plugin-content-docs/current/introduction.mdx index 2b659b7..b25e535 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/introduction.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/introduction.mdx @@ -31,7 +31,7 @@ slug: / ✨ **Docker** support. With the help of Docker, you can deploy python-openbmclapi in a **short time**. -🎉 **_New features!_** WebDAV support. Through WebDAV (Web-based Distorting and Versioning), users can edit and manage files stored on web servers in collaboration with them. +🎉 **_New features!_**\*\_\_ 仪表盘。我们使用了 Vue.js 和前端请求(axios)等功能使得新一代仪表盘界面更加简洁。 ## About Python OpenBMCLAPI {#about} From e24af7d50e275443b677a212fc207db6a32f6851 Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Mon, 16 Sep 2024 23:13:40 +0800 Subject: [PATCH 13/14] New translations configuration.mdx (en) --- .../current/advanced/configuration.mdx | 193 +----------------- 1 file changed, 2 insertions(+), 191 deletions(-) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/advanced/configuration.mdx b/i18n/en/docusaurus-plugin-content-docs/current/advanced/configuration.mdx index 94b623b..135677f 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/advanced/configuration.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/advanced/configuration.mdx @@ -12,196 +12,7 @@ import "@site/src/css/table.css"; 这是 python-openbmclapi 的默认配置文件。 ```yml title="config/config.yml" -advanced: - auto_update: false - copy_from_another_storage: true - debug: false - download_threads: 64 - file_check_mode: size - header_bytes: 4096 - io_buffer: 16777216 - language: zh_cn - min_rate: 500 - min_rate_timestamp: 1000 - request_buffer: 8192 - skip_sign: false - timeout: 30 - url: https://openbmclapi.bangbang93.com/ -cache: - buffer: 536870912 - check: 360 - enable: true - time: 1800 -cluster: - byoc: false - download_access_logs: true - download_retry_delay: 60 - enable: true - id: "" - public_host: "" - public_port: 8800 - reconnect: - delay: 60 - retry: -1 - secret: "" - timeout: - enable: 120 - keepalive: 300 -dashboard: - password: "" - username: admin - websocket: true -storages: - bmclapi: - path: ./bmclapi - type: file - width: 0 -web: - force_ssl: false - port: 8080 - server_name: TTB-Network - ssl_port: 8800 - x_forwarded_for: 0 +# todo ``` -## 配置项 {#configuration-keys} - -### `advanced` {#advanced} - -该部分为进阶配置,仅作调试使用,在正常使用 python-openbmclapi 时**不需要**更改该部分的配置项。 - -
- -| 参数 | 类型 | 默认值 | 是否必填 | 描述 | -| --------------------------- | --------- | --------------------------------------- | ------- | ------------------------------------------------------------- | -| `auto_update` | `boolean` | `false` | 否 | 是否启用自动更新(自动更新时会下载最新版本的 Release 压缩包)。 | -| `copy_from_another_storage` | `boolean` | `true` | 否 | 是否在同步文件时使用已配置储存进行同步。 | -| `debug` | `boolean` | `false` | 否 | 是否启用调试模式。 | -| `download_threads` | `int` | `64` | 否 | 最高下载线程。 | -| `header_bytes` | `int` | `4096` | 否 | 新连接读取数据头大小。 | -| `io_buffer` | `int` | `16777216` | 否 | 数据传输缓存大小。 | -| `language` | `string` | `'zh_cn'` | 否 | 语言。 | -| `min_rate` | `int` | `500` | 否 | 最小读取速率(Bytes)。 | -| `min_rate_timestamp` | `int` | `1000` | 否 | 最小读取速率时间。 | -| `request_buffer` | `int` | `8192` | 否 | 请求缓存大小。 | -| `skip_sign` | `boolean` | `false` | 否 | 是否跳过签名检测。 | -| `timeout` | `int` | `30` | 否 | 超时时间。 | -| `url` | `string` | `'https://openbmclapi.bangbang93.com/'` | 否 | OpenBMCLAPI 的 BaseURL。 | - -
- -### `cache` {#cache} - -该部分为对文件缓存的配置。 - -
- -| 参数 | 类型 | 默认值 | 是否必填 | 描述 | -| -------- | --------- | ----------- | ------- | ---------------------- | -| `buffer` | `int` | `536870912` | 否 | 缓存大小(Bytes)。 | -| `check` | `int` | `360` | 否 | 检查过时文件时间(秒)。 | -| `enable` | `boolean` | `true` | 否 | 是否启用缓存。 | -| `time` | `int` | `1800` | 否 | 缓存保留时间(秒)。 | - -
- -### `cluster` {#cluster} - -该部分为节点配置。 - -
- -| 参数 | 类型 | 默认值 | 是否必填 | 描述 | -| ---------------------- | --------- | ------- | ------- | ------------------------------------------------ | -| `byoc` | `boolean` | `false` | 否 | 是否不使用 BMCLAPI 分发的证书, 同 `CLUSTER_BYOC`。 | -| `enable` | `boolean` | `true` | 否 | 是否启用节点。 | -| `download_access_logs` | `boolean` | `true` | 否 | 是否启用下载日志。 | -| `download_retry_delay` | `int` | `true` | 否 | 下载时重试延迟时间。 | -| `id` | `string` | `''` | 是 | OpenBMCLAPI 的 `CLUSTER_ID`。 | -| `public_host` | `boolean` | `''` | 否 | 实际开放的公网主机名, 同 `CLUSTER_IP`。 | -| `public_port` | `int` | `8800` | 否 | 实际开放的公网端口, 同 `CLUSTER_PUBLIC_PORT`。 | -| `reconnect.delay` | `int` | `60` | 否 | 重连间隔。 | -| `reconnect.retry` | `int` | `-1` | 否 | 重连次数,`-1` 为无限次数。 | -| `secret` | `string` | `''` | 是 | OpenBMCLAPI 的 `CLUSTER_SECRET`。 | -| `timeout.enable` | `int` | `120` | 否 | 发送启用数据包超时时间。 | -| `timeout.keepalive` | `int` | `300` | 否 | 发送保活数据包超时时间。 | - -
- -### `dashboard` {#dashboard} - -该部分为仪表盘配置。 - -
- -| 参数 | 类型 | 默认值 | 是否必填 | 说明 | -| ----------- | --------- | ----------- | ------- | -------------------------------------- | -| `password` | `string` | `undefined` | 否 | 仪表盘的密码(若未配置程序会自动生成)。 | -| `username` | `string` | `'admin'` | 否 | 仪表盘用户名。 | -| `websocket` | `boolean` | `true` | 否 | 是否启用 WebSocket。 | - -
- -### `storages` {#storages} - -该部分为储存配置。 - -储存类型分为两种:`file`(本地存储)和 `webdav`(WebDAV)。 - -#### 使用本地储存 - -```yml title="config/config.yml" {3} -bmclapi: # 你的存储名字,可以使用任何英文名称 - path: ./bmclapi - type: file - width: 0 -``` - -
- -| 参数 | 类型 | 是否必填 | 说明 | -| ------- | -------- | ------- | ---------------------------------------------------------- | -| `path` | `string` | 是 | 存储路径。 | -| `type` | `string` | 是 | 储存类型,可选值为 `file`(本地存储)和 `webdav`(WebDAV)。 | -| `width` | `int` | 是 | 选用存储下载权重,`-1` 为禁用,不选择,但会下载文件。 | - -
- -#### 使用 WebDAV 储存 - -```yml title="config/config.yml" {3,5-7} -bmclapi_webdav: - path: /bmclapidev - type: webdav - width: 2 - endpoint: http://localhost:5244/dav - username: user - password: password -``` - -
- -| 参数 | 类型 | 是否必填 | 说明 | -| ---------- | -------- | ------- | ---------------------------------------------------------- | -| `path` | `string` | 是 | 存储路径。 | -| `type` | `string` | 是 | 储存类型,可选值为 `file`(本地存储)和 `webdav`(WebDAV)。 | -| `width` | `int` | 是 | 选用存储下载权重,`-1` 为禁用,不选择,但会下载文件。 | -| `endpoint` | `string` | 是 | 你的 WebDAV 端点。 | -| `username` | `string` | 是 | WebDAV 用户名。 | -| `password` | `string` | 是 | WebDAV 用户密码。 | - -
- -### `web` {#web} - -该部分为 Web 相关的配置。 - -
- -| 参数 | 类型 | 默认值 | 是否必填 | -| ------------- | --------- | ------------- | ------- | -| `force_ssl` | `boolean` | `false` | 否 | -| `port` | `int` | `8080` | 否 | -| `server_name` | `string` | `TTB-Network` | 否 | - -
+\# todo From 034defae17aa3d7049d1b0a7c5991e5fbb16b26c Mon Sep 17 00:00:00 2001 From: bugungu <113701655+SilianZ@users.noreply.github.com> Date: Mon, 16 Sep 2024 23:13:42 +0800 Subject: [PATCH 14/14] New translations introduction.mdx (en) --- i18n/en/docusaurus-plugin-content-docs/current/introduction.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i18n/en/docusaurus-plugin-content-docs/current/introduction.mdx b/i18n/en/docusaurus-plugin-content-docs/current/introduction.mdx index b25e535..b421251 100644 --- a/i18n/en/docusaurus-plugin-content-docs/current/introduction.mdx +++ b/i18n/en/docusaurus-plugin-content-docs/current/introduction.mdx @@ -31,7 +31,7 @@ slug: / ✨ **Docker** support. With the help of Docker, you can deploy python-openbmclapi in a **short time**. -🎉 **_New features!_**\*\_\_ 仪表盘。我们使用了 Vue.js 和前端请求(axios)等功能使得新一代仪表盘界面更加简洁。 +🎉 **_New features!_**\*__ 仪表盘。我们使用了 Vue.js 和前端请求(axios)等功能使得新一代仪表盘界面更加简洁。 ## About Python OpenBMCLAPI {#about}