mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-11-24 16:06:55 +00:00
- 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
33 lines
604 B
Go
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()
|
|
}
|