Files
new-api/setting/system_setting/theme.go
T
t0ng7u 8153f7cfd7 🧹 chore: clean up editor configs, consolidate agent skills, and set classic as default theme
- Add .cursor/ to .gitignore and remove tracked editor config files
  (.cursor/rules/, .cursor/skills/) from version control
- Consolidate .agents/skills/vercel-react-best-practices by keeping only
  the compiled AGENTS.md and removing redundant SKILL.md and 57 individual
  rule files under rules/
- Change default frontend theme from "default" to "classic" in both
  common/constants.go init and setting/system_setting/theme.go
2026-04-16 18:08:09 +08:00

33 lines
604 B
Go

package system_setting
import (
"github.com/QuantumNous/new-api/common"
"github.com/QuantumNous/new-api/setting/config"
)
type ThemeSettings struct {
Frontend string `json:"frontend"`
}
var themeSettings = ThemeSettings{
Frontend: "classic",
}
func init() {
config.GlobalConfig.Register("theme", &themeSettings)
syncThemeToCommon()
}
func syncThemeToCommon() {
common.SetTheme(themeSettings.Frontend)
}
func GetThemeSettings() *ThemeSettings {
return &themeSettings
}
// UpdateAndSyncTheme syncs the theme config to common after DB load.
func UpdateAndSyncTheme() {
syncThemeToCommon()
}