mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
网站列表增加QPS和攻击QPS信息
This commit is contained in:
@@ -3,6 +3,7 @@ package servers
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/utils/numberutils"
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/configutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||
@@ -29,6 +30,8 @@ func (this *IndexAction) RunGet(params struct {
|
||||
UserId int64
|
||||
|
||||
TrafficOutOrder string
|
||||
RequestsOrder string
|
||||
AttackRequestsOrder string
|
||||
}) {
|
||||
this.Data["clusterId"] = params.ClusterId
|
||||
this.Data["groupId"] = params.GroupId
|
||||
@@ -38,7 +41,7 @@ func (this *IndexAction) RunGet(params struct {
|
||||
this.Data["hasOrder"] = len(params.TrafficOutOrder) > 0
|
||||
this.Data["userId"] = params.UserId
|
||||
|
||||
isSearching := params.AuditingFlag == 1 || params.ClusterId > 0 || params.GroupId > 0 || len(params.Keyword) > 0
|
||||
var isSearching = params.AuditingFlag == 1 || params.ClusterId > 0 || params.GroupId > 0 || len(params.Keyword) > 0
|
||||
|
||||
if params.AuditingFlag > 0 {
|
||||
this.Data["firstMenuItem"] = "auditing"
|
||||
@@ -97,6 +100,10 @@ func (this *IndexAction) RunGet(params struct {
|
||||
AuditingFlag: params.AuditingFlag,
|
||||
TrafficOutDesc: params.TrafficOutOrder == "desc",
|
||||
TrafficOutAsc: params.TrafficOutOrder == "asc",
|
||||
RequestsAsc: params.RequestsOrder == "asc",
|
||||
RequestsDesc: params.RequestsOrder == "desc",
|
||||
AttackRequestsAsc: params.AttackRequestsOrder == "asc",
|
||||
AttackRequestsDesc: params.AttackRequestsOrder == "desc",
|
||||
UserId: params.UserId,
|
||||
IgnoreServerNames: true,
|
||||
IgnoreSSLCerts: true,
|
||||
@@ -248,6 +255,8 @@ func (this *IndexAction) RunGet(params struct {
|
||||
"user": userMap,
|
||||
"auditingTime": auditingTime,
|
||||
"bandwidthBits": bandwidthBits,
|
||||
"qps": numberutils.FormatCount(server.CountRequests / 300), /** 5 minutes **/
|
||||
"attackQPS": numberutils.FormatCount(server.CountAttackRequests / 300), /** 5 minutes **/
|
||||
})
|
||||
}
|
||||
this.Data["servers"] = serverMaps
|
||||
|
||||
@@ -63,7 +63,9 @@
|
||||
<th>部署集群</th>
|
||||
<th>域名</th>
|
||||
<th>端口</th>
|
||||
<th class="center" style="width: 8em">下行带宽<tip-icon content="最近5分钟峰值带宽,每5分钟更新一次"></tip-icon><sort-arrow name="trafficOutOrder"></sort-arrow></th>
|
||||
<th class="value-column center">下行带宽<tip-icon content="最近5分钟峰值带宽,每5分钟更新一次"></tip-icon><sort-arrow name="trafficOutOrder"></sort-arrow></th>
|
||||
<th class="value-column center" v-if="windowWidth < miniWidth || windowWidth > columnWidth4">QPS<tip-icon content="最近5分钟平均QPS,每5分钟更新一次"></tip-icon><sort-arrow name="requestsOrder"></sort-arrow></th>
|
||||
<th class="value-column center" v-if="windowWidth < miniWidth || windowWidth > columnWidth5">攻击QPS<tip-icon content="最近5分钟平均攻击QPS,每5分钟更新一次"></tip-icon><sort-arrow name="attackRequestsOrder"></sort-arrow></th>
|
||||
<th class="two wide center">状态</th>
|
||||
<th class="two op">操作</th>
|
||||
</tr>
|
||||
@@ -105,6 +107,14 @@
|
||||
<td class="center">
|
||||
<span v-if="server.bandwidthBits > 0" class="bandwidth-span"><bits-var :v-bits="server.bandwidthBits"></bits-var></span>
|
||||
<span class="disabled" v-else>-</span>
|
||||
</td>
|
||||
<td class="center" v-if="windowWidth < miniWidth || windowWidth > columnWidth4">
|
||||
<span v-if="server.qps != '0'">{{server.qps}}</span>
|
||||
<span v-else class="disabled">-</span>
|
||||
</td>
|
||||
<td class="center" v-if="windowWidth < miniWidth || windowWidth > columnWidth5">
|
||||
<span v-if="server.attackQPS != '0'">{{server.attackQPS}}</span>
|
||||
<span v-else class="disabled">-</span>
|
||||
</td>
|
||||
<td class="center">
|
||||
<div v-if="!checkDNS">
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
Tea.context(function () {
|
||||
this.windowWidth = window.innerWidth
|
||||
this.miniWidth = 760
|
||||
this.columnWidth1 = 800
|
||||
this.columnWidth2 = 900
|
||||
this.columnWidth3 = 1000
|
||||
this.columnWidth4 = 1100
|
||||
this.columnWidth5 = 1200
|
||||
|
||||
this.servers.forEach(function (v) {
|
||||
v["status"] = {
|
||||
isOk: false,
|
||||
|
||||
Reference in New Issue
Block a user