TCP/UDP服务看板只显示对应的指标图表

This commit is contained in:
刘祥超
2021-10-08 14:59:51 +08:00
parent 42c53b47dc
commit 9a40100fd7
4 changed files with 18 additions and 5 deletions

View File

@@ -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).

View File

@@ -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
}