mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-19 15:30:25 +08:00
多处增加是否独立配置选项
This commit is contained in:
@@ -3,6 +3,7 @@ package http
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/webutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/serverutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
|
||||
@@ -43,6 +44,15 @@ func (this *IndexAction) RunGet(params struct {
|
||||
"addresses": httpConfig.Listen,
|
||||
}
|
||||
|
||||
// 跳转相关设置
|
||||
webConfig, err := webutils.FindWebConfigWithServerId(this.Parent(), params.ServerId)
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
this.Data["webId"] = webConfig.Id
|
||||
this.Data["redirectToHTTPSConfig"] = webConfig.RedirectToHttps
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
@@ -50,6 +60,9 @@ func (this *IndexAction) RunPost(params struct {
|
||||
ServerId int64
|
||||
Addresses string
|
||||
|
||||
WebId int64
|
||||
RedirectToHTTPSJSON []byte
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
addresses := []*serverconfigs.NetworkAddressConfig{}
|
||||
@@ -89,5 +102,16 @@ func (this *IndexAction) RunPost(params struct {
|
||||
return
|
||||
}
|
||||
|
||||
// 设置跳转到HTTPS
|
||||
// TODO 校验设置
|
||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRedirectToHTTPS(this.AdminContext(), &pb.UpdateHTTPWebRedirectToHTTPSRequest{
|
||||
WebId: params.WebId,
|
||||
RedirectToHTTPSJSON: params.RedirectToHTTPSJSON,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user