feat: able to add more UI theme (#860)

This commit is contained in:
JustSong
2024-01-01 18:55:03 +08:00
parent 505817ca17
commit aa03c89133
72 changed files with 66 additions and 42 deletions

View File

@@ -15,15 +15,12 @@ import (
"strconv"
)
//go:embed web/build
//go:embed web/build/*
var buildFS embed.FS
//go:embed web/build/index.html
var indexPage []byte
func main() {
common.SetupLogger()
common.SysLog("One API " + common.Version + " started")
common.SysLog(fmt.Sprintf("One API %s started with theme %s", common.Version, common.Theme))
if os.Getenv("GIN_MODE") != "debug" {
gin.SetMode(gin.ReleaseMode)
}
@@ -95,7 +92,7 @@ func main() {
store := cookie.NewStore([]byte(common.SessionSecret))
server.Use(sessions.Sessions("session", store))
router.SetRouter(server, buildFS, indexPage)
router.SetRouter(server, buildFS)
var port = os.Getenv("PORT")
if port == "" {
port = strconv.Itoa(*common.Port)