package handler
import (
"fmt"
"net/http"
"strconv"
"time"
"xboard-go/internal/database"
"xboard-go/internal/model"
"github.com/gin-gonic/gin"
)
// RealNameIndex renders the beautified plugin management page.
func RealNameIndex(c *gin.Context) {
var appNameSetting model.Setting
database.DB.Where("name = ?", "app_name").First(&appNameSetting)
appName := appNameSetting.Value
if appName == "" {
appName = "XBoard"
}
securePath := c.Param("path")
apiEndpoint := fmt.Sprintf("/api/v1/%%s/realname/records", securePath)
reviewEndpoint := fmt.Sprintf("/api/v1/%%s/realname/review", securePath)
// We use %% for literal percent signs in Sprintf
// and we avoid backticks in the JS code by using regular strings to remain compatible with Go raw strings.
html := fmt.Sprintf(`