mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-08 02:20:24 +08:00
TCP/UDP服务看板只显示对应的指标图表
This commit is contained in:
@@ -229,10 +229,11 @@ func (this *MetricItemDAO) ListEnabledItems(tx *dbs.Tx, category serverconfigs.M
|
||||
}
|
||||
|
||||
// FindAllPublicItems 取得公用的指标
|
||||
func (this *MetricItemDAO) FindAllPublicItems(tx *dbs.Tx) (result []*MetricItem, err error) {
|
||||
func (this *MetricItemDAO) FindAllPublicItems(tx *dbs.Tx, category string) (result []*MetricItem, err error) {
|
||||
_, err = this.Query(tx).
|
||||
State(MetricItemStateEnabled).
|
||||
Attr("userId", 0).
|
||||
Attr("category", category).
|
||||
Attr("isPublic", true).
|
||||
DescPk().
|
||||
Slice(&result).
|
||||
|
||||
@@ -843,7 +843,7 @@ func (this *NodeDAO) ComposeNodeConfig(tx *dbs.Tx, nodeId int64, cacheMap maps.M
|
||||
}
|
||||
|
||||
// 公用指标
|
||||
publicMetricItems, err := SharedMetricItemDAO.FindAllPublicItems(tx)
|
||||
publicMetricItems, err := SharedMetricItemDAO.FindAllPublicItems(tx, serverconfigs.MetricItemCategoryHTTP)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user