mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-11 01:50:27 +08:00
缓存支持请求方法设置
This commit is contained in:
@@ -20,12 +20,16 @@ Vue.component("http-cache-ref-box", {
|
||||
enableRequestCachePragma: false,
|
||||
conds: null,
|
||||
allowChunkedEncoding: true,
|
||||
isReverse: this.vIsReverse
|
||||
isReverse: this.vIsReverse,
|
||||
methods: []
|
||||
}
|
||||
}
|
||||
if (ref.key == null) {
|
||||
ref.key = ""
|
||||
}
|
||||
if (ref.methods == null) {
|
||||
ref.methods = []
|
||||
}
|
||||
|
||||
if (ref.life == null) {
|
||||
ref.life = {count: 2, unit: "hour"}
|
||||
@@ -68,6 +72,11 @@ Vue.component("http-cache-ref-box", {
|
||||
})
|
||||
this.ref.status = result
|
||||
},
|
||||
changeMethods: function (methods) {
|
||||
this.ref.methods = methods.map(function (v) {
|
||||
return v.toUpperCase()
|
||||
})
|
||||
},
|
||||
changeKey: function (key) {
|
||||
this.$refs.variablesDescriber.update(key)
|
||||
}
|
||||
@@ -97,6 +106,13 @@ Vue.component("http-cache-ref-box", {
|
||||
<tr v-show="!vIsReverse">
|
||||
<td colspan="2"><more-options-indicator @change="changeOptionsVisible"></more-options-indicator></td>
|
||||
</tr>
|
||||
<tr v-show="moreOptionsVisible && !vIsReverse">
|
||||
<td>请求方法</td>
|
||||
<td>
|
||||
<values-box size="5" maxlength="10" :values="ref.methods" @change="changeMethods"></values-box>
|
||||
<p class="comment">允许请求的缓存方法,如果没有设置,则默认为<code-label>GET</code-label>、<code-label>HEAD</code-label>。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="moreOptionsVisible && !vIsReverse">
|
||||
<td>可缓存的最大内容尺寸</td>
|
||||
<td>
|
||||
|
||||
@@ -49,6 +49,7 @@ Vue.component("http-cache-refs-box", {
|
||||
<span v-if="cacheRef.maxSize != null && cacheRef.maxSize.count > 0">- {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}}</span>
|
||||
</grey-label>
|
||||
<grey-label v-else-if="cacheRef.maxSize != null && cacheRef.maxSize.count > 0">0 - {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}}</grey-label>
|
||||
<grey-label v-if="cacheRef.methods != null && cacheRef.methods.length > 0">{{cacheRef.methods.join(", ")}}</grey-label>
|
||||
<grey-label v-if="cacheRef.status != null && cacheRef.status.length > 0 && (cacheRef.status.length > 1 || cacheRef.status[0] != 200)">状态码:{{cacheRef.status.map(function(v) {return v.toString()}).join(", ")}}</grey-label>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -172,6 +172,7 @@ Vue.component("http-cache-refs-config-box", {
|
||||
<span v-if="cacheRef.maxSize != null && cacheRef.maxSize.count > 0">- {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}}</span>
|
||||
</grey-label>
|
||||
<grey-label v-else-if="cacheRef.maxSize != null && cacheRef.maxSize.count > 0">0 - {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}}</grey-label>
|
||||
<grey-label v-if="cacheRef.methods != null && cacheRef.methods.length > 0">{{cacheRef.methods.join(", ")}}</grey-label>
|
||||
<grey-label v-if="cacheRef.status != null && cacheRef.status.length > 0 && (cacheRef.status.length > 1 || cacheRef.status[0] != 200)">状态码:{{cacheRef.status.map(function(v) {return v.toString()}).join(", ")}}</grey-label>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user