diff --git a/web/public/js/components.js b/web/public/js/components.js index 8918eadc..efae8de0 100755 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -2574,8 +2574,8 @@ Vue.component("http-cache-refs-box", { 缓存时间 - - + + {{cacheRef.minSize.count}}{{cacheRef.minSize.unit}} - {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}} @@ -2586,11 +2586,11 @@ Vue.component("http-cache-refs-box", { 状态码:{{cacheRef.status.map(function(v) {return v.toString()}).join(", ")}} 区间缓存 - + - + {{cacheRef.life.count}} {{timeUnitName(cacheRef.life.unit)}} 不缓存 @@ -3783,7 +3783,7 @@ Vue.component("metric-board", { }) Vue.component("http-cache-config-box", { - props: ["v-cache-config", "v-is-location", "v-is-group", "v-cache-policy"], + props: ["v-cache-config", "v-is-location", "v-is-group", "v-cache-policy", "v-web-id"], data: function () { let cacheConfig = this.vCacheConfig if (cacheConfig == null) { @@ -3922,7 +3922,7 @@ Vue.component("http-cache-config-box", {

缓存条件

- +
` @@ -4226,7 +4226,7 @@ Vue.component("http-firewall-checkpoint-referer-block", { }) Vue.component("http-cache-refs-config-box", { - props: ["v-cache-refs", "v-cache-config", "v-cache-policy-id"], + props: ["v-cache-refs", "v-cache-config", "v-cache-policy-id", "v-web-id"], mounted: function () { let that = this sortTable(function (ids) { @@ -4328,6 +4328,14 @@ Vue.component("http-cache-refs-config-box", { } }) }, + disableRef: function (ref) { + ref.isOn = false + this.change() + }, + enableRef: function (ref) { + ref.isOn = true + this.change() + }, removeRef: function (index) { let that = this teaweb.confirm("确定要删除此缓存设置吗?", function () { @@ -4360,13 +4368,25 @@ Vue.component("http-cache-refs-config-box", { }, change: function () { // 自动保存 - if (this.vCachePolicyId != null && this.vCachePolicyId > 0) { + if (this.vCachePolicyId != null && this.vCachePolicyId > 0) { // 缓存策略 Tea.action("/servers/components/cache/updateRefs") .params({ cachePolicyId: this.vCachePolicyId, refsJSON: JSON.stringify(this.refs) }) .post() + } else if (this.vWebId != null && this.vWebId > 0) { // Server Web or Group Web + Tea.action("/servers/server/settings/cache/updateRefs") + .params({ + webId: this.vWebId, + refsJSON: JSON.stringify(this.refs) + }) + .success(function (resp) { + if (resp.data.isUpdated) { + teaweb.successToast("保存成功") + } + }) + .post() } } }, @@ -4382,14 +4402,14 @@ Vue.component("http-cache-refs-config-box", { 缓存条件 分组关系 缓存时间 - 操作 + 操作 - - + + {{cacheRef.minSize.count}}{{cacheRef.minSize.unit}} - {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}} @@ -4400,16 +4420,17 @@ Vue.component("http-cache-refs-config-box", { 状态码:{{cacheRef.status.map(function(v) {return v.toString()}).join(", ")}} 区间缓存 - + - + {{cacheRef.life.count}} {{timeUnitName(cacheRef.life.unit)}} 不缓存 修改   + 暂停恢复   删除