mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-12-10 04:00:24 +08:00
实现基本的监控终端管理
This commit is contained in:
@@ -2,6 +2,7 @@ package models
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/TeaOSLab/EdgeAPI/internal/remotelogs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/nodeconfigs"
|
||||
"github.com/iwind/TeaGo/logs"
|
||||
)
|
||||
@@ -18,3 +19,14 @@ func (this *NodeIPAddress) DecodeThresholds() []*nodeconfigs.NodeValueThresholdC
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func (this *NodeIPAddress) DecodeConnectivity() *nodeconfigs.Connectivity {
|
||||
var connectivity = &nodeconfigs.Connectivity{}
|
||||
if len(this.Connectivity) > 0 {
|
||||
err := json.Unmarshal([]byte(this.Connectivity), connectivity)
|
||||
if err != nil {
|
||||
remotelogs.Error("NodeIPAddress.DecodeConnectivity", "decode failed: "+err.Error())
|
||||
}
|
||||
}
|
||||
return connectivity
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user