基本功能已初步完善
This commit is contained in:
37
internal/handler/admin_plugin_page.go
Normal file
37
internal/handler/admin_plugin_page.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
"xboard-go/internal/service"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type adminPluginPageViewData struct {
|
||||
Title string
|
||||
Kind string
|
||||
KindLabel string
|
||||
SecurePath string
|
||||
}
|
||||
|
||||
func AdminPluginPanelPage(c *gin.Context) {
|
||||
kind := c.Param("kind")
|
||||
labels := map[string]string{
|
||||
"realname": "实名认证",
|
||||
"online-devices": "在线 IP 统计",
|
||||
"ipv6-subscription": "IPv6 子账号",
|
||||
}
|
||||
label, ok := labels[kind]
|
||||
if !ok {
|
||||
c.String(http.StatusNotFound, "plugin panel not found")
|
||||
return
|
||||
}
|
||||
|
||||
renderPageTemplate(c, filepath.Join("frontend", "templates", "admin_plugin_panel.html"), adminPluginPageViewData{
|
||||
Title: service.MustGetString("app_name", "XBoard") + " - " + label,
|
||||
Kind: kind,
|
||||
KindLabel: label,
|
||||
SecurePath: service.GetAdminSecurePath(),
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user