基本功能复刻完成
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user