mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-08 02:20:24 +08:00
自定义页面增加是否“启用系统自定义页面”选项
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user