Skip to content
This repository was archived by the owner on Oct 3, 2025. It is now read-only.

Commit 4eb8aec

Browse files
committed
add most configure blocks
1 parent 678ffcc commit 4eb8aec

11 files changed

Lines changed: 716 additions & 76 deletions

File tree

README.MD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ A: 请确认中间所有的反向代理都支持 WebSocket
6363
### 无依赖直接运行
6464

6565
1.[Github Release](https://github.com/LiterMC/go-openbmclapi/releases/latest) 找到**适合您服务器平台**的程序并下载到节点服务器上
66-
2. 配置配置文件, 可以直接使用与bangbang93的openbmclapi相同的环境变量配置, 也可以从`config.yaml`进行配置 _(下文有讲)_
66+
2. 配置 `config.yaml` 配置文件 _(下文有讲)_
6767
3. 运行程序
6868

6969
### 从docker运行
@@ -101,7 +101,7 @@ A: 请确认中间所有的反向代理都支持 WebSocket
101101

102102
### 从源代码运行
103103

104-
1. 确保您的服务器上装有 `go 1.21+` 以及 `node & npm`
104+
1. 确保您的服务器上装有 `go 1.23+` 以及 `node & npm`
105105
2. 下载本仓库 _(可以使用`git clone https://github.com/LiterMC/go-openbmclapi.git`)_
106106
3. cd 进入本仓库
107107
4. 配置配置文件或环境变量

config/config.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,10 @@ func (cfg *Config) ApplyWebManifest(manifest map[string]any) {
7676
func NewDefaultConfig() *Config {
7777
return &Config{
7878
PublicHost: "",
79-
PublicPort: 0,
79+
PublicPort: 443,
8080
Host: "0.0.0.0",
8181
Port: 4000,
82+
UseCert: false,
8283
TrustedXForwardedFor: false,
8384

8485
OnlyGcWhenStart: false,
@@ -103,7 +104,7 @@ func NewDefaultConfig() *Config {
103104
},
104105

105106
Cache: CacheConfig{
106-
Type: "inmem",
107+
Type: "memory",
107108
newCache: func() cache.Cache { return cache.NewInMemCache() },
108109
},
109110

@@ -155,9 +156,9 @@ func NewDefaultConfig() *Config {
155156

156157
Hijack: HijackConfig{
157158
Enable: false,
158-
RequireAuth: false,
159159
EnableLocalCache: false,
160160
LocalCachePath: "hijack_cache",
161+
RequireAuth: false,
161162
AuthUsers: []UserItem{
162163
{
163164
Username: "example-username",

dashboard/src/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ const selectedLang = computed({
9090
<a
9191
class="nav-github"
9292
target="_blank"
93-
tabindex="-1"
9493
href="https://github.com/LiterMC/go-openbmclapi?tab=readme-ov-file#go-openbmclapi"
9594
>
9695
<i class="pi pi-github"></i>

dashboard/src/api/v0.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,3 +620,12 @@ export async function getConfig(token: string): Promise<Config> {
620620
})
621621
return res.data
622622
}
623+
624+
export async function putConfig(token: string, config: Config): Promise<void> {
625+
await axios.put(`/api/v0/config`, JSON.stringify(config), {
626+
headers: {
627+
Authorization: `Bearer ${token}`,
628+
'Content-Type': 'application/json',
629+
},
630+
})
631+
}

dashboard/src/assets/base.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
:root {
88
font-size: 16px;
99
--dialog-width: 60rem;
10+
--table-row-bg-a: var(--p-surface-100);
11+
--table-row-bg-b: var(--p-surface-200);
1012
}
1113

1214
body {
@@ -26,3 +28,10 @@ body {
2628
--dialog-width: 100vw;
2729
}
2830
}
31+
32+
@media (prefers-color-scheme: dark) {
33+
:root {
34+
--table-row-bg-a: var(--p-surface-800);
35+
--table-row-bg-b: var(--p-surface-700);
36+
}
37+
}

dashboard/src/assets/lang/en-US.json

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,17 @@
6868
"logs": "Logs",
6969
"clusters": "Clusters",
7070
"storages": "Storages",
71+
"tunneler": "Tunneler",
72+
"cache": "Cache",
73+
"serve_limit": "Serve Limit",
74+
7175
"item": {
7276
"public_host": "Public Host",
7377
"public_port": "Public Port",
7478
"host": "Host",
7579
"port": "Port",
7680
"use_cert": "Use Certification",
77-
"trusted_x_forwarded_for": "Using Proxy",
81+
"trusted_x_forwarded_for": "Trust X-Forwarded-For",
7882

7983
"only_gc_when_start": "Only cleanup when start",
8084
"sync_interval": "Synchronize Interval",
@@ -92,14 +96,48 @@
9296
"public_hosts": "Public Hostnames",
9397
"server": "Central Server",
9498
"skip_signature_check": "Skip Signature Check",
95-
"storages": "Storages"
99+
"storages": "Using Storages"
100+
},
101+
102+
"storage": {
103+
"type": "Storage Type",
104+
"weight": "Weight",
105+
"cache_path": "Path",
106+
"path": "Path",
107+
"redirect_base": "Redirect Base URL",
108+
"pre_gen_measures": "Pre-generate mesaures",
109+
"max_conn": "Max Connection",
110+
"max_upload_rate": "Max Upload Rate",
111+
"max_download_rate": "Max Download Rate",
112+
"follow_redirect": "Follow Redirect",
113+
"redirect_link_cache": "Redirect Link Cache Duration"
114+
},
115+
116+
"tunneler": {
117+
"enable": "Enable Tunneler",
118+
"tunnel_program": "Tunnel Program",
119+
"output_regex": "Output Regex"
120+
},
121+
122+
"cache": {
123+
"type": "Cache Type"
124+
},
125+
126+
"serve_limit": {
127+
"enable": "Enable Serve Limit",
128+
"max_conn": "Max Connection",
129+
"upload_rate": "Max Upload Rate"
96130
}
97131
}
98132
}
99133
},
100134
"button": {
101135
"enable": "Enable",
102-
"disable": "Disable"
136+
"disable": "Disable",
137+
"save": "Save",
138+
"saved": "Saved",
139+
"refresh": "Refresh",
140+
"remove": "Remove"
103141
},
104142
"message": {
105143
"server": {

dashboard/src/assets/lang/zh-CN.json

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,85 @@
5959
"scopes": "",
6060
"auth-header": "授权标头",
6161
"configure": "配置网络钩子"
62+
},
63+
64+
"configure": "配置",
65+
"configures": {
66+
"hostport": "主机&端口",
67+
"sync": "同步",
68+
"logs": "日志",
69+
"clusters": "节点",
70+
"storages": "存储",
71+
"tunneler": "打洞",
72+
"cache": "缓存",
73+
"serve_limit": "服务限制",
74+
75+
"item": {
76+
"public_host": "公网主机名",
77+
"public_port": "公网端口",
78+
"host": "主机名",
79+
"port": "端口",
80+
"use_cert": "使用证书",
81+
"trusted_x_forwarded_for": "信任 X-Forwarded-For",
82+
83+
"only_gc_when_start": "仅在启动时清理",
84+
"sync_interval": "同步间隔",
85+
"download_max_conn": "最大下载连接数",
86+
"max_reconnect_count": "最大重试次数",
87+
88+
"log_slots": "日志槽位",
89+
"enable_access_log": "启用访问日志",
90+
"access_log_slots": "访问日志槽位",
91+
92+
"cluster": {
93+
"id": "节点ID",
94+
"secret": "节点密钥",
95+
"byoc": "自定义证书",
96+
"public_hosts": "公开主机名",
97+
"server": "主控服务器",
98+
"skip_signature_check": "跳过签名检查",
99+
"storages": "使用存储"
100+
},
101+
102+
"storage": {
103+
"type": "存储类型",
104+
"weight": "权重",
105+
"cache_path": "路径",
106+
"path": "路径",
107+
"redirect_base": "重定向基础URL",
108+
"pre_gen_measures": "预生成测速文件",
109+
"max_conn": "最大连接数",
110+
"max_upload_rate": "最大上传速率",
111+
"max_download_rate": "最大下载速率",
112+
"follow_redirect": "跟随重定向",
113+
"redirect_link_cache": "重定向链接缓存时间"
114+
},
115+
116+
"tunneler": {
117+
"enable": "启用打洞",
118+
"tunnel_program": "打洞程序",
119+
"output_regex": "输出正则"
120+
},
121+
122+
"cache": {
123+
"type": "缓存类型"
124+
},
125+
126+
"serve_limit": {
127+
"enable": "启用服务限制",
128+
"max_conn": "最大连接数",
129+
"upload_rate": "最大上传速率"
130+
}
131+
}
62132
}
63133
},
64134
"button": {
65135
"enable": "启用",
66-
"disable": "禁用"
136+
"disable": "禁用",
137+
"save": "保存",
138+
"saved": "已保存",
139+
"refresh": "刷新",
140+
"remove": "移除"
67141
},
68142
"message": {
69143
"server": {

dashboard/src/assets/main.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ a.pi {
2525
}
2626

2727
@media (max-width: 60rem) {
28-
.p-dropdown .p-dropdown-label.p-inputtext {
28+
.p-select .p-select-label.p-inputtext {
2929
padding-left: 0.6rem;
3030
}
3131

32-
.p-dropdown .p-dropdown-trigger {
32+
.p-select .p-select-dropdown {
3333
width: 2.1rem;
3434
}
3535
}

dashboard/src/components/StatusButton.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ onMounted(() => {
7777
height: 2.7rem;
7878
margin: 0.5rem;
7979
padding: 0;
80-
border: none;
80+
border: none !important;
8181
border-radius: 0.2rem;
8282
font-weight: 800;
8383
overflow: hidden;
@@ -89,23 +89,23 @@ onMounted(() => {
8989
.info-status[status='enabled'] {
9090
--flash-from: #fff;
9191
--flash-to: #11dfc3;
92-
color: #fff;
93-
background-color: #28a745;
92+
color: #fff !important;
93+
background-color: #28a745 !important;
9494
animation: flash 1s infinite;
9595
}
9696
9797
.info-status[status='disabled'] {
9898
--flash-from: #fff;
9999
--flash-to: #e61a05;
100-
color: #fff;
101-
background-color: #f89f1b;
100+
color: #fff !important;
101+
background-color: #f89f1b !important;
102102
animation: flash 3s infinite;
103103
}
104104
105105
.info-status[status='error'] {
106106
--flash-from: #8a8dac;
107-
color: #fff;
108-
background-color: #bfadad;
107+
color: #fff !important;
108+
background-color: #bfadad !important;
109109
}
110110
111111
.info-status::before {

0 commit comments

Comments
 (0)