实现总体流量按天统计、按小时统计,提供管理平台Dashboard API

This commit is contained in:
GoEdgeLab
2021-01-21 18:55:34 +08:00
parent f914f45098
commit f947d769f7
15 changed files with 489 additions and 4 deletions

View File

@@ -592,6 +592,13 @@ func (this *ServerDAO) UpdateServerReverseProxy(tx *dbs.Tx, serverId int64, conf
return this.NotifyUpdate(tx, serverId)
}
// 计算所有可用服务数量
func (this *ServerDAO) CountAllEnabledServers(tx *dbs.Tx) (int64, error) {
return this.Query(tx).
State(ServerStateEnabled).
Count()
}
// 计算所有可用服务数量
func (this *ServerDAO) CountAllEnabledServersMatch(tx *dbs.Tx, groupId int64, keyword string, userId int64, clusterId int64, auditingFlag configutils.BoolState, protocolFamily string) (int64, error) {
query := this.Query(tx).