diff --git a/internal/web/actions/default/servers/server/log/history.go b/internal/web/actions/default/servers/server/log/history.go index e7e395a3..06e641f7 100644 --- a/internal/web/actions/default/servers/server/log/history.go +++ b/internal/web/actions/default/servers/server/log/history.go @@ -22,6 +22,8 @@ func (this *HistoryAction) RunGet(params struct { ServerId int64 Day string Keyword string + Ip string + Domain string RequestId string HasError int @@ -33,6 +35,8 @@ func (this *HistoryAction) RunGet(params struct { this.Data["path"] = this.Request.URL.Path this.Data["day"] = params.Day this.Data["keyword"] = params.Keyword + this.Data["ip"] = params.Ip + this.Data["domain"] = params.Domain this.Data["accessLogs"] = []interface{}{} this.Data["hasError"] = params.HasError @@ -51,6 +55,8 @@ func (this *HistoryAction) RunGet(params struct { HasError: params.HasError > 0, Day: day, Keyword: params.Keyword, + Ip: params.Ip, + Domain: params.Domain, Size: size, }) if err != nil { @@ -84,6 +90,8 @@ func (this *HistoryAction) RunGet(params struct { HasError: params.HasError > 0, Day: day, Keyword: params.Keyword, + Ip: params.Ip, + Domain: params.Domain, Size: size, Reverse: true, }) diff --git a/internal/web/actions/default/servers/server/log/index.go b/internal/web/actions/default/servers/server/log/index.go index ec0790a7..71bb60f3 100644 --- a/internal/web/actions/default/servers/server/log/index.go +++ b/internal/web/actions/default/servers/server/log/index.go @@ -20,10 +20,14 @@ func (this *IndexAction) Init() { func (this *IndexAction) RunGet(params struct { ServerId int64 RequestId string + Ip string + Domain string Keyword string }) { this.Data["serverId"] = params.ServerId this.Data["requestId"] = params.RequestId + this.Data["ip"] = params.Ip + this.Data["domain"] = params.Domain this.Data["keyword"] = params.Keyword this.Data["path"] = this.Request.URL.Path @@ -44,6 +48,8 @@ func (this *IndexAction) RunPost(params struct { ServerId int64 RequestId string Keyword string + Ip string + Domain string Must *actions.Must }) { @@ -54,6 +60,8 @@ func (this *IndexAction) RunPost(params struct { Size: 20, Day: timeutil.Format("Ymd"), Keyword: params.Keyword, + Ip: params.Ip, + Domain: params.Domain, Reverse: isReverse, }) if err != nil { diff --git a/internal/web/actions/default/servers/server/log/today.go b/internal/web/actions/default/servers/server/log/today.go index 008d4720..8597db2d 100644 --- a/internal/web/actions/default/servers/server/log/today.go +++ b/internal/web/actions/default/servers/server/log/today.go @@ -21,12 +21,16 @@ func (this *TodayAction) RunGet(params struct { ServerId int64 HasError int Keyword string + Ip string + Domain string }) { size := int64(10) this.Data["path"] = this.Request.URL.Path this.Data["hasError"] = params.HasError this.Data["keyword"] = params.Keyword + this.Data["ip"] = params.Ip + this.Data["domain"] = params.Domain resp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{ RequestId: params.RequestId, @@ -34,6 +38,8 @@ func (this *TodayAction) RunGet(params struct { HasError: params.HasError > 0, Day: timeutil.Format("Ymd"), Keyword: params.Keyword, + Ip: params.Ip, + Domain: params.Domain, Size: size, }) if err != nil { @@ -67,6 +73,9 @@ func (this *TodayAction) RunGet(params struct { ServerId: params.ServerId, HasError: params.HasError > 0, Day: timeutil.Format("Ymd"), + Keyword: params.Keyword, + Ip: params.Ip, + Domain: params.Domain, Size: size, Reverse: true, }) diff --git a/web/public/js/components/server/http-access-log-search-box.js b/web/public/js/components/server/http-access-log-search-box.js new file mode 100644 index 00000000..95da17ed --- /dev/null +++ b/web/public/js/components/server/http-access-log-search-box.js @@ -0,0 +1,53 @@ +// 访问日志搜索框 +Vue.component("http-access-log-search-box", { + props: ["v-ip", "v-domain", "v-keyword"], + data: function () { + let ip = this.vIp + if (ip == null) { + ip = "" + } + + let domain = this.vDomain + if (domain == null) { + domain = "" + } + + let keyword = this.vKeyword + if (keyword == null) { + keyword = "" + } + + return { + ip: ip, + domain: domain, + keyword: keyword + } + }, + template: `
+
+
+
+
+ IP + +
+
+
+
+ 域名 + +
+
+
+
+ 关键词 + +
+
+ +
+ +
+
+
` +}) \ No newline at end of file diff --git a/web/views/@default/db/index.js b/web/views/@default/db/index.js index bdbb0889..f44cc552 100644 --- a/web/views/@default/db/index.js +++ b/web/views/@default/db/index.js @@ -37,7 +37,10 @@ Tea.context(function () { // 清理节点 this.cleanNode = function (nodeId) { - teaweb.popup("/db/cleanPopup?nodeId=" + nodeId) + teaweb.popup("/db/cleanPopup?nodeId=" + nodeId, { + width: "44em", + height: "26em" + }) } // 显示错误信息 diff --git a/web/views/@default/servers/server/log/history.html b/web/views/@default/servers/server/log/history.html index 8e22136d..57bd6fa7 100644 --- a/web/views/@default/servers/server/log/history.html +++ b/web/views/@default/servers/server/log/history.html @@ -5,26 +5,19 @@
- 所有日志 - 错误日志 -
-
- -
-
- -
-
- -
-
- -
-
-
-
+ 所有日志 + 错误日志
+
+ + +
+ +
+
+
+

暂时还没有访问日志。

@@ -35,10 +28,10 @@
- 上一页 + 上一页 上一页   |   - 下一页 + 下一页 下一页
\ No newline at end of file diff --git a/web/views/@default/servers/server/log/index.html b/web/views/@default/servers/server/log/index.html index 77e3ed95..15c64331 100644 --- a/web/views/@default/servers/server/log/index.html +++ b/web/views/@default/servers/server/log/index.html @@ -2,21 +2,10 @@ {$template "/left_menu"}
- -
-
- -
-
- -
-
- -
-
-
-
-
+
+ + +

今天暂时还没有访问日志。

diff --git a/web/views/@default/servers/server/log/index.js b/web/views/@default/servers/server/log/index.js index 5913a0eb..37c5b6ad 100644 --- a/web/views/@default/servers/server/log/index.js +++ b/web/views/@default/servers/server/log/index.js @@ -12,7 +12,9 @@ Tea.context(function () { .params({ serverId: this.serverId, requestId: this.requestId, - keyword: this.keyword + keyword: this.keyword, + ip: this.ip, + domain: this.domain }) .success(function (resp) { this.accessLogs = resp.data.accessLogs.concat(this.accessLogs) diff --git a/web/views/@default/servers/server/log/today.html b/web/views/@default/servers/server/log/today.html index c9e6d300..7a73e152 100644 --- a/web/views/@default/servers/server/log/today.html +++ b/web/views/@default/servers/server/log/today.html @@ -3,24 +3,15 @@ {$template "/left_menu"}
- 所有日志 - 错误日志 - -
-
- -
-
- -
-
- -
-
-
-
+ 所有日志 + 错误日志
+
+ + +
+

今天暂时还没有访问日志。

@@ -31,10 +22,10 @@
- 上一页 + 上一页 上一页   |   - 下一页 + 下一页 下一页
\ No newline at end of file