优化界面显示

This commit is contained in:
GoEdgeLab
2022-02-27 21:20:49 +08:00
parent 64668f8e66
commit b75f44947b
3 changed files with 39 additions and 16 deletions

View File

@@ -5,17 +5,39 @@ Vue.component("keyword", {
if (word == null) {
word = ""
} else {
word = word.replace(/\)/, "\\)")
word = word.replace(/\(/, "\\(")
word = word.replace(/\+/, "\\+")
word = word.replace(/\^/, "\\^")
word = word.replace(/\$/, "\\$")
word = word.replace(/\)/g, "\\)")
word = word.replace(/\(/g, "\\(")
word = word.replace(/\+/g, "\\+")
word = word.replace(/\^/g, "\\^")
word = word.replace(/\$/g, "\\$")
word = word.replace(/\?/, "\\?")
word = word.replace(/\*/, "\\*")
word = word.replace(/\[/, "\\[")
word = word.replace(/{/, "\\{")
word = word.replace(/\./, "\\.")
}
let slot = this.$slots["default"][0]
let text = this.encodeHTML(slot.text)
let text = slot.text
if (word.length > 0) {
text = text.replace(new RegExp("(" + word + ")", "ig"), "<span style=\"border: 1px #ccc dashed; color: #ef4d58\">$1</span>")
let that = this
let m = [] // replacement => tmp
let tmpIndex = 0
text = text.replaceAll(new RegExp("(" + word + ")", "ig"), function (replacement) {
tmpIndex++
let s = "<span style=\"border: 1px #ccc dashed; color: #ef4d58\">" + that.encodeHTML(replacement) + "</span>"
let tmpKey = "$TMP__KEY__" + tmpIndex.toString() + "$"
m.push([tmpKey, s])
return tmpKey
})
text = this.encodeHTML(text)
m.forEach(function (r) {
text = text.replace(r[0], r[1])
})
} else {
text = this.encodeHTML(text)
}
return {

View File

@@ -69,14 +69,7 @@ Vue.component("http-cache-config-box", {
</td>
</tr>
<tr>
<td>使用默认缓存条件</td>
<td>
<checkbox v-model="enablePolicyRefs"></checkbox>
<p class="comment">选中后使用系统缓存策略中定义的默认的缓存条件。</p>
</td>
</tr>
<tr>
<td class="title">是否开启缓存</td>
<td class="title">开启缓存</td>
<td>
<div class="ui checkbox">
<input type="checkbox" v-model="cacheConfig.isOn"/>
@@ -93,6 +86,13 @@ Vue.component("http-cache-config-box", {
</tr>
</tbody>
<tbody v-show="isOn() && moreOptionsVisible">
<tr>
<td>使用默认缓存条件</td>
<td>
<checkbox v-model="enablePolicyRefs"></checkbox>
<p class="comment">选中后使用系统中已经定义的默认缓存条件。</p>
</td>
</tr>
<tr>
<td>添加X-Cache Header</td>
<td>

View File

@@ -13,7 +13,8 @@
</div>
</form>
<table class="ui table celled selectable">
<p class="comment" v-if="clusters.length == 0">没有找到相应的集群。</p>
<table class="ui table celled selectable" v-if="clusters.length > 0">
<thead>
<tr>
<th>集群名称</th>