mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
服务访问日志也支持分表查询
This commit is contained in:
@@ -53,6 +53,7 @@ func (this *HistoryAction) RunGet(params struct {
|
||||
this.Data["pageSize"] = params.PageSize
|
||||
this.Data["clusterId"] = params.ClusterId
|
||||
this.Data["nodeId"] = params.NodeId
|
||||
this.Data["partition"] = params.Partition
|
||||
|
||||
day := params.Day
|
||||
ipList := []string{}
|
||||
|
||||
@@ -46,6 +46,8 @@ func (this *TodayAction) RunGet(params struct {
|
||||
this.Data["hasWAF"] = params.HasWAF
|
||||
this.Data["clusterId"] = params.ClusterId
|
||||
this.Data["nodeId"] = params.NodeId
|
||||
this.Data["partition"] = params.Partition
|
||||
this.Data["day"] = timeutil.Format("Ymd")
|
||||
|
||||
resp, err := this.RPC().HTTPAccessLogRPC().ListHTTPAccessLogs(this.AdminContext(), &pb.ListHTTPAccessLogsRequest{
|
||||
Partition: params.Partition,
|
||||
|
||||
@@ -31,10 +31,10 @@ Vue.component("http-access-log-partitions-box", {
|
||||
methods: {
|
||||
url: function (p) {
|
||||
let u = window.location.toString()
|
||||
u = u.replace(/\?partition=\d+/, "?")
|
||||
u = u.replace(/\?requestId=\d+/, "?")
|
||||
u = u.replace(/&partition=\d+/, "")
|
||||
u = u.replace(/&requestId=\d+/, "")
|
||||
u = u.replace(/\?partition=-?\d+/, "?")
|
||||
u = u.replace(/\?requestId=-?\d+/, "?")
|
||||
u = u.replace(/&partition=-?\d+/, "")
|
||||
u = u.replace(/&requestId=-?\d+/, "")
|
||||
if (u.indexOf("?") > 0) {
|
||||
u += "&partition=" + p
|
||||
} else {
|
||||
@@ -53,7 +53,7 @@ Vue.component("http-access-log-partitions-box", {
|
||||
template: `<div v-if="partitions.length > 1">
|
||||
<div class="ui divider" style="margin-bottom: 0"></div>
|
||||
<div class="ui menu text small blue" style="margin-bottom: 0; margin-top: 0">
|
||||
<a v-for="p in partitions" :href="url(p.code)" class="item" :class="{active: selectedPartition == p.code, disabled: p.isDisabled}">分表{{p.code}}</a>
|
||||
<a v-for="(p, index) in partitions" :href="url(p.code)" class="item" :class="{active: selectedPartition == p.code, disabled: p.isDisabled}">分表{{p.code+1}} <span class="disabled" v-if="index != partitions.length - 1">|</span></a>
|
||||
</div>
|
||||
<div class="ui divider" style="margin-top: 0"></div>
|
||||
</div>`
|
||||
|
||||
@@ -37,6 +37,9 @@
|
||||
</http-access-log-search-box>
|
||||
</form>
|
||||
|
||||
<!-- 分区 -->
|
||||
<http-access-log-partitions-box :v-day="day" :v-partition="partition"></http-access-log-partitions-box>
|
||||
|
||||
<p class="comment" v-if="accessLogs.length == 0">暂时还没有访问日志。</p>
|
||||
|
||||
<table class="ui table selectable" v-if="accessLogs.length > 0">
|
||||
@@ -47,10 +50,10 @@
|
||||
</table>
|
||||
|
||||
<div v-if="accessLogs.length > 0">
|
||||
<a :href="path + '?serverId=' + serverId + '&requestId=' + lastRequestId + '&day=' + day + '&hasError=' + hasError + '&hasWAF=' + hasWAF + '&keyword=' + keyword + '&ip=' + ip + '&domain=' + domain + '&hour=' + hour + '&pageSize=' + pageSize" v-if="hasPrev">上一页</a>
|
||||
<a :href="path + '?serverId=' + serverId + '&requestId=' + lastRequestId + '&day=' + day + '&hasError=' + hasError + '&hasWAF=' + hasWAF + '&keyword=' + keyword + '&ip=' + ip + '&domain=' + domain + '&hour=' + hour + '&pageSize=' + pageSize + '&partition=' + partition" v-if="hasPrev">上一页</a>
|
||||
<span v-else class="disabled">上一页</span>
|
||||
<span class="disabled"> | </span>
|
||||
<a :href="path + '?serverId=' + serverId + '&requestId=' + nextRequestId + '&day=' + day + '&hasError=' + hasError + '&hasWAF=' + hasWAF + '&keyword=' + keyword + '&ip=' + ip + '&domain=' + domain + '&hour=' + hour + '&pageSize=' + pageSize" v-if="hasMore">下一页</a>
|
||||
<a :href="path + '?serverId=' + serverId + '&requestId=' + nextRequestId + '&day=' + day + '&hasError=' + hasError + '&hasWAF=' + hasWAF + '&keyword=' + keyword + '&ip=' + ip + '&domain=' + domain + '&hour=' + hour + '&pageSize=' + pageSize + '&partition=' + partition" v-if="hasMore">下一页</a>
|
||||
<span v-else class="disabled">下一页</span>
|
||||
<page-size-selector></page-size-selector>
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,9 @@
|
||||
<http-access-log-search-box :v-ip="ip" :v-domain="domain" :v-keyword="keyword" :v-cluster-id="clusterId" :v-node-id="nodeId"></http-access-log-search-box>
|
||||
</form>
|
||||
|
||||
<!-- 分区 -->
|
||||
<http-access-log-partitions-box :v-day="day" :v-partition="partition"></http-access-log-partitions-box>
|
||||
|
||||
<p class="comment" v-if="accessLogs.length == 0">今天暂时还没有访问日志。</p>
|
||||
|
||||
<table class="ui table selectable" v-if="accessLogs.length > 0">
|
||||
@@ -35,10 +38,10 @@
|
||||
</table>
|
||||
|
||||
<div v-if="accessLogs.length > 0">
|
||||
<a :href="path + '?serverId=' + serverId + '&requestId=' + lastRequestId + '&hasError=' + hasError + '&hasWAF=' + hasWAF + '&keyword=' + keyword + '&ip=' + ip + '&domain=' + domain + '&pageSize=' + pageSize" v-if="hasPrev">上一页</a>
|
||||
<a :href="path + '?serverId=' + serverId + '&requestId=' + lastRequestId + '&hasError=' + hasError + '&hasWAF=' + hasWAF + '&keyword=' + keyword + '&ip=' + ip + '&domain=' + domain + '&pageSize=' + pageSize + '&partition=' + partition" v-if="hasPrev">上一页</a>
|
||||
<span v-else class="disabled">上一页</span>
|
||||
<span class="disabled"> | </span>
|
||||
<a :href="path + '?serverId=' + serverId + '&requestId=' + nextRequestId + '&hasError=' + hasError + '&hasWAF=' + hasWAF + '&keyword=' + keyword + '&ip=' + ip + '&domain=' + domain + '&pageSize=' + pageSize" v-if="hasMore">下一页</a>
|
||||
<a :href="path + '?serverId=' + serverId + '&requestId=' + nextRequestId + '&hasError=' + hasError + '&hasWAF=' + hasWAF + '&keyword=' + keyword + '&ip=' + ip + '&domain=' + domain + '&pageSize=' + pageSize + '&partition=' + partition" v-if="hasMore">下一页</a>
|
||||
<span v-else class="disabled">下一页</span>
|
||||
<page-size-selector></page-size-selector>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user