mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-09 08:40:26 +08:00
指标图表可以设置忽略空值和其他对象值
This commit is contained in:
@@ -25,14 +25,19 @@ func InitChart(parent *actionutils.ParentAction, chartId int64) (*pb.MetricChart
|
||||
if chart == nil {
|
||||
return nil, errors.New("metric chart not found")
|
||||
}
|
||||
if len(chart.IgnoredKeys) == 0 {
|
||||
chart.IgnoredKeys = []string{}
|
||||
}
|
||||
parent.Data["chart"] = maps.Map{
|
||||
"id": chart.Id,
|
||||
"name": chart.Name,
|
||||
"isOn": chart.IsOn,
|
||||
"widthDiv": chart.WidthDiv,
|
||||
"maxItems": chart.MaxItems,
|
||||
"type": chart.Type,
|
||||
"typeName": serverconfigs.FindMetricChartTypeName(chart.Type),
|
||||
"id": chart.Id,
|
||||
"name": chart.Name,
|
||||
"isOn": chart.IsOn,
|
||||
"widthDiv": chart.WidthDiv,
|
||||
"maxItems": chart.MaxItems,
|
||||
"type": chart.Type,
|
||||
"typeName": serverconfigs.FindMetricChartTypeName(chart.Type),
|
||||
"ignoreEmptyKeys": chart.IgnoreEmptyKeys,
|
||||
"ignoredKeys": chart.IgnoredKeys,
|
||||
}
|
||||
return chart, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user