mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-06 14:50:25 +08:00
修复缓存条件状态码无法修改的问题
This commit is contained in:
@@ -38,6 +38,10 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
this.Fail("请输入缓存Key")
|
this.Fail("请输入缓存Key")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cacheRef.Conds == nil || len(cacheRef.Conds.Groups) == 0 {
|
||||||
|
this.Fail("请填写匹配条件分组")
|
||||||
|
}
|
||||||
|
|
||||||
err = cacheRef.Init()
|
err = cacheRef.Init()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.ErrorPage(err)
|
this.ErrorPage(err)
|
||||||
|
|||||||
@@ -42,6 +42,17 @@ Vue.component("http-cache-ref-box", {
|
|||||||
},
|
},
|
||||||
changeConds: function (v) {
|
changeConds: function (v) {
|
||||||
this.ref.conds = v
|
this.ref.conds = v
|
||||||
|
},
|
||||||
|
changeStatusList: function (list) {
|
||||||
|
let result = []
|
||||||
|
list.forEach(function (status) {
|
||||||
|
let statusNumber = parseInt(status)
|
||||||
|
if (isNaN(statusNumber) || statusNumber < 100 || statusNumber > 999) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
result.push(statusNumber)
|
||||||
|
})
|
||||||
|
this.ref.status = result
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
template: `<tbody>
|
template: `<tbody>
|
||||||
@@ -85,7 +96,7 @@ Vue.component("http-cache-ref-box", {
|
|||||||
<tr v-show="moreOptionsVisible && !vIsReverse">
|
<tr v-show="moreOptionsVisible && !vIsReverse">
|
||||||
<td>状态码列表</td>
|
<td>状态码列表</td>
|
||||||
<td>
|
<td>
|
||||||
<values-box name="statusList" size="3" maxlength="3" :values="ref.status"></values-box>
|
<values-box name="statusList" size="3" maxlength="3" :values="ref.status" @change="changeStatusList"></values-box>
|
||||||
<p class="comment">允许缓存的HTTP状态码列表。</p>
|
<p class="comment">允许缓存的HTTP状态码列表。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user