From c4ee663285b2ef7d4f90ae15337347351068aa0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Wed, 8 Dec 2021 19:13:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E7=94=9F=E6=88=90components.?= =?UTF-8?q?js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/public/js/components.js | 127 +++++++++++++++++++++++++++++++++++- 1 file changed, 125 insertions(+), 2 deletions(-) diff --git a/web/public/js/components.js b/web/public/js/components.js index 45003181..e2ea7658 100755 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -2275,6 +2275,7 @@ Vue.component("http-cache-refs-box", { 0 - {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}} {{cacheRef.methods.join(", ")}} + Expires 状态码:{{cacheRef.status.map(function(v) {return v.toString()}).join(", ")}} @@ -2556,7 +2557,14 @@ Vue.component("http-cache-ref-box", { conds: null, allowChunkedEncoding: true, isReverse: this.vIsReverse, - methods: [] + methods: [], + expiresTime: { + isPrior: false, + isOn: false, + overwrite: true, + autoCalculate: true, + duration: {count: -1, "unit": "hour"} + } } } if (ref.key == null) { @@ -2614,6 +2622,9 @@ Vue.component("http-cache-ref-box", { }, changeKey: function (key) { this.$refs.variablesDescriber.update(key) + }, + changeExpiresTime: function (expiresTime) { + this.ref.expiresTime = expiresTime } }, template: ` @@ -2642,12 +2653,18 @@ Vue.component("http-cache-ref-box", { - 请求方法 + 请求方法限制

允许请求的缓存方法,默认支持所有的请求方法。

+ + 客户端过期时间(Expires) + + + + 可缓存的最大内容尺寸 @@ -3839,6 +3856,7 @@ Vue.component("http-cache-refs-config-box", { 0 - {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}} {{cacheRef.methods.join(", ")}} + Expires 状态码:{{cacheRef.status.map(function(v) {return v.toString()}).join(", ")}} @@ -6347,6 +6365,76 @@ Vue.component("http-charsets-box", { ` }) +Vue.component("http-expires-time-config-box", { + props: ["v-expires-time"], + data: function () { + let expiresTime = this.vExpiresTime + if (expiresTime == null) { + expiresTime = { + isPrior: false, + isOn: false, + overwrite: true, + autoCalculate: true, + duration: {count: -1, "unit": "hour"} + } + } + return { + expiresTime: expiresTime + } + }, + watch: { + "expiresTime.isPrior": function () { + this.notifyChange() + }, + "expiresTime.isOn": function () { + this.notifyChange() + }, + "expiresTime.overwrite": function () { + this.notifyChange() + }, + "expiresTime.autoCalculate": function () { + this.notifyChange() + } + }, + methods: { + notifyChange: function () { + this.$emit("change", this.expiresTime) + } + }, + template: `
+ + + + + + + + + + + + + + + + + + + + +
是否启用 +

启用后,将会在响应的Header中添加Expires字段,浏览器据此会将内容缓存在客户端;同时,在管理后台执行清理缓存时,也将无法清理客户端已有的缓存。

+
覆盖源站设置 + +

选中后,会覆盖源站Header中已有的Expires字段。

+
自动计算时间 +

根据已设置的缓存有效期进行计算。

+
强制缓存时间 + +
+
` +}) + Vue.component("http-access-log-box", { props: ["v-access-log", "v-keyword", "v-show-server-link"], data: function () { @@ -10141,6 +10229,40 @@ Vue.component("more-options-indicator", { template: '更多选项收起选项 ' }); +Vue.component("page-size-selector", { + data: function () { + let query = window.location.search + let pageSize = 10 + if (query.length > 0) { + query = query.substr(1) + let params = query.split("&") + params.forEach(function (v) { + let pieces = v.split("=") + if (pieces.length == 2 && pieces[0] == "pageSize") { + let pageSizeString = pieces[1] + if (pageSizeString.match(/^\d+$/)) { + pageSize = parseInt(pageSizeString, 10) + if (isNaN(pageSize) || pageSize < 1) { + pageSize = 10 + } + } + } + }) + } + return { + pageSize: pageSize + } + }, + watch: { + pageSize: function () { + window.ChangePageSize(this.pageSize) + } + }, + template: `` +}) + /** * 二级菜单 */ @@ -10566,6 +10688,7 @@ Vue.component("time-duration-box", { + `