diff --git a/internal/web/actions/default/servers/components/cache/createPopup.go b/internal/web/actions/default/servers/components/cache/createPopup.go index 5e8b075e..2ede56c9 100644 --- a/internal/web/actions/default/servers/components/cache/createPopup.go +++ b/internal/web/actions/default/servers/components/cache/createPopup.go @@ -32,6 +32,7 @@ func (this *CreatePopupAction) RunPost(params struct { FileDir string FileMemoryCapacityJSON []byte FileOpenFileCacheMax int + FileEnableSendfile bool CapacityJSON []byte MaxSizeJSON []byte @@ -77,7 +78,8 @@ func (this *CreatePopupAction) RunPost(params struct { MemoryPolicy: &serverconfigs.HTTPCachePolicy{ Capacity: memoryCapacity, }, - OpenFileCache: openFileCacheConfig, + OpenFileCache: openFileCacheConfig, + EnableSendfile: params.FileEnableSendfile, } case serverconfigs.CachePolicyStorageMemory: options = &serverconfigs.HTTPMemoryCacheStorage{} diff --git a/internal/web/actions/default/servers/components/cache/update.go b/internal/web/actions/default/servers/components/cache/update.go index 3b4082b4..86e87398 100644 --- a/internal/web/actions/default/servers/components/cache/update.go +++ b/internal/web/actions/default/servers/components/cache/update.go @@ -26,13 +26,13 @@ func (this *UpdateAction) RunGet(params struct { this.ErrorPage(err) return } - configJSON := configResp.HttpCachePolicyJSON + var configJSON = configResp.HttpCachePolicyJSON if len(configJSON) == 0 { this.NotFound("cachePolicy", params.CachePolicyId) return } - cachePolicy := &serverconfigs.HTTPCachePolicy{} + var cachePolicy = &serverconfigs.HTTPCachePolicy{} err = json.Unmarshal(configJSON, cachePolicy) if err != nil { this.ErrorPage(err) @@ -56,6 +56,7 @@ func (this *UpdateAction) RunPost(params struct { FileDir string FileMemoryCapacityJSON []byte FileOpenFileCacheMax int + FileEnableSendfile bool CapacityJSON []byte MaxSizeJSON []byte @@ -106,7 +107,8 @@ func (this *UpdateAction) RunPost(params struct { MemoryPolicy: &serverconfigs.HTTPCachePolicy{ Capacity: memoryCapacity, }, - OpenFileCache: openFileCacheConfig, + OpenFileCache: openFileCacheConfig, + EnableSendfile: params.FileEnableSendfile, } case serverconfigs.CachePolicyStorageMemory: options = &serverconfigs.HTTPMemoryCacheStorage{} diff --git a/web/public/js/components.js b/web/public/js/components.js index fb77cd85..9c99418b 100755 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -4978,7 +4978,7 @@ Vue.component("http-cache-stale-config", { 启用过时缓存 -

选中后,在更新缓存失败后会尝试读取过时的缓存。

+

选中后,在更新缓存失败后会尝试读取过时的缓存。

@@ -6617,7 +6617,7 @@ Vue.component("http-pages-and-shutdown-box", { - + @@ -7525,7 +7525,7 @@ Vue.component("http-location-labels", { 请求脚本 - +
PAGE [状态码{{page.status[0]}}] -> {{page.url}}
@@ -8628,7 +8628,7 @@ Vue.component("http-web-root-box", { }) Vue.component("http-webp-config-box", { - props: ["v-webp-config", "v-is-location", "v-is-group"], + props: ["v-webp-config", "v-is-location", "v-is-group", "v-require-cache"], data: function () { let config = this.vWebpConfig if (config == null) { @@ -8698,13 +8698,13 @@ Vue.component("http-webp-config-box", { - + @@ -11142,6 +11142,10 @@ Vue.component("countries-selector", { ` }) +Vue.component("raquo-item", { + template: `»` +}) + Vue.component("more-options-tbody", { data: function () { return { @@ -11532,6 +11536,11 @@ Vue.component("optional-label", { template: `(可选)` }) +// Plus专属 +Vue.component("plus-label", { + template: `Plus专属功能。` +}) + /** * 一级菜单 */ @@ -13904,6 +13913,39 @@ Vue.component("node-combo-box", { ` }) +// 节点级别选择器 +Vue.component("node-level-selector", { + props: ["v-node-level"], + data: function () { + let levelCode = this.vNodeLevel + if (levelCode == null || levelCode < 1) { + levelCode = 1 + } + return { + levels: [ + { + name: "边缘节点", + code: 1, + description: "普通的边缘节点。" + }, + { + name: "L2节点", + code: 2, + description: "特殊的边缘节点,同时负责同组上一级节点的回源。" + } + ], + levelCode: levelCode + } + }, + template: `
+ +

{{levels[levelCode - 1].description}}

+
` +}) + Vue.component("dns-route-selector", { props: ["v-all-routes", "v-routes"], data: function () { diff --git a/web/public/js/components/common/labels.js b/web/public/js/components/common/labels.js index 94350e5e..c50a8e77 100644 --- a/web/public/js/components/common/labels.js +++ b/web/public/js/components/common/labels.js @@ -47,4 +47,9 @@ Vue.component("grey-label", { // 可选标签 Vue.component("optional-label", { template: `(可选)` +}) + +// Plus专属 +Vue.component("plus-label", { + template: `Plus专属功能。` }) \ No newline at end of file diff --git a/web/public/js/components/node/node-level-selector.js b/web/public/js/components/node/node-level-selector.js index 39d936a8..2273cdf7 100644 --- a/web/public/js/components/node/node-level-selector.js +++ b/web/public/js/components/node/node-level-selector.js @@ -26,6 +26,7 @@ Vue.component("node-level-selector", { -

{{levels[levelCode - 1].description}}

+

{{levels[levelCode - 1].description}}

` }) \ No newline at end of file diff --git a/web/public/js/components/server/http-cache-stale-config.js b/web/public/js/components/server/http-cache-stale-config.js index 3a5167c8..5767fa92 100644 --- a/web/public/js/components/server/http-cache-stale-config.js +++ b/web/public/js/components/server/http-cache-stale-config.js @@ -33,7 +33,7 @@ Vue.component("http-cache-stale-config", { diff --git a/web/views/@default/servers/components/cache/createPopup.html b/web/views/@default/servers/components/cache/createPopup.html index e39f30b6..f81c0e9a 100644 --- a/web/views/@default/servers/components/cache/createPopup.html +++ b/web/views/@default/servers/components/cache/createPopup.html @@ -45,6 +45,13 @@

保持缓存文件句柄,提升缓存文件打开速度,建议数量是缓存文件数量的10%。

+ + + + diff --git a/web/views/@default/servers/components/cache/update.html b/web/views/@default/servers/components/cache/update.html index df4766f2..406ce93f 100644 --- a/web/views/@default/servers/components/cache/update.html +++ b/web/views/@default/servers/components/cache/update.html @@ -54,6 +54,13 @@

保持缓存文件句柄,提升缓存文件打开速度,建议数量是缓存文件数量的10%。

+ + + +
特殊页面自定义页面
@@ -6628,7 +6628,7 @@ Vue.component("http-pages-and-shutdown-box", {
-

根据响应状态码返回一些特殊页面,比如404,500等错误页面。

+

根据响应状态码返回一些自定义页面,比如404,500等错误页面。

是否启用启用
-

选中后表示开启自动WebP压缩。

+

选中后表示开启自动WebP压缩;只有满足缓存条件的图片内容才会被转换

启用过时缓存 -

选中后,在更新缓存失败后会尝试读取过时的缓存。

+

选中后,在更新缓存失败后会尝试读取过时的缓存。

开启Sendfile + +

使用sendfile提升发送缓存文件的效率。

+
开启Sendfile + +

使用sendfile提升发送缓存文件的效率。

+