mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 23:00:25 +08:00
多处增加是否独立配置选项
This commit is contained in:
@@ -27,7 +27,7 @@ func (this *IndexAction) RunGet(params struct {
|
||||
}
|
||||
|
||||
this.Data["webId"] = webConfig.Id
|
||||
this.Data["charset"] = webConfig.Charset
|
||||
this.Data["charsetConfig"] = webConfig.Charset
|
||||
|
||||
this.Data["usualCharsets"] = configutils.UsualCharsets
|
||||
this.Data["allCharsets"] = configutils.AllCharsets
|
||||
@@ -37,13 +37,13 @@ func (this *IndexAction) RunGet(params struct {
|
||||
|
||||
func (this *IndexAction) RunPost(params struct {
|
||||
WebId int64
|
||||
Charset string
|
||||
CharsetJSON []byte
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{
|
||||
WebId: params.WebId,
|
||||
Charset: params.Charset,
|
||||
CharsetJSON: params.CharsetJSON,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
|
||||
@@ -53,6 +53,15 @@ func (this *IndexAction) RunGet(params struct {
|
||||
|
||||
this.Data["gzipConfig"] = gzipConfig
|
||||
|
||||
if webConfig.GzipRef == nil {
|
||||
webConfig.GzipRef = &serverconfigs.HTTPGzipRef{
|
||||
IsPrior: false,
|
||||
IsOn: false,
|
||||
GzipId: 0,
|
||||
}
|
||||
}
|
||||
this.Data["gzipRef"] = webConfig.GzipRef
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package headers
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"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/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
@@ -24,42 +25,52 @@ func (this *IndexAction) RunGet(params struct {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
webId := webConfig.Id
|
||||
|
||||
// 初始化Header
|
||||
webResp, err := this.RPC().HTTPWebRPC().FindEnabledHTTPWeb(this.AdminContext(), &pb.FindEnabledHTTPWebRequest{WebId: webConfig.Id})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
web := webResp.Web
|
||||
if web == nil {
|
||||
this.ErrorPage(errors.New("web should not be nil"))
|
||||
return
|
||||
}
|
||||
isChanged := false
|
||||
if web.RequestHeaderPolicyId <= 0 {
|
||||
if webConfig.RequestHeaderPolicy == nil {
|
||||
createHeaderPolicyResp, err := this.RPC().HTTPHeaderPolicyRPC().CreateHTTPHeaderPolicy(this.AdminContext(), &pb.CreateHTTPHeaderPolicyRequest{})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
headerPolicyId := createHeaderPolicyResp.HeaderPolicyId
|
||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeaderPolicy(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderPolicyRequest{
|
||||
WebId: web.Id,
|
||||
ref := &shared.HTTPHeaderPolicyRef{
|
||||
IsPrior: false,
|
||||
IsOn: true,
|
||||
HeaderPolicyId: headerPolicyId,
|
||||
}
|
||||
refJSON, err := json.Marshal(ref)
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
||||
WebId: webId,
|
||||
HeaderJSON: refJSON,
|
||||
})
|
||||
isChanged = true
|
||||
}
|
||||
if web.ResponseHeaderPolicyId <= 0 {
|
||||
if webConfig.ResponseHeaderPolicy == nil {
|
||||
createHeaderPolicyResp, err := this.RPC().HTTPHeaderPolicyRPC().CreateHTTPHeaderPolicy(this.AdminContext(), &pb.CreateHTTPHeaderPolicyRequest{})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
headerPolicyId := createHeaderPolicyResp.HeaderPolicyId
|
||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeaderPolicy(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderPolicyRequest{
|
||||
WebId: web.Id,
|
||||
ref := &shared.HTTPHeaderPolicyRef{
|
||||
IsPrior: false,
|
||||
IsOn: true,
|
||||
HeaderPolicyId: headerPolicyId,
|
||||
}
|
||||
refJSON, err := json.Marshal(ref)
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
||||
WebId: webId,
|
||||
HeaderJSON: refJSON,
|
||||
})
|
||||
isChanged = true
|
||||
}
|
||||
@@ -73,8 +84,10 @@ func (this *IndexAction) RunGet(params struct {
|
||||
}
|
||||
}
|
||||
|
||||
this.Data["requestHeaderPolicy"] = webConfig.RequestHeaders
|
||||
this.Data["responseHeaderPolicy"] = webConfig.ResponseHeaders
|
||||
this.Data["requestHeaderRef"] = webConfig.RequestHeaderPolicyRef
|
||||
this.Data["requestHeaderPolicy"] = webConfig.RequestHeaderPolicy
|
||||
this.Data["responseHeaderRef"] = webConfig.ResponseHeaderPolicyRef
|
||||
this.Data["responseHeaderPolicy"] = webConfig.ResponseHeaderPolicy
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ func (this *IndexAction) RunGet(params struct {
|
||||
}
|
||||
|
||||
this.Data["webId"] = webConfig.Id
|
||||
this.Data["charset"] = webConfig.Charset
|
||||
this.Data["charsetConfig"] = webConfig.Charset
|
||||
|
||||
this.Data["usualCharsets"] = configutils.UsualCharsets
|
||||
this.Data["allCharsets"] = configutils.AllCharsets
|
||||
@@ -35,13 +35,13 @@ func (this *IndexAction) RunGet(params struct {
|
||||
|
||||
func (this *IndexAction) RunPost(params struct {
|
||||
WebId int64
|
||||
Charset string
|
||||
CharsetJSON []byte
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebCharset(this.AdminContext(), &pb.UpdateHTTPWebCharsetRequest{
|
||||
WebId: params.WebId,
|
||||
Charset: params.Charset,
|
||||
CharsetJSON: params.CharsetJSON,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
|
||||
@@ -53,11 +53,21 @@ func (this *IndexAction) RunGet(params struct {
|
||||
|
||||
this.Data["gzipConfig"] = gzipConfig
|
||||
|
||||
if webConfig.GzipRef == nil {
|
||||
webConfig.GzipRef = &serverconfigs.HTTPGzipRef{
|
||||
IsPrior: false,
|
||||
IsOn: false,
|
||||
GzipId: 0,
|
||||
}
|
||||
}
|
||||
this.Data["gzipRef"] = webConfig.GzipRef
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunPost(params struct {
|
||||
WebId int64
|
||||
GzipRefJSON []byte
|
||||
GzipId int64
|
||||
Level int
|
||||
MinLength string
|
||||
@@ -87,6 +97,14 @@ func (this *IndexAction) RunPost(params struct {
|
||||
}
|
||||
}
|
||||
|
||||
gzipRef := &serverconfigs.HTTPGzipRef{}
|
||||
err := json.Unmarshal(params.GzipRefJSON, gzipRef)
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
gzipRef.GzipId = params.GzipId
|
||||
|
||||
if params.GzipId > 0 {
|
||||
_, err := this.RPC().HTTPGzipRPC().UpdateHTTPGzip(this.AdminContext(), &pb.UpdateHTTPGzipRequest{
|
||||
GzipId: params.GzipId,
|
||||
@@ -109,11 +127,9 @@ func (this *IndexAction) RunPost(params struct {
|
||||
return
|
||||
}
|
||||
gzipId := resp.GzipId
|
||||
|
||||
gzipRef := &serverconfigs.HTTPGzipRef{
|
||||
IsOn: true,
|
||||
GzipId: gzipId,
|
||||
gzipRef.GzipId = gzipId
|
||||
}
|
||||
|
||||
gzipRefJSON, err := json.Marshal(gzipRef)
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
@@ -127,7 +143,6 @@ func (this *IndexAction) RunPost(params struct {
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
}
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package headers
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"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/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
@@ -23,41 +25,54 @@ func (this *IndexAction) RunGet(params struct {
|
||||
return
|
||||
}
|
||||
|
||||
// 初始化Header
|
||||
webResp, err := this.RPC().HTTPWebRPC().FindEnabledHTTPWeb(this.AdminContext(), &pb.FindEnabledHTTPWebRequest{WebId: webConfig.Id})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
web := webResp.Web
|
||||
if web == nil {
|
||||
this.ErrorPage(errors.New("web should not be nil"))
|
||||
return
|
||||
}
|
||||
webId := webConfig.Id
|
||||
this.Data["webId"] = webId
|
||||
|
||||
isChanged := false
|
||||
if web.RequestHeaderPolicyId <= 0 {
|
||||
|
||||
if webConfig.RequestHeaderPolicy == nil {
|
||||
createHeaderPolicyResp, err := this.RPC().HTTPHeaderPolicyRPC().CreateHTTPHeaderPolicy(this.AdminContext(), &pb.CreateHTTPHeaderPolicyRequest{})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
headerPolicyId := createHeaderPolicyResp.HeaderPolicyId
|
||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeaderPolicy(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderPolicyRequest{
|
||||
WebId: web.Id,
|
||||
ref := &shared.HTTPHeaderPolicyRef{
|
||||
IsPrior: false,
|
||||
IsOn: true,
|
||||
HeaderPolicyId: headerPolicyId,
|
||||
}
|
||||
refJSON, err := json.Marshal(ref)
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
||||
WebId: webId,
|
||||
HeaderJSON: refJSON,
|
||||
})
|
||||
isChanged = true
|
||||
}
|
||||
if web.ResponseHeaderPolicyId <= 0 {
|
||||
if webConfig.ResponseHeaderPolicy == nil {
|
||||
createHeaderPolicyResp, err := this.RPC().HTTPHeaderPolicyRPC().CreateHTTPHeaderPolicy(this.AdminContext(), &pb.CreateHTTPHeaderPolicyRequest{})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
headerPolicyId := createHeaderPolicyResp.HeaderPolicyId
|
||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeaderPolicy(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderPolicyRequest{
|
||||
WebId: web.Id,
|
||||
ref := &shared.HTTPHeaderPolicyRef{
|
||||
IsPrior: false,
|
||||
IsOn: true,
|
||||
HeaderPolicyId: headerPolicyId,
|
||||
}
|
||||
refJSON, err := json.Marshal(ref)
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
_, err = this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
||||
WebId: webId,
|
||||
HeaderJSON: refJSON,
|
||||
})
|
||||
isChanged = true
|
||||
}
|
||||
@@ -71,8 +86,44 @@ func (this *IndexAction) RunGet(params struct {
|
||||
}
|
||||
}
|
||||
|
||||
this.Data["requestHeaderPolicy"] = webConfig.RequestHeaders
|
||||
this.Data["responseHeaderPolicy"] = webConfig.ResponseHeaders
|
||||
this.Data["requestHeaderRef"] = webConfig.RequestHeaderPolicyRef
|
||||
this.Data["requestHeaderPolicy"] = webConfig.RequestHeaderPolicy
|
||||
this.Data["responseHeaderRef"] = webConfig.ResponseHeaderPolicyRef
|
||||
this.Data["responseHeaderPolicy"] = webConfig.ResponseHeaderPolicy
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunPost(params struct {
|
||||
WebId int64
|
||||
Type string
|
||||
RequestHeaderJSON []byte
|
||||
ResponseHeaderJSON []byte
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
// TODO 检查配置
|
||||
|
||||
switch params.Type {
|
||||
case "request":
|
||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebRequestHeader(this.AdminContext(), &pb.UpdateHTTPWebRequestHeaderRequest{
|
||||
WebId: params.WebId,
|
||||
HeaderJSON: params.RequestHeaderJSON,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
case "response":
|
||||
_, err := this.RPC().HTTPWebRPC().UpdateHTTPWebResponseHeader(this.AdminContext(), &pb.UpdateHTTPWebResponseHeaderRequest{
|
||||
WebId: params.WebId,
|
||||
HeaderJSON: params.ResponseHeaderJSON,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
this.Success()
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ func init() {
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Data("tinyMenuItem", "header").
|
||||
Prefix("/servers/server/settings/locations/headers").
|
||||
Get("", new(IndexAction)).
|
||||
GetPost("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/webutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/iwind/TeaGo/actions"
|
||||
)
|
||||
|
||||
type IndexAction struct {
|
||||
actionutils.ParentAction
|
||||
}
|
||||
|
||||
func (this *IndexAction) Init() {
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunGet(params struct {
|
||||
LocationId int64
|
||||
}) {
|
||||
// 跳转相关设置
|
||||
webConfig, err := webutils.FindWebConfigWithLocationId(this.Parent(), params.LocationId)
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
return
|
||||
}
|
||||
this.Data["webId"] = webConfig.Id
|
||||
this.Data["redirectToHTTPSConfig"] = webConfig.RedirectToHttps
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
func (this *IndexAction) RunPost(params struct {
|
||||
WebId int64
|
||||
RedirectToHTTPSJSON []byte
|
||||
|
||||
Must *actions.Must
|
||||
}) {
|
||||
// 设置跳转到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()
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/locations/locationutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/serverutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
||||
"github.com/iwind/TeaGo"
|
||||
)
|
||||
|
||||
func init() {
|
||||
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
||||
server.
|
||||
Helper(helpers.NewUserMustAuth()).
|
||||
Helper(locationutils.NewLocationHelper()).
|
||||
Helper(serverutils.NewServerHelper()).
|
||||
Data("tinyMenuItem", "http").
|
||||
Prefix("/servers/server/settings/locations/http").
|
||||
GetPost("", new(IndexAction)).
|
||||
EndAll()
|
||||
})
|
||||
}
|
||||
@@ -55,6 +55,12 @@ func (this *LocationHelper) createMenus(serverIdString string, locationIdString
|
||||
},
|
||||
}
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "HTTP",
|
||||
"url": "/servers/server/settings/locations/http?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
"isActive": secondMenuItem == "http",
|
||||
})
|
||||
|
||||
menuItems = append(menuItems, maps.Map{
|
||||
"name": "Web设置",
|
||||
"url": "/servers/server/settings/locations/web?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||
|
||||
@@ -41,6 +41,7 @@ import (
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/locations/charset"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/locations/gzip"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/locations/headers"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/locations/http"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/locations/location"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/locations/pages"
|
||||
_ "github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/server/settings/locations/reverseProxy"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Vue.component("http-access-log-config-box", {
|
||||
props: ["v-access-log-config", "v-fields", "v-default-field-codes", "v-access-log-policies"],
|
||||
props: ["v-access-log-config", "v-fields", "v-default-field-codes", "v-access-log-policies", "v-is-location"],
|
||||
data: function () {
|
||||
let that = this
|
||||
|
||||
@@ -10,6 +10,7 @@ Vue.component("http-access-log-config-box", {
|
||||
}, 100)
|
||||
|
||||
let accessLog = {
|
||||
isPrior: false,
|
||||
isOn: true,
|
||||
fields: [],
|
||||
status1: true,
|
||||
@@ -59,7 +60,8 @@ Vue.component("http-access-log-config-box", {
|
||||
template: `<div>
|
||||
<input type="hidden" name="accessLogJSON" :value="JSON.stringify(accessLog)"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tbody>
|
||||
<prior-checkbox :v-config="accessLog" v-if="vIsLocation"></prior-checkbox>
|
||||
<tbody v-show="!vIsLocation || accessLog.isPrior">
|
||||
<tr>
|
||||
<td class="title">是否开启访问日志存储</td>
|
||||
<td>
|
||||
@@ -71,7 +73,7 @@ Vue.component("http-access-log-config-box", {
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody v-show="accessLog.isOn">
|
||||
<tbody v-show="(!vIsLocation || accessLog.isPrior) && accessLog.isOn">
|
||||
<tr>
|
||||
<td>要存储的访问日志字段</td>
|
||||
<td>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
Vue.component("http-cache-config-box", {
|
||||
props: ["v-cache-config", "v-cache-policies"],
|
||||
props: ["v-cache-config", "v-cache-policies", "v-is-location"],
|
||||
data: function () {
|
||||
let cacheConfig = this.vCacheConfig
|
||||
if (cacheConfig == null) {
|
||||
cacheConfig = {
|
||||
isPrior: false,
|
||||
isOn: false,
|
||||
cachePolicyId: 0
|
||||
}
|
||||
@@ -20,7 +21,8 @@ Vue.component("http-cache-config-box", {
|
||||
template: `<div>
|
||||
<input type="hidden" name="cacheJSON" :value="JSON.stringify(cacheConfig)"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tbody>
|
||||
<prior-checkbox :v-config="cacheConfig" v-if="vIsLocation"></prior-checkbox>
|
||||
<tbody v-show="!vIsLocation || cacheConfig.isPrior">
|
||||
<tr>
|
||||
<td class="title">是否开启缓存</td>
|
||||
<td>
|
||||
@@ -31,7 +33,7 @@ Vue.component("http-cache-config-box", {
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody v-show="cacheConfig.isOn">
|
||||
<tbody v-show="(!vIsLocation || cacheConfig.isPrior) && cacheConfig.isOn">
|
||||
<tr>
|
||||
<td class="title">选择缓存策略</td>
|
||||
<td>
|
||||
|
||||
@@ -1,19 +1,37 @@
|
||||
Vue.component("http-charsets-box", {
|
||||
props: ["v-usual-charsets", "v-all-charsets", "v-charset"],
|
||||
props: ["v-usual-charsets", "v-all-charsets", "v-charset-config", "v-is-location"],
|
||||
data: function () {
|
||||
let charset = this.vCharset
|
||||
if (charset == null) {
|
||||
charset = ""
|
||||
let charsetConfig = this.vCharsetConfig
|
||||
if (charsetConfig == null) {
|
||||
charsetConfig = {
|
||||
isPrior: false,
|
||||
isOn: false,
|
||||
charset: ""
|
||||
}
|
||||
}
|
||||
return {
|
||||
charset: charset
|
||||
charsetConfig: charsetConfig
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<input type="hidden" name="charsetJSON" :value="JSON.stringify(charsetConfig)"/>
|
||||
<table class="ui table definition selectable">
|
||||
<prior-checkbox :v-config="charsetConfig" v-if="vIsLocation"></prior-checkbox>
|
||||
<tbody v-show="!vIsLocation || charsetConfig.isPrior">
|
||||
<tr>
|
||||
<td class="title">是否启用</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" v-model="charsetConfig.isOn"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody v-show="(!vIsLocation || charsetConfig.isPrior) && charsetConfig.isOn">
|
||||
<tr>
|
||||
<td class="title">选择字符编码</td>
|
||||
<td><select class="ui dropdown" style="width:20em" name="charset" v-model="charset">
|
||||
<td><select class="ui dropdown" style="width:20em" name="charset" v-model="charsetConfig.charset">
|
||||
<option value="">[未选择]</option>
|
||||
<optgroup label="常用字符编码"></optgroup>
|
||||
<option v-for="charset in vUsualCharsets" :value="charset.charset">{{charset.charset}}({{charset.name}})</option>
|
||||
@@ -22,6 +40,7 @@ Vue.component("http-charsets-box", {
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="margin"></div>
|
||||
</div>`
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
Vue.component("http-firewall-config-box", {
|
||||
props: ["v-firewall-config", "v-firewall-policies"],
|
||||
props: ["v-firewall-config", "v-firewall-policies", "v-is-location"],
|
||||
data: function () {
|
||||
let firewall = this.vFirewallConfig
|
||||
if (firewall == null) {
|
||||
firewall = {
|
||||
isPrior: false,
|
||||
isOn: false,
|
||||
firewallPolicyId: 0
|
||||
}
|
||||
@@ -21,7 +22,8 @@ Vue.component("http-firewall-config-box", {
|
||||
template: `<div>
|
||||
<input type="hidden" name="firewallJSON" :value="JSON.stringify(firewall)"/>
|
||||
<table class="ui table selectable definition">
|
||||
<tbody>
|
||||
<prior-checkbox :v-config="firewall" v-if="vIsLocation"></prior-checkbox>
|
||||
<tbody v-show="!vIsLocation || firewall.isPrior">
|
||||
<tr>
|
||||
<td class="title">是否启用Web防火墙</td>
|
||||
<td>
|
||||
@@ -32,7 +34,7 @@ Vue.component("http-firewall-config-box", {
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody v-show="firewall.isOn">
|
||||
<tbody v-show="(!vIsLocation || firewall.isPrior) && firewall.isOn">
|
||||
<tr>
|
||||
<td>选择Web防火墙策略</td>
|
||||
<td>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
Vue.component("http-gzip-box", {
|
||||
props: ["v-gzip-config"],
|
||||
props: ["v-gzip-config", "v-gzip-ref", "v-is-location"],
|
||||
data: function () {
|
||||
let gzip = this.vGzipConfig
|
||||
if (gzip == null) {
|
||||
@@ -16,7 +16,10 @@ Vue.component("http-gzip-box", {
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<input type="hidden" name="gzipRefJSON" :value="JSON.stringify(vGzipRef)"/>
|
||||
<table class="ui table selectable definition">
|
||||
<prior-checkbox :v-config="vGzipRef" v-if="vIsLocation"></prior-checkbox>
|
||||
<tbody v-show="!vIsLocation || vGzipRef.isPrior">
|
||||
<tr>
|
||||
<td class="title">压缩级别</td>
|
||||
<td>
|
||||
@@ -41,6 +44,7 @@ Vue.component("http-gzip-box", {
|
||||
<p class="comment">0表示不限制,内容长度从文件尺寸或Content-Length中获取。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>`
|
||||
})
|
||||
@@ -1,5 +1,5 @@
|
||||
Vue.component("http-header-policy-box", {
|
||||
props: ["v-request-header-policy", "v-response-header-policy", "v-params"],
|
||||
props: ["v-request-header-policy", "v-request-header-ref", "v-response-header-policy", "v-response-header-ref", "v-params", "v-is-location"],
|
||||
data: function () {
|
||||
let type = "request"
|
||||
let hash = window.location.hash
|
||||
@@ -7,6 +7,25 @@ Vue.component("http-header-policy-box", {
|
||||
type = "response"
|
||||
}
|
||||
|
||||
// ref
|
||||
let requestHeaderRef = this.vRequestHeaderRef
|
||||
if (requestHeaderRef == null) {
|
||||
requestHeaderRef = {
|
||||
isPrior: false,
|
||||
isOn: true,
|
||||
headerPolicyId: 0
|
||||
}
|
||||
}
|
||||
|
||||
let responseHeaderRef = this.vResponseHeaderRef
|
||||
if (responseHeaderRef == null) {
|
||||
responseHeaderRef = {
|
||||
isPrior: false,
|
||||
isOn: true,
|
||||
headerPolicyId: 0
|
||||
}
|
||||
}
|
||||
|
||||
// 请求相关
|
||||
let requestSettingHeaders = []
|
||||
let requestDeletingHeaders = []
|
||||
@@ -37,6 +56,9 @@ Vue.component("http-header-policy-box", {
|
||||
|
||||
return {
|
||||
type: type,
|
||||
typeName: (type == "request") ? "请求" : "响应",
|
||||
requestHeaderRef: requestHeaderRef,
|
||||
responseHeaderRef: responseHeaderRef,
|
||||
requestSettingHeaders: requestSettingHeaders,
|
||||
requestDeletingHeaders: requestDeletingHeaders,
|
||||
responseSettingHeaders: responseSettingHeaders,
|
||||
@@ -47,6 +69,7 @@ Vue.component("http-header-policy-box", {
|
||||
selectType: function (type) {
|
||||
this.type = type
|
||||
window.location.hash = "#" + type
|
||||
window.location.reload()
|
||||
},
|
||||
addSettingHeader: function (policyId) {
|
||||
teaweb.popup("/servers/server/settings/headers/createSetPopup?" + this.vParams + "&headerPolicyId=" + policyId, {
|
||||
@@ -101,9 +124,19 @@ Vue.component("http-header-policy-box", {
|
||||
|
||||
<div class="margin"></div>
|
||||
|
||||
<input type="hidden" name="type" :value="type"/>
|
||||
|
||||
<!-- 请求 -->
|
||||
<div v-if="type == 'request'">
|
||||
<h3>设置Header <a href="" @click.prevent="addSettingHeader(vRequestHeaderPolicy.id)">[添加新Header]</a></h3>
|
||||
<div v-if="vIsLocation && type == 'request'">
|
||||
<input type="hidden" name="requestHeaderJSON" :value="JSON.stringify(requestHeaderRef)"/>
|
||||
<table class="ui table definition selectable">
|
||||
<prior-checkbox :v-config="requestHeaderRef"></prior-checkbox>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</div>
|
||||
|
||||
<div v-if="(!vIsLocation || requestHeaderRef.isPrior) && type == 'request'">
|
||||
<h3>设置请求Header <a href="" @click.prevent="addSettingHeader(vRequestHeaderPolicy.id)">[添加新Header]</a></h3>
|
||||
<p class="comment" v-if="requestSettingHeaders.length == 0">暂时还没有Header。</p>
|
||||
<table class="ui table selectable" v-if="requestSettingHeaders.length > 0">
|
||||
<thead>
|
||||
@@ -120,7 +153,7 @@ Vue.component("http-header-policy-box", {
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>删除Header</h3>
|
||||
<h3>删除请求Header</h3>
|
||||
<p class="comment">这里可以设置需要从请求中删除的Header。</p>
|
||||
|
||||
<table class="ui table definition selectable">
|
||||
@@ -136,8 +169,16 @@ Vue.component("http-header-policy-box", {
|
||||
</div>
|
||||
|
||||
<!-- 响应 -->
|
||||
<div v-if="vIsLocation && type == 'response'">
|
||||
<input type="hidden" name="responseHeaderJSON" :value="JSON.stringify(responseHeaderRef)"/>
|
||||
<table class="ui table definition selectable">
|
||||
<prior-checkbox :v-config="responseHeaderRef"></prior-checkbox>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</div>
|
||||
|
||||
<div v-if="type == 'response'">
|
||||
<h3>设置Header <a href="" @click.prevent="addSettingHeader(vResponseHeaderPolicy.id)">[添加新Header]</a></h3>
|
||||
<h3>设置响应Header <a href="" @click.prevent="addSettingHeader(vResponseHeaderPolicy.id)">[添加新Header]</a></h3>
|
||||
<p class="comment" v-if="responseSettingHeaders.length == 0">暂时还没有Header。</p>
|
||||
<table class="ui table selectable" v-if="responseSettingHeaders.length > 0">
|
||||
<thead>
|
||||
@@ -154,7 +195,7 @@ Vue.component("http-header-policy-box", {
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<h3>删除Header</h3>
|
||||
<h3>删除响应Header</h3>
|
||||
<p class="comment">这里可以设置需要从响应中删除的Header。</p>
|
||||
|
||||
<table class="ui table definition selectable">
|
||||
@@ -168,6 +209,6 @@ Vue.component("http-header-policy-box", {
|
||||
</td>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="margin"></div>
|
||||
</div>`
|
||||
})
|
||||
@@ -0,0 +1,45 @@
|
||||
Vue.component("http-redirect-to-https-box", {
|
||||
props: ["v-redirect-to-https-config", "v-is-location"],
|
||||
data: function () {
|
||||
let redirectToHttpsConfig = this.vRedirectToHttpsConfig
|
||||
if (redirectToHttpsConfig == null) {
|
||||
redirectToHttpsConfig = {
|
||||
isPrior: false,
|
||||
isOn: false
|
||||
}
|
||||
}
|
||||
return {
|
||||
redirectToHttpsConfig: redirectToHttpsConfig
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<input type="hidden" name="redirectToHTTPSJSON" :value="JSON.stringify(redirectToHttpsConfig)"/>
|
||||
|
||||
<!-- Location -->
|
||||
<table class="ui table selectable definition" v-if="vIsLocation">
|
||||
<prior-checkbox :v-config="redirectToHttpsConfig"></prior-checkbox>
|
||||
<tbody v-show="redirectToHttpsConfig.isPrior">
|
||||
<tr>
|
||||
<td class="title">自动跳转到HTTPS</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" v-model="redirectToHttpsConfig.isOn"/>
|
||||
<label></label>
|
||||
</div>
|
||||
<p class="comment">开启后,所有HTTP的请求都会自动跳转到对应的HTTPS URL上。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<!-- 非Location -->
|
||||
<div v-if="!vIsLocation">
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" v-model="redirectToHttpsConfig.isOn"/>
|
||||
<label></label>
|
||||
</div>
|
||||
<p class="comment">开启后,所有HTTP的请求都会自动跳转到对应的HTTPS URL上。</p>
|
||||
</div>
|
||||
<div class="margin"></div>
|
||||
</div>`
|
||||
})
|
||||
@@ -1,9 +1,10 @@
|
||||
Vue.component("http-stat-config-box", {
|
||||
props: ["v-stat-config"],
|
||||
props: ["v-stat-config", "v-is-location"],
|
||||
data: function () {
|
||||
let stat = this.vStatConfig
|
||||
if (stat == null) {
|
||||
stat = {
|
||||
isPrior: false,
|
||||
isOn: true
|
||||
}
|
||||
}
|
||||
@@ -14,6 +15,8 @@ Vue.component("http-stat-config-box", {
|
||||
template: `<div>
|
||||
<input type="hidden" name="statJSON" :value="JSON.stringify(stat)"/>
|
||||
<table class="ui table definition selectable">
|
||||
<prior-checkbox :v-config="stat" v-if="vIsLocation" ></prior-checkbox>
|
||||
<tbody v-show="!vIsLocation || stat.isPrior">
|
||||
<tr>
|
||||
<td class="title">是否开启统计</td>
|
||||
<td>
|
||||
@@ -23,6 +26,7 @@ Vue.component("http-stat-config-box", {
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="margin"></div>
|
||||
</div>`
|
||||
|
||||
25
web/public/js/components/server/prior-checkbox.js
Normal file
25
web/public/js/components/server/prior-checkbox.js
Normal file
@@ -0,0 +1,25 @@
|
||||
Vue.component("prior-checkbox", {
|
||||
props: ["v-config"],
|
||||
data: function () {
|
||||
return {
|
||||
isPrior: this.vConfig.isPrior
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
isPrior: function (v) {
|
||||
this.vConfig.isPrior = v
|
||||
}
|
||||
},
|
||||
template: `<tbody>
|
||||
<tr :class="{active:isPrior}">
|
||||
<td class="title">打开独立配置</td>
|
||||
<td>
|
||||
<div class="ui toggle checkbox">
|
||||
<input type="checkbox" v-model="isPrior"/>
|
||||
<label class="red"></label>
|
||||
</div>
|
||||
<p class="comment"><strong v-if="isPrior">[已打开]</strong> 打开后可以覆盖父级配置。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>`
|
||||
})
|
||||
34
web/public/js/components/server/reverse-proxy-box.js
Normal file
34
web/public/js/components/server/reverse-proxy-box.js
Normal file
@@ -0,0 +1,34 @@
|
||||
Vue.component("reverse-proxy-box", {
|
||||
props: ["v-reverse-proxy-ref", "v-is-location"],
|
||||
data: function () {
|
||||
let reverseProxyRef = this.vReverseProxyRef
|
||||
if (reverseProxyRef == null) {
|
||||
reverseProxyRef = {
|
||||
isPrior: false,
|
||||
isOn: false,
|
||||
reverseProxyId: 0
|
||||
}
|
||||
}
|
||||
return {
|
||||
reverseProxyRef: reverseProxyRef
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<input type="hidden" name="reverseProxyRefJSON" :value="JSON.stringify(reverseProxyRef)"/>
|
||||
<table class="ui table selectable definition">
|
||||
<prior-checkbox :v-config="reverseProxyRef" v-if="vIsLocation"></prior-checkbox>
|
||||
<tbody v-show="!vIsLocation || reverseProxyRef.isPrior">
|
||||
<tr>
|
||||
<td class="title">是否启用反向代理</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" v-model="reverseProxyRef.isOn"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="margin"></div>
|
||||
</div>`
|
||||
})
|
||||
@@ -111,6 +111,9 @@ tbody {
|
||||
.table td {
|
||||
font-size: 0.9em !important;
|
||||
}
|
||||
.table tr.active td {
|
||||
background: rgba(0, 0, 0, 0.01) !important;
|
||||
}
|
||||
p.comment,
|
||||
div.comment {
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -6,8 +6,9 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=0">
|
||||
<link rel="shortcut icon" href="/images/favicon.png"/>
|
||||
<link rel="stylesheet" type="text/css" href="/_/@default/@layout.css" media="all"/>
|
||||
|
||||
{$TEA.SEMANTIC}
|
||||
<link rel="stylesheet" type="text/css" href="/_/@default/@layout_override.css" media="all"/>
|
||||
|
||||
{$TEA.VUE}
|
||||
{$echo "header"}
|
||||
<script type="text/javascript" src="/_/@default/@layout.js"></script>
|
||||
|
||||
@@ -2,6 +2,10 @@ Tea.context(function () {
|
||||
this.moreOptionsVisible = false;
|
||||
this.globalChangedClusters = [];
|
||||
|
||||
if (typeof this.leftMenuItemIsDisabled == "undefined") {
|
||||
this.leftMenuItemIsDisabled = false
|
||||
}
|
||||
|
||||
this.$delay(function () {
|
||||
if (this.$refs.focus != null) {
|
||||
this.$refs.focus.focus();
|
||||
|
||||
@@ -57,6 +57,10 @@ tbody {
|
||||
font-size: 0.9em !important;
|
||||
}
|
||||
|
||||
.table tr.active td {
|
||||
background: rgba(0, 0, 0, 0.01) !important;
|
||||
}
|
||||
|
||||
p.comment, div.comment {
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
padding-top: 0.4em;
|
||||
|
||||
9
web/views/@default/@layout_override.css
Normal file
9
web/views/@default/@layout_override.css
Normal file
@@ -0,0 +1,9 @@
|
||||
.ui.toggle.checkbox input:focus:checked ~ .box:before,
|
||||
.ui.toggle.checkbox input:focus:checked ~ label:before {
|
||||
background-color: #21ba45 !important;
|
||||
}
|
||||
.ui.toggle.checkbox input:checked ~ .box:before,
|
||||
.ui.toggle.checkbox input:checked ~ label:before {
|
||||
background-color: #21ba45 !important;
|
||||
}
|
||||
/*# sourceMappingURL=@layout_override.css.map */
|
||||
1
web/views/@default/@layout_override.css.map
Normal file
1
web/views/@default/@layout_override.css.map
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["@layout_override.less"],"names":[],"mappings":"AACA,GAAG,OAAO,SAAU,MAAK,MAAM,QAAS,OAAM;AAAS,GAAG,OAAO,SAAU,MAAK,MAAM,QAAS,QAAO;EACrG,oCAAA;;AAGD,GAAG,OAAO,SAAU,MAAK,QAAS,OAAM;AAAS,GAAG,OAAO,SAAU,MAAK,QAAS,QAAO;EACzF,oCAAA","file":"@layout_override.css"}
|
||||
8
web/views/@default/@layout_override.less
Normal file
8
web/views/@default/@layout_override.less
Normal file
@@ -0,0 +1,8 @@
|
||||
// labels
|
||||
.ui.toggle.checkbox input:focus:checked ~ .box:before, .ui.toggle.checkbox input:focus:checked ~ label:before {
|
||||
background-color: #21ba45 !important;
|
||||
}
|
||||
|
||||
.ui.toggle.checkbox input:checked ~ .box:before, .ui.toggle.checkbox input:checked ~ label:before {
|
||||
background-color: #21ba45 !important;
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="right-box">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-charsets-box :v-usual-charsets="usualCharsets" :v-all-charsets="allCharsets" :v-charset="charset"></http-charsets-box>
|
||||
<http-charsets-box :v-usual-charsets="usualCharsets" :v-all-charsets="allCharsets" :v-charset-config="charsetConfig"></http-charsets-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
@@ -5,6 +5,7 @@
|
||||
<div class="right-box">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="serverId" :value="serverId"/>
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<input type="hidden" name="serverType" :value="serverType"/>
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
@@ -13,6 +14,12 @@
|
||||
<network-addresses-box :v-server-type="serverType" :v-addresses="httpConfig.addresses" :v-protocol="'http'"></network-addresses-box>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>自动跳转到HTTPS</td>
|
||||
<td>
|
||||
<http-redirect-to-https-box :v-redirect-to-https-config="redirectToHTTPSConfig"></http-redirect-to-https-box>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
:v-access-log-config="accessLogConfig"
|
||||
:v-fields="fields"
|
||||
:v-default-field-codes="defaultFieldCodes"
|
||||
:v-access-log-policies="accessLogPolicies"></http-access-log-config-box>
|
||||
:v-access-log-policies="accessLogPolicies"
|
||||
:v-is-location="true"></http-access-log-config-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="right-box tiny">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-cache-config-box :v-cache-config="cacheConfig" :v-cache-policies="policies"></http-cache-config-box>
|
||||
<http-cache-config-box :v-cache-config="cacheConfig" :v-cache-policies="policies" :v-is-location="true"></http-cache-config-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="margin"></div>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-charsets-box :v-usual-charsets="usualCharsets" :v-all-charsets="allCharsets" :v-charset="charset"></http-charsets-box>
|
||||
<http-charsets-box :v-usual-charsets="usualCharsets" :v-all-charsets="allCharsets" :v-charset-config="charsetConfig" :v-is-location="true"></http-charsets-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<input type="hidden" name="gzipId" :value="gzipConfig.id"/>
|
||||
|
||||
<http-gzip-box :v-gzip-config="gzipConfig"></http-gzip-box>
|
||||
<http-gzip-box :v-gzip-ref="gzipRef" :v-gzip-config="gzipConfig" :v-is-location="true"></http-gzip-box>
|
||||
|
||||
<div class="margin"></div>
|
||||
<submit-btn></submit-btn>
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>添加需要删除的Header</h3>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="headerPolicyId" :value="headerPolicyId"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">名称<em>(Name)</em></td>
|
||||
<td>
|
||||
<input type="text" name="name" maxlength="100" ref="focus"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
@@ -1,3 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
})
|
||||
@@ -1,22 +0,0 @@
|
||||
{$layout "layout_popup"}
|
||||
<h3>设置Header</h3>
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="serverId" :value="serverId"/>
|
||||
<input type="hidden" name="headerPolicyId" :value="headerPolicyId"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">名称<em>(Name)</em></td>
|
||||
<td>
|
||||
<input type="text" name="name" value="" maxlength="200" placeholder="类似于Server、Content-Type之类" ref="focus"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>值<em>(Value)</em></td>
|
||||
<td>
|
||||
<input type="text" name="value" maxlength="500"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
@@ -1,3 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
})
|
||||
@@ -7,6 +7,15 @@
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<http-header-policy-box :v-request-header-policy="requestHeaderPolicy" :v-response-header-policy="responseHeaderPolicy" :v-params="'serverId=' + serverId"></http-header-policy-box>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-header-policy-box
|
||||
:v-request-header-policy="requestHeaderPolicy"
|
||||
:v-request-header-ref="requestHeaderRef"
|
||||
:v-response-header-policy="responseHeaderPolicy"
|
||||
:v-response-header-ref="responseHeaderRef"
|
||||
:v-params="'serverId=' + serverId"
|
||||
:v-is-location="true"></http-header-policy-box>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -1,23 +0,0 @@
|
||||
{$layout "layout_popup"}
|
||||
<h3>修改Header</h3>
|
||||
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="serverId" :value="serverId"/>
|
||||
<input type="hidden" name="headerPolicyId" :value="headerPolicyId"/>
|
||||
<input type="hidden" name="headerId" :value="headerId"/>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td class="title">名称<em>(Name)</em></td>
|
||||
<td>
|
||||
<input type="text" name="name" value="" v-model="headerConfig.name" maxlength="200" placeholder="类似于Server、Content-Type之类" ref="focus"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>值<em>(Value)</em></td>
|
||||
<td>
|
||||
<input type="text" name="value" v-model="headerConfig.value" maxlength="500"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
@@ -1,3 +0,0 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
})
|
||||
@@ -0,0 +1,16 @@
|
||||
{$layout}
|
||||
{$template "/left_menu"}
|
||||
|
||||
<div class="right-box">
|
||||
{$template "../location_menu"}
|
||||
{$template "../left_menu"}
|
||||
|
||||
<div class="right-box tiny">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
|
||||
<http-redirect-to-https-box :v-redirect-to-https-config="redirectToHTTPSConfig" :v-is-location="true"></http-redirect-to-https-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyReloadSuccess("保存成功")
|
||||
})
|
||||
@@ -10,24 +10,14 @@
|
||||
<div class="margin"></div>
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="locationId" :value="locationId"/>
|
||||
<input type="hidden" name="reverseProxyRefJSON" :value="JSON.stringify(reverseProxyRef)"/>
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">是否启用反向代理</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" v-model="reverseProxyRef.isOn"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<reverse-proxy-box :v-reverse-proxy-ref="reverseProxyRef" :v-is-location="true"></reverse-proxy-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
|
||||
<div v-if="reverseProxyRef.isOn">
|
||||
<div v-if="reverseProxyRef.isPrior && reverseProxyRef.isOn">
|
||||
<div class="ui divider"></div>
|
||||
<origin-list-box :v-primary-origins="primaryOrigins" :v-backup-origins="backupOrigins" :v-server-type="serverType"
|
||||
<origin-list-box :v-primary-origins="primaryOrigins" :v-backup-origins="backupOrigins"
|
||||
:v-server-type="serverType"
|
||||
:v-params="'type=server&serverId=' + serverId + '&reverseProxyId=' + reverseProxyConfig.id"></origin-list-box>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="right-box tiny">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-stat-config-box :v-stat-config="statConfig"></http-stat-config-box>
|
||||
<http-stat-config-box :v-stat-config="statConfig" :v-is-location="true"></http-stat-config-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="right-box tiny">
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="webId" :value="webId"/>
|
||||
<http-firewall-config-box :v-firewall-config="firewallConfig" :v-firewall-policies="firewallPolicies"></http-firewall-config-box>
|
||||
<http-firewall-config-box :v-firewall-config="firewallConfig" :v-firewall-policies="firewallPolicies" :v-is-location="true"></http-firewall-config-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -8,17 +8,7 @@
|
||||
<form class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<input type="hidden" name="serverId" :value="serverId"/>
|
||||
<input type="hidden" name="reverseProxyRefJSON" :value="JSON.stringify(reverseProxyRef)"/>
|
||||
<table class="ui table selectable definition">
|
||||
<tr>
|
||||
<td class="title">是否启用反向代理</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" v-model="reverseProxyRef.isOn"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<reverse-proxy-box :v-reverse-proxy-ref="reverseProxyRef"></reverse-proxy-box>
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user