Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 40 additions & 20 deletions i18n/en/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -172,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)"
Expand All @@ -196,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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
}
}
4 changes: 4 additions & 0 deletions i18n/en/docusaurus-plugin-content-docs/current.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 时**不需要**更改该部分的配置项。

<div className="apiTable">

| 参数 | 类型 | 默认值 | 是否必填 | 描述 |
| --------------------------- | --------- | --------------------------------------- | ------- | ------------------------------------------------------------- |
| `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。 |

</div>

### `cache` {#cache}

该部分为对文件缓存的配置。

<div className="apiTable">

| 参数 | 类型 | 默认值 | 是否必填 | 描述 |
| -------- | --------- | ----------- | ------- | ---------------------- |
| `buffer` | `int` | `536870912` | 否 | 缓存大小(Bytes)。 |
| `check` | `int` | `360` | 否 | 检查过时文件时间(秒)。 |
| `enable` | `boolean` | `true` | 否 | 是否启用缓存。 |
| `time` | `int` | `1800` | 否 | 缓存保留时间(秒)。 |

</div>

### `cluster` {#cluster}

该部分为节点配置。

<div className="apiTable">

| 参数 | 类型 | 默认值 | 是否必填 | 描述 |
| ---------------------- | --------- | ------- | ------- | ------------------------------------------------ |
| `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` | 否 | 发送保活数据包超时时间。 |

</div>

### `dashboard` {#dashboard}

该部分为仪表盘配置。

<div className="apiTable">

| 参数 | 类型 | 默认值 | 是否必填 | 说明 |
| ----------- | --------- | ----------- | ------- | -------------------------------------- |
| `password` | `string` | `undefined` | 否 | 仪表盘的密码(若未配置程序会自动生成)。 |
| `username` | `string` | `'admin'` | 否 | 仪表盘用户名。 |
| `websocket` | `boolean` | `true` | 否 | 是否启用 WebSocket。 |

</div>

### `storages` {#storages}

该部分为储存配置。

储存类型分为两种:`file`(本地存储)和 `webdav`(WebDAV)。

#### 使用本地储存

```yml title="config/config.yml" {3}
bmclapi: # 你的存储名字,可以使用任何英文名称
path: ./bmclapi
type: file
width: 0
```

<div className="apiTable">

| 参数 | 类型 | 是否必填 | 说明 |
| ------- | -------- | ------- | ---------------------------------------------------------- |
| `path` | `string` | 是 | 存储路径。 |
| `type` | `string` | 是 | 储存类型,可选值为 `file`(本地存储)和 `webdav`(WebDAV)。 |
| `width` | `int` | 是 | 选用存储下载权重,`-1` 为禁用,不选择,但会下载文件。 |

</div>

#### 使用 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
```

<div className="apiTable">

| 参数 | 类型 | 是否必填 | 说明 |
| ---------- | -------- | ------- | ---------------------------------------------------------- |
| `path` | `string` | 是 | 存储路径。 |
| `type` | `string` | 是 | 储存类型,可选值为 `file`(本地存储)和 `webdav`(WebDAV)。 |
| `width` | `int` | 是 | 选用存储下载权重,`-1` 为禁用,不选择,但会下载文件。 |
| `endpoint` | `string` | 是 | 你的 WebDAV 端点。 |
| `username` | `string` | 是 | WebDAV 用户名。 |
| `password` | `string` | 是 | WebDAV 用户密码。 |

</div>

### `web` {#web}

该部分为 Web 相关的配置。

<div className="apiTable">

| 参数 | 类型 | 默认值 | 是否必填 |
| ------------- | --------- | ------------- | ------- |
| `force_ssl` | `boolean` | `false` | 否 |
| `port` | `int` | `8080` | 否 |
| `server_name` | `string` | `TTB-Network` | 否 |

</div>
\# todo
1 change: 1 addition & 0 deletions i18n/en/docusaurus-plugin-content-docs/current/api/api.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: API
sidebar_position: 1
---

该系列文档将会介绍 python-openbmclapi 的 API。
Original file line number Diff line number Diff line change
@@ -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 接口。
Loading