Skip to content

Commit

Permalink
nextra-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
meetqy committed Sep 18, 2023
1 parent decf583 commit 6d4cd6f
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 48 deletions.
15 changes: 10 additions & 5 deletions apps/nextra-docs/pages/_meta.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
{
"index": "Introduction",
"another": "Another Page",
"advanced": "Advanced (A Folder)",
"about": {
"title": "About",
"index": {
"title": "主页",
"type": "page",
"theme": {
"layout": "full"
},
"display": "hidden"
},
"apis": {
"title": "Api 接口",
"type": "page"
},
"contact": {
Expand Down
3 changes: 0 additions & 3 deletions apps/nextra-docs/pages/about.mdx

This file was deleted.

3 changes: 0 additions & 3 deletions apps/nextra-docs/pages/advanced.mdx

This file was deleted.

37 changes: 0 additions & 37 deletions apps/nextra-docs/pages/another.mdx

This file was deleted.

141 changes: 141 additions & 0 deletions apps/nextra-docs/pages/apis/config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
import { OptionTable } from "@components/OptionTable";

# Config 配置信息

- [config/findUnique](#获取配置信息) 获取配置信息
- [config/upsert](#更新配置信息) 更新配置信息

## 获取配置信息

`config/findUnique`

### 使用方式

TRPC

```tsx copy
const configQuery = trpc.config.findUnique.useQuery();

console.log(configQuery.data);
```

HTTP

```sh
GET /trpc/config/findUnique
```

### 参数

No Params

### 返回值

<OptionTable
options={[
["name", "string", "`config` 唯一值"],
["language", "string", "语言"],
[
"color",
"string",
<>
外观 | 配色,具体可查看{" "}
<a href="https://daisyui.com/docs/themes/">daisyui themes</a>
</>,
],
["theme", "string", "WEB 主题"],
[
"serverPort",
"number",
<>
服务端 PORT <code>9301-9500</code>
</>,
],
[
"clientPort",
"number",
<>
客户端 PORT <code>9301-9500</code>
</>,
],
["ip", "string", "当前 IP 改变后会自动更新"],
]}
/>

## 更新配置信息

`config/upsert`

### 请求参数

<OptionTable
options={[
["language?", `"zh-cn" | "en-us" | "zh-tw" | undefined`, "设置语言"],
[
"theme?",
<>
默认值 <code>taga-basic</code>
</>,
"设置主题",
],
[
"color?",
<>
参考 <a href="https://daisyui.com/docs/themes/">daisyui themes</a>
</>,
"设置配色",
],
]}
/>

### 使用方式

TRPC

```ts copy
const { mutate: updateConfig } = trpc.config.upsert.useMutation();

// 传入需要更新的字段
updateConfig.mutate({
language: "zh-cn",
});
```

HTTP

```sh
POST /trpc/config/upsert
```

### 返回值

<OptionTable
options={[
["name", "string", "`config` 唯一值"],
["language", "string", "语言"],
[
"color",
"string",
<>
外观 | 配色,具体可查看{" "}
<a href="https://daisyui.com/docs/themes/">daisyui themes</a>
</>,
],
["theme", "string", "WEB 主题"],
[
"serverPort",
"number",
<>
服务端 PORT <code>9301-9500</code>
</>,
],
[
"clientPort",
"number",
<>
客户端 PORT <code>9301-9500</code>
</>,
],
["ip", "string", "当前 IP 改变后会自动更新"],
]}
/>
File renamed without changes.

0 comments on commit 6d4cd6f

Please sign in to comment.