基本功能复刻完成
All checks were successful
build / build (api, amd64, linux) (push) Successful in -47s
build / build (api, arm64, linux) (push) Successful in -47s
build / build (api.exe, amd64, windows) (push) Successful in -48s

This commit is contained in:
CN-JS-HuiBai
2026-04-17 12:24:00 +08:00
parent 06da23fbbc
commit 981ee4f406
37 changed files with 11737 additions and 770 deletions

View File

@@ -24,7 +24,10 @@ type userThemeViewData struct {
type adminAppViewData struct {
Title string
ConfigJSON template.JS
BaseURL string
SecurePath string
Version string
Logo string
}
func UserThemePage(c *gin.Context) {
@@ -58,29 +61,13 @@ func UserThemePage(c *gin.Context) {
}
func AdminAppPage(c *gin.Context) {
securePath := service.GetAdminSecurePath()
config := map[string]any{
"title": service.MustGetString("app_name", "XBoard") + " Admin",
"securePath": securePath,
"api": map[string]string{
"adminConfig": "/api/v2/" + securePath + "/config/fetch",
"saveConfig": "/api/v2/" + securePath + "/config/save",
"dashboardSummary": "/api/v2/" + securePath + "/dashboard/summary",
"systemStatus": "/api/v2/" + securePath + "/system/getSystemStatus",
"serverNodeSort": "/api/v2/" + securePath + "/server/manage/sort",
"plans": "/api/v2/" + securePath + "/plan/fetch",
"orders": "/api/v2/" + securePath + "/order/fetch",
"coupons": "/api/v2/" + securePath + "/coupon/fetch",
"users": "/api/v2/" + securePath + "/user/fetch",
"tickets": "/api/v2/" + securePath + "/ticket/fetch",
"giftCardStatus": "/api/v2/" + securePath + "/gift-card/status",
"realnameBase": "/api/v2/" + securePath + "/realname",
"onlineDevices": "/api/v2/" + securePath + "/user-online-devices/users",
},
}
securePath := "/" + service.GetAdminSecurePath()
payload := adminAppViewData{
Title: config["title"].(string),
ConfigJSON: mustJSON(config),
Title: service.MustGetString("app_name", "XBoard") + " Admin",
BaseURL: service.GetAppURL(),
SecurePath: securePath,
Version: service.MustGetString("app_version", "1.0.0"),
Logo: service.MustGetString("logo", ""),
}
renderPageTemplate(c, filepath.Join("frontend", "templates", "admin_app.html"), payload)