diff --git a/internal/web/actions/default/log/index.go b/internal/web/actions/default/log/index.go index e0feba8f..c1196453 100644 --- a/internal/web/actions/default/log/index.go +++ b/internal/web/actions/default/log/index.go @@ -17,8 +17,20 @@ func (this *IndexAction) Init() { this.Nav("log", "log", "") } -func (this *IndexAction) RunGet(params struct{}) { - countResp, err := this.RPC().LogRPC().CountLogs(this.AdminContext(), &pb.CountLogRequest{}) +func (this *IndexAction) RunGet(params struct { + DayFrom string + DayTo string + Keyword string +}) { + this.Data["dayFrom"] = params.DayFrom + this.Data["dayTo"] = params.DayTo + this.Data["keyword"] = params.Keyword + + countResp, err := this.RPC().LogRPC().CountLogs(this.AdminContext(), &pb.CountLogRequest{ + DayFrom: params.DayFrom, + DayTo: params.DayTo, + Keyword: params.Keyword, + }) if err != nil { this.ErrorPage(err) return @@ -28,8 +40,11 @@ func (this *IndexAction) RunGet(params struct{}) { this.Data["page"] = page.AsHTML() logsResp, err := this.RPC().LogRPC().ListLogs(this.AdminContext(), &pb.ListLogsRequest{ - Offset: page.Offset, - Size: page.Size, + Offset: page.Offset, + Size: page.Size, + DayFrom: params.DayFrom, + DayTo: params.DayTo, + Keyword: params.Keyword, }) if err != nil { this.ErrorPage(err) @@ -68,6 +83,7 @@ func (this *IndexAction) RunGet(params struct{}) { "type": log.Type, "ip": log.Ip, "region": regionName, + "action": log.Action, }) } this.Data["logs"] = logMaps diff --git a/web/views/@default/log/index.html b/web/views/@default/log/index.html index c8e5309a..d61044e1 100644 --- a/web/views/@default/log/index.html +++ b/web/views/@default/log/index.html @@ -1,10 +1,44 @@ {$layout} -
暂时还没有日志。
+{$var "header"} + + + + + + +{$end} + + + +暂时还没有日志。
+| {{log.createdTime}} | {{log.userName}} | {{log.ip}} | {{log.region}} | +{{log.createdTime}} | {{log.userName}} | {{log.ip}} | {{log.region}} ... {{log.action}} |
| {{log.description}} | diff --git a/web/views/@default/log/index.js b/web/views/@default/log/index.js new file mode 100644 index 00000000..da29e848 --- /dev/null +++ b/web/views/@default/log/index.js @@ -0,0 +1,14 @@ +Tea.context(function () { + this.$delay(function () { + teaweb.datepicker("day-from-picker") + teaweb.datepicker("day-to-picker") + }) + + this.logs.forEach(function (v) { + v.moreVisible = false + }) + + this.showMore = function (log) { + log.moreVisible = !log.moreVisible + } +}) \ No newline at end of file