feat: Implement a pool monitoring dashboard and file upload functionality.

This commit is contained in:
2026-01-30 10:08:18 +08:00
parent b3841e08ea
commit cefbb2f38f
2 changed files with 51 additions and 46 deletions

View File

@@ -264,9 +264,19 @@ func handleS2AProxy(w http.ResponseWriter, r *http.Request) {
return
}
// 提取路径: /api/s2a/proxy/xxx -> /api/v1/admin/xxx
// 提取路径: /api/s2a/proxy/xxx -> 目标路径
path := strings.TrimPrefix(r.URL.Path, "/api/s2a/proxy")
targetURL := config.Global.S2AApiBase + "/api/v1/admin" + path
// 如果路径不是以 /api/ 开通的,默认补上 /api/v1/admin 开头(兼容 dashboard 统计等)
// 如果已经是 /api/ 开头(如 /api/pool/polling则保持原样
var targetPath string
if strings.HasPrefix(path, "/api/") {
targetPath = path
} else {
targetPath = "/api/v1/admin" + path
}
targetURL := config.Global.S2AApiBase + targetPath
if r.URL.RawQuery != "" {
targetURL += "?" + r.URL.RawQuery
}