diff --git a/internal/web/actions/default/servers/server/settings/gzip/index.go b/internal/web/actions/default/servers/server/settings/gzip/index.go index 4ceb8c81..66b952d1 100644 --- a/internal/web/actions/default/servers/server/settings/gzip/index.go +++ b/internal/web/actions/default/servers/server/settings/gzip/index.go @@ -66,12 +66,13 @@ func (this *IndexAction) RunGet(params struct { } func (this *IndexAction) RunPost(params struct { - WebId int64 - GzipId int64 - Level int - MinLength string - MaxLength string - CondsJSON []byte + WebId int64 + GzipId int64 + Level int + MinLength string + MaxLength string + CondsJSON []byte + GzipRefJSON []byte Must *actions.Must }) { @@ -97,6 +98,13 @@ func (this *IndexAction) RunPost(params struct { } } + gzipRef := &serverconfigs.HTTPGzipRef{} + err := json.Unmarshal(params.GzipRefJSON, gzipRef) + if err != nil { + this.ErrorPage(err) + return + } + if params.GzipId > 0 { _, err := this.RPC().HTTPGzipRPC().UpdateHTTPGzip(this.AdminContext(), &pb.UpdateHTTPGzipRequest{ GzipId: params.GzipId, @@ -120,25 +128,21 @@ func (this *IndexAction) RunPost(params struct { this.ErrorPage(err) return } - gzipId := resp.GzipId + gzipRef.GzipId = resp.GzipId + } - gzipRef := &serverconfigs.HTTPGzipRef{ - IsOn: true, - GzipId: gzipId, - } - gzipRefJSON, err := json.Marshal(gzipRef) - if err != nil { - this.ErrorPage(err) - return - } + gzipRefJSON, err := json.Marshal(gzipRef) + if err != nil { + this.ErrorPage(err) + return + } - _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebGzip(this.AdminContext(), &pb.UpdateHTTPWebGzipRequest{ - WebId: params.WebId, - GzipJSON: gzipRefJSON, - }) - if err != nil { - this.ErrorPage(err) - } + _, err = this.RPC().HTTPWebRPC().UpdateHTTPWebGzip(this.AdminContext(), &pb.UpdateHTTPWebGzipRequest{ + WebId: params.WebId, + GzipJSON: gzipRefJSON, + }) + if err != nil { + this.ErrorPage(err) } this.Success() diff --git a/web/public/js/components/server/http-cache-config-box.js b/web/public/js/components/server/http-cache-config-box.js index 160131ed..263d72fb 100644 --- a/web/public/js/components/server/http-cache-config-box.js +++ b/web/public/js/components/server/http-cache-config-box.js @@ -108,7 +108,7 @@ Vue.component("http-cache-config-box", { 操作 - {{cacheRef.cachePolicy.name}} + {{cacheRef.cachePolicy.name}} diff --git a/web/public/js/components/server/http-location-labels.js b/web/public/js/components/server/http-location-labels.js index 2f8eb39d..d010a0ff 100644 --- a/web/public/js/components/server/http-location-labels.js +++ b/web/public/js/components/server/http-location-labels.js @@ -1,5 +1,5 @@ Vue.component("http-location-labels", { - props: ["v-location-config"], + props: ["v-location-config", "v-server-id"], data: function () { return { location: this.vLocationConfig @@ -17,32 +17,33 @@ Vue.component("http-location-labels", { len: function (arr) { return (arr == null) ? 0 : arr.length + }, + url: function (path) { + return "/servers/server/settings/locations" + path + "?serverId=" + this.vServerId + "&locationId=" + this.location.id } }, template: `
- - - {{location.name}} - BREAK + {{location.name}} + BREAK - 自动跳转HTTPS + 自动跳转HTTPS - 文档根目录 + 文档根目录 - 反向代理 + 反向代理 - + CACHE - {{location.web.charset.charset}} + {{location.web.charset.charset}} @@ -51,29 +52,33 @@ Vue.component("http-location-labels", { - Gzip:{{location.web.gzip.level}} + Gzip:{{location.web.gzip.level}} - 请求Header - 响应Header + 请求Header + 响应Header - Websocket + Websocket
-
PAGE [状态码{{page.status[0]}}] -> {{page.url}}
+
PAGE [状态码{{page.status[0]}}] -> {{page.url}}
- 临时关闭 + 临时关闭
- +
+
+ REWRITE {{rewriteRule.pattern}} -> {{rewriteRule.replace}} +
+
` }) Vue.component("http-location-labels-label", { - props: ["v-class"], - template: `` + props: ["v-class", "v-href"], + template: `` }) \ No newline at end of file diff --git a/web/views/@default/servers/server/settings/locations/index.html b/web/views/@default/servers/server/settings/locations/index.html index df5bea9c..b1f26f68 100644 --- a/web/views/@default/servers/server/settings/locations/index.html +++ b/web/views/@default/servers/server/settings/locations/index.html @@ -24,7 +24,7 @@ {{location.pattern}} - +