DNS访问日志可以使用关键词搜索

This commit is contained in:
GoEdgeLab
2021-06-04 09:09:23 +08:00
parent 09a193820d
commit 0796156b2b
4 changed files with 33 additions and 5 deletions

View File

@@ -0,0 +1,21 @@
Vue.component("keyword", {
props: ["v-word"],
data: function () {
let word = this.vWord
if (word == null) {
word = ""
}
let slot = this.$slots["default"][0]
let text = slot.text
if (word.length > 0) {
text = text.replace(new RegExp(word, "g"), "<span style=\"border: 1px #ccc dashed\">" + word + "</span>")
}
return {
word: word,
text: text
}
},
template: `<span><span style="display: none"><slot></slot></span><span v-html="text"></span></span>`
})