diff --git a/internal/web/actions/default/ns/clusters/accessLogs/index.go b/internal/web/actions/default/ns/clusters/accessLogs/index.go index a7a7155e..909af40e 100644 --- a/internal/web/actions/default/ns/clusters/accessLogs/index.go +++ b/internal/web/actions/default/ns/clusters/accessLogs/index.go @@ -23,6 +23,7 @@ func (this *IndexAction) Init() { func (this *IndexAction) RunGet(params struct { RequestId string + Keyword string Day string }) { day := strings.ReplaceAll(params.Day, "-", "") @@ -30,6 +31,7 @@ func (this *IndexAction) RunGet(params struct { day = timeutil.Format("Ymd") } + this.Data["keyword"] = params.Keyword this.Data["day"] = day[:4] + "-" + day[4:6] + "-" + day[6:] this.Data["path"] = this.Request.URL.Path @@ -42,6 +44,7 @@ func (this *IndexAction) RunGet(params struct { NsRecordId: 0, Size: size, Day: day, + Keyword: params.Keyword, Reverse: false, }) if err != nil { @@ -94,6 +97,7 @@ func (this *IndexAction) RunGet(params struct { NsDomainId: 0, NsRecordId: 0, Day: day, + Keyword: params.Keyword, Size: size, Reverse: true, }) diff --git a/web/public/js/components/common/keyword.js b/web/public/js/components/common/keyword.js new file mode 100644 index 00000000..34a2d3b8 --- /dev/null +++ b/web/public/js/components/common/keyword.js @@ -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"), "" + word + "") + } + + return { + word: word, + text: text + } + }, + template: `` +}) \ No newline at end of file diff --git a/web/public/js/components/ns/ns-access-log-box.js b/web/public/js/components/ns/ns-access-log-box.js index d30bea8f..b95c61c4 100644 --- a/web/public/js/components/ns/ns-access-log-box.js +++ b/web/public/js/components/ns/ns-access-log-box.js @@ -1,5 +1,5 @@ Vue.component("ns-access-log-box", { - props: ["v-access-log"], + props: ["v-access-log", "v-keyword"], data: function () { let accessLog = this.vAccessLog return { @@ -33,6 +33,6 @@ Vue.component("ns-access-log-box", { } }, template: `
- [{{accessLog.region}}] {{accessLog.remoteAddr}} [{{accessLog.timeLocal}}] [{{accessLog.networking}}] {{accessLog.questionType}} {{accessLog.questionName}} -> {{accessLog.recordType}} {{accessLog.recordValue}} + [{{accessLog.region}}] {{accessLog.remoteAddr}} [{{accessLog.timeLocal}}] [{{accessLog.networking}}] {{accessLog.questionType}} {{accessLog.questionName}} -> {{accessLog.recordType}} {{accessLog.recordValue}}
` }) \ No newline at end of file diff --git a/web/views/@default/ns/clusters/accessLogs/index.html b/web/views/@default/ns/clusters/accessLogs/index.html index 183eb401..dfe00524 100644 --- a/web/views/@default/ns/clusters/accessLogs/index.html +++ b/web/views/@default/ns/clusters/accessLogs/index.html @@ -13,6 +13,9 @@
+
+ +
@@ -52,14 +55,14 @@ {{accessLog.domain.name}}
- +
- 上一页 + 上一页 上一页   |   - 下一页 + 下一页 下一页
\ No newline at end of file