mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
Refactor: Load UserTemplates from embedded yaml file (#575)
* Refactor: Load UserTemplates from embedded yaml file * feat: add version field to UserTemplates * refactor: use shell script to fetch frontends * chore: add *-dist to .gitignore * refactor: rename to FrontendTemplates BREAKING CHANGE: This commit changes the `user_templates` filed in the communication json between backend and the admin-frontend. Keep user config.yml `user_template` filed.
This commit is contained in:
@@ -23,9 +23,9 @@ func listConfig(c *gin.Context) (model.SettingResponse, error) {
|
||||
authorized := isMember // TODO || isViewPasswordVerfied
|
||||
|
||||
conf := model.SettingResponse{
|
||||
Config: *singleton.Conf,
|
||||
Version: singleton.Version,
|
||||
UserTemplates: singleton.UserTemplates,
|
||||
Config: *singleton.Conf,
|
||||
Version: singleton.Version,
|
||||
FrontendTemplates: singleton.FrontendTemplates,
|
||||
}
|
||||
|
||||
if !authorized {
|
||||
@@ -59,8 +59,8 @@ func updateConfig(c *gin.Context) (any, error) {
|
||||
return nil, err
|
||||
}
|
||||
var userTemplateValid bool
|
||||
for _, v := range singleton.UserTemplates {
|
||||
if v.Path == sf.UserTemplate {
|
||||
for _, v := range singleton.FrontendTemplates {
|
||||
if v.Path == sf.UserTemplate && sf.UserTemplate != "admin-dist" {
|
||||
userTemplateValid = true
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user