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 a7ca1289..19d05519 100644 --- a/web/public/js/components/server/http-cache-config-box.js +++ b/web/public/js/components/server/http-cache-config-box.js @@ -17,69 +17,6 @@ Vue.component("http-cache-config-box", { methods: { isOn: function () { return (!this.vIsLocation || this.cacheConfig.isPrior) && this.cacheConfig.isOn - }, - addRef: function () { - window.UPDATING_CACHE_REF = null - - let width = window.innerWidth - if (width > 1024) { - width = 1024 - } - let height = window.innerHeight - if (height > 500) { - height = 500 - } - let that = this - teaweb.popup("/servers/server/settings/cache/createPopup", { - width: width + "px", - height: height + "px", - callback: function (resp) { - that.cacheConfig.cacheRefs.push(resp.data.cacheRef) - } - }) - }, - updateRef: function (index, cacheRef) { - window.UPDATING_CACHE_REF = cacheRef - - let width = window.innerWidth - if (width > 1024) { - width = 1024 - } - let height = window.innerHeight - if (height > 500) { - height = 500 - } - let that = this - teaweb.popup("/servers/server/settings/cache/createPopup", { - width: width + "px", - height: height + "px", - callback: function (resp) { - Vue.set(that.cacheConfig.cacheRefs, index, resp.data.cacheRef) - } - }) - }, - removeRef: function (index) { - let that = this - teaweb.confirm("确定要删除此缓存设置吗?", function () { - that.cacheConfig.cacheRefs.$remove(index) - }) - }, - timeUnitName: function (unit) { - switch (unit) { - case "ms": - return "毫秒" - case "second": - return "秒" - case "minute": - return "分钟" - case "hour": - return "小时" - case "day": - return "天" - case "week": - return "周 " - } - return unit } }, template: `
@@ -118,27 +55,8 @@ Vue.component("http-cache-config-box", {
- - - - - - - - - - - - - -
缓存条件缓存时间操作
- - {{cacheRef.life.count}} {{timeUnitName(cacheRef.life.unit)}} - 修改   - 删除 -
- - +

缓存条件

+
` diff --git a/web/public/js/components/server/http-cache-refs-config-box.js b/web/public/js/components/server/http-cache-refs-config-box.js index e53a0f63..56146e78 100644 --- a/web/public/js/components/server/http-cache-refs-config-box.js +++ b/web/public/js/components/server/http-cache-refs-config-box.js @@ -1,5 +1,5 @@ Vue.component("http-cache-refs-config-box", { - props: ["v-cache-refs"], + props: ["v-cache-refs", "v-cache-config"], mounted: function () { let that = this sortTable(function (ids) { @@ -12,6 +12,10 @@ Vue.component("http-cache-refs-config-box", { }) }) that.refs = newRefs + + if (that.vCacheConfig != null) { + that.vCacheConfig.cacheRefs = newRefs + } }) }, data: function () { @@ -105,6 +109,7 @@ Vue.component("http-cache-refs-config-box", {
+

暂时还没有缓存条件。

diff --git a/web/public/js/components/server/http-cond-definitions.js b/web/public/js/components/server/http-cond-definitions.js index 9b601c95..5aa0a593 100644 --- a/web/public/js/components/server/http-cond-definitions.js +++ b/web/public/js/components/server/http-cond-definitions.js @@ -109,7 +109,7 @@ Vue.component("http-cond-url-prefix", { template: `
-

URL前缀,通常以/开头,比如/static

+

URL前缀,有此前缀的URL都将会被匹配,通常以/开头,比如/static

` }) @@ -133,7 +133,7 @@ Vue.component("http-cond-url-not-prefix", { template: `
-

要排除的URL前缀,通常以/开头,比如/static

+

要排除的URL前缀,有此前缀的URL都将会被匹配,通常以/开头,比如/static

` })