请求条件支持参数匹配

This commit is contained in:
GoEdgeLab
2021-06-09 17:14:31 +08:00
parent 382b526894
commit 40f0cc3a17
10 changed files with 349 additions and 22 deletions

View File

@@ -11,11 +11,7 @@ Vue.component("http-cache-refs-config-box", {
}
})
})
that.refs = newRefs
if (that.vCacheConfig != null) {
that.vCacheConfig.cacheRefs = newRefs
}
that.updateRefs(newRefs)
})
},
data: function () {
@@ -51,9 +47,32 @@ Vue.component("http-cache-refs-config-box", {
width: width + "px",
height: height + "px",
callback: function (resp) {
let newRef = resp.data.cacheRef
if (newRef.conds == null) {
return
}
that.id++
resp.data.cacheRef.id = that.id
that.refs.push(resp.data.cacheRef)
newRef.id = that.id
if (newRef.isReverse) {
let newRefs = []
let isAdded = false
that.refs.forEach(function (v) {
if (!v.isReverse && !isAdded) {
newRefs.push(newRef)
isAdded = true
}
newRefs.push(v)
})
if (!isAdded) {
newRefs.push(newRef)
}
that.updateRefs(newRefs)
} else {
that.refs.push(newRef)
}
}
})
},
@@ -87,6 +106,12 @@ Vue.component("http-cache-refs-config-box", {
that.refs.$remove(index)
})
},
updateRefs: function (newRefs) {
this.refs = newRefs
if (this.vCacheConfig != null) {
this.vCacheConfig.cacheRefs = newRefs
}
},
timeUnitName: function (unit) {
switch (unit) {
case "ms":