域名服务增加访问日志

This commit is contained in:
刘祥超
2021-06-02 11:53:08 +08:00
parent 201c3e2f97
commit b6fd9aeb14
25 changed files with 577 additions and 35 deletions

View File

@@ -55,11 +55,11 @@ func (this *HistoryAction) RunGet(params struct {
return
}
if len(resp.AccessLogs) == 0 {
if len(resp.HttpAccessLogs) == 0 {
this.Data["accessLogs"] = []interface{}{}
} else {
this.Data["accessLogs"] = resp.AccessLogs
for _, accessLog := range resp.AccessLogs {
this.Data["accessLogs"] = resp.HttpAccessLogs
for _, accessLog := range resp.HttpAccessLogs {
if len(accessLog.RemoteAddr) > 0 {
if !lists.ContainsString(ipList, accessLog.RemoteAddr) {
ipList = append(ipList, accessLog.RemoteAddr)
@@ -87,7 +87,7 @@ func (this *HistoryAction) RunGet(params struct {
this.ErrorPage(err)
return
}
if int64(len(prevResp.AccessLogs)) == size {
if int64(len(prevResp.HttpAccessLogs)) == size {
this.Data["lastRequestId"] = prevResp.RequestId
}
}

View File

@@ -57,7 +57,7 @@ func (this *IndexAction) RunPost(params struct {
}
ipList := []string{}
accessLogs := accessLogsResp.AccessLogs
accessLogs := accessLogsResp.HttpAccessLogs
if len(accessLogs) == 0 {
accessLogs = []*pb.HTTPAccessLog{}
} else {

View File

@@ -39,11 +39,11 @@ func (this *TodayAction) RunGet(params struct {
}
ipList := []string{}
if len(resp.AccessLogs) == 0 {
if len(resp.HttpAccessLogs) == 0 {
this.Data["accessLogs"] = []interface{}{}
} else {
this.Data["accessLogs"] = resp.AccessLogs
for _, accessLog := range resp.AccessLogs {
this.Data["accessLogs"] = resp.HttpAccessLogs
for _, accessLog := range resp.HttpAccessLogs {
if len(accessLog.RemoteAddr) > 0 {
if !lists.ContainsString(ipList, accessLog.RemoteAddr) {
ipList = append(ipList, accessLog.RemoteAddr)
@@ -71,7 +71,7 @@ func (this *TodayAction) RunGet(params struct {
this.ErrorPage(err)
return
}
if int64(len(prevResp.AccessLogs)) == size {
if int64(len(prevResp.HttpAccessLogs)) == size {
this.Data["lastRequestId"] = prevResp.RequestId
}
}

View File

@@ -23,7 +23,7 @@ func (this *ViewPopupAction) RunGet(params struct {
this.ErrorPage(err)
return
}
accessLog := accessLogResp.AccessLog
accessLog := accessLogResp.HttpAccessLog
if accessLog == nil {
this.WriteString("not found: " + params.RequestId)
return