mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-10 20:40:56 +08:00
指标图表可以设置忽略空值和其他对象值
This commit is contained in:
@@ -1 +1,17 @@
|
||||
package models
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
func (this *MetricChart) DecodeIgnoredKeys() []string {
|
||||
if len(this.IgnoredKeys) == 0 {
|
||||
return []string{}
|
||||
}
|
||||
|
||||
var result = []string{}
|
||||
err := json.Unmarshal([]byte(this.IgnoredKeys), &result)
|
||||
if err != nil {
|
||||
// 这里忽略错误
|
||||
return result
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user