feat: Introduce a new monitoring and configuration dashboard with backend API for autopool management and S2A integration.

This commit is contained in:
2026-02-02 07:55:22 +08:00
parent 5a3b3aa8ef
commit 3d026b2010
8 changed files with 722 additions and 68 deletions

View File

@@ -232,6 +232,7 @@ func handleConfig(w http.ResponseWriter, r *http.Request) {
"team_reg_proxy_test_status": getTeamRegProxyTestStatus(),
"team_reg_proxy_test_ip": getTeamRegProxyTestIP(),
"site_name": config.Global.SiteName,
"auth_method": config.Global.AuthMethod,
"mail_services_count": len(config.Global.MailServices),
"mail_services": config.Global.MailServices,
})
@@ -248,6 +249,7 @@ func handleConfig(w http.ResponseWriter, r *http.Request) {
DefaultProxy *string `json:"default_proxy"`
TeamRegProxy *string `json:"team_reg_proxy"`
SiteName *string `json:"site_name"`
AuthMethod *string `json:"auth_method"`
}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
api.Error(w, http.StatusBadRequest, "请求格式错误")
@@ -287,6 +289,9 @@ func handleConfig(w http.ResponseWriter, r *http.Request) {
if req.SiteName != nil {
config.Global.SiteName = *req.SiteName
}
if req.AuthMethod != nil {
config.Global.AuthMethod = *req.AuthMethod
}
// 保存到数据库 (实时生效)
if err := config.Update(config.Global); err != nil {