mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-05 06:10:26 +08:00
缓存条件增加最小内容尺寸配置
This commit is contained in:
@@ -11,6 +11,7 @@ Vue.component("http-cache-ref-box", {
|
||||
life: {count: 2, unit: "hour"},
|
||||
status: [200],
|
||||
maxSize: {count: 32, unit: "mb"},
|
||||
minSize: {count: 0, unit: "kb"},
|
||||
skipCacheControlValues: ["private", "no-cache", "no-store"],
|
||||
skipSetCookie: true,
|
||||
enableRequestCachePragma: false,
|
||||
@@ -25,6 +26,9 @@ Vue.component("http-cache-ref-box", {
|
||||
if (ref.maxSize == null) {
|
||||
ref.maxSize = {count: 32, unit: "mb"}
|
||||
}
|
||||
if (ref.minSize == null) {
|
||||
ref.minSize = {count: 0, unit: "kb"}
|
||||
}
|
||||
return {
|
||||
ref: ref,
|
||||
moreOptionsVisible: false
|
||||
@@ -40,6 +44,9 @@ Vue.component("http-cache-ref-box", {
|
||||
changeMaxSize: function (v) {
|
||||
this.ref.maxSize = v
|
||||
},
|
||||
changeMinSize: function (v) {
|
||||
this.ref.minSize = v
|
||||
},
|
||||
changeConds: function (v) {
|
||||
this.ref.conds = v
|
||||
},
|
||||
@@ -81,9 +88,17 @@ Vue.component("http-cache-ref-box", {
|
||||
<td colspan="2"><more-options-indicator @change="changeOptionsVisible"></more-options-indicator></td>
|
||||
</tr>
|
||||
<tr v-show="moreOptionsVisible && !vIsReverse">
|
||||
<td>可缓存的最大文件</td>
|
||||
<td>可缓存的最大内容尺寸</td>
|
||||
<td>
|
||||
<size-capacity-box :v-value="ref.maxSize" @change="changeMaxSize"></size-capacity-box>
|
||||
<p class="comment">内容尺寸如果高于此值则不缓存。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="moreOptionsVisible && !vIsReverse">
|
||||
<td>可缓存的最小内容尺寸</td>
|
||||
<td>
|
||||
<size-capacity-box :v-value="ref.minSize" @change="changeMinSize"></size-capacity-box>
|
||||
<p class="comment">内容尺寸如果低于此值则不缓存。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="moreOptionsVisible && !vIsReverse">
|
||||
|
||||
@@ -37,13 +37,19 @@ Vue.component("http-cache-refs-box", {
|
||||
<table class="ui table selectable celled">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>条件</th>
|
||||
<th class="two">分组关系</th>
|
||||
<th>缓存条件</th>
|
||||
<th class="two wide">分组关系</th>
|
||||
<th class="width10">缓存时间</th>
|
||||
</tr>
|
||||
<tr v-for="(cacheRef, index) in refs">
|
||||
<td :class="{'color-border': cacheRef.conds.connector == 'and'}" :style="{'border-left':cacheRef.isReverse ? '1px #db2828 solid' : ''}">
|
||||
<http-request-conds-view :v-conds="cacheRef.conds"></http-request-conds-view>
|
||||
<grey-label v-if="cacheRef.minSize != null && cacheRef.minSize.count > 0">
|
||||
{{cacheRef.minSize.count}}{{cacheRef.minSize.unit}}
|
||||
<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.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>
|
||||
<span v-if="cacheRef.conds.connector == 'and'">和</span>
|
||||
|
||||
@@ -156,7 +156,7 @@ Vue.component("http-cache-refs-config-box", {
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:1em"></th>
|
||||
<th>条件</th>
|
||||
<th>缓存条件</th>
|
||||
<th class="two wide">分组关系</th>
|
||||
<th class="width10">缓存时间</th>
|
||||
<th class="two op">操作</th>
|
||||
@@ -167,6 +167,12 @@ Vue.component("http-cache-refs-config-box", {
|
||||
<td style="text-align: center;"><i class="icon bars handle grey"></i> </td>
|
||||
<td :class="{'color-border': cacheRef.conds.connector == 'and'}" :style="{'border-left':cacheRef.isReverse ? '1px #db2828 solid' : ''}">
|
||||
<http-request-conds-view :v-conds="cacheRef.conds" ref="cacheRef"></http-request-conds-view>
|
||||
<grey-label v-if="cacheRef.minSize != null && cacheRef.minSize.count > 0">
|
||||
{{cacheRef.minSize.count}}{{cacheRef.minSize.unit}}
|
||||
<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.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>
|
||||
<span v-if="cacheRef.conds.connector == 'and'">和</span>
|
||||
|
||||
@@ -54,7 +54,7 @@ Vue.component("http-request-conds-view", {
|
||||
<div v-if="conds.groups.length > 0">
|
||||
<div v-for="(group, groupIndex) in conds.groups">
|
||||
<var v-for="(cond, index) in group.conds" style="font-style: normal;display: inline-block; margin-bottom:0.5em">
|
||||
<span class="ui label tiny">
|
||||
<span class="ui label small basic" style="line-height: 1.5">
|
||||
<var v-if="cond.type.length == 0 || cond.type == 'params'" style="font-style: normal">{{cond.param}} <var>{{cond.operator}}</var></var>
|
||||
<var v-if="cond.type.length > 0 && cond.type != 'params'" style="font-style: normal">{{cond.typeName}}: </var>
|
||||
{{cond.value}}
|
||||
|
||||
Reference in New Issue
Block a user