自定义页面增加是否“启用系统自定义页面”选项

This commit is contained in:
刘祥超
2024-05-03 09:35:32 +08:00
parent d6de9b5b09
commit b82ae7274b
5 changed files with 52 additions and 2 deletions

View File

@@ -231,6 +231,8 @@ func (this *HTTPWebDAO) ComposeWebConfig(tx *dbs.Tx, webId int64, isLocationOrGr
}
// pages
config.EnableGlobalPages = web.EnableGlobalPages
// TODO 检查forNode参数
if IsNotNull(web.Pages) {
var pages = []*serverconfigs.HTTPPageConfig{}
@@ -758,6 +760,22 @@ func (this *HTTPWebDAO) UpdateWebPages(tx *dbs.Tx, webId int64, pagesJSON []byte
return this.NotifyUpdate(tx, webId)
}
// UpdateGlobalPagesEnabled 设置是否启用系统配置的自定义页面
func (this *HTTPWebDAO) UpdateGlobalPagesEnabled(tx *dbs.Tx, webId int64, isEnabled bool) error {
if webId <= 0 {
return errors.New("invalid webId")
}
err := this.Query(tx).
Pk(webId).
Set(HTTPWebField_EnableGlobalPages, isEnabled).
UpdateQuickly()
if err != nil {
return err
}
return this.NotifyUpdate(tx, webId)
}
// UpdateWebShutdown 更改Shutdown配置
func (this *HTTPWebDAO) UpdateWebShutdown(tx *dbs.Tx, webId int64, shutdownJSON []byte) error {
if webId <= 0 {