merge: 合并代码20241228
This commit is contained in:
@@ -786,7 +786,9 @@ func GetStateFromNF(w http.ResponseWriter, r *http.Request) {
|
||||
response.Data = data
|
||||
services.ResponseWithJson(w, http.StatusOK, response)
|
||||
return
|
||||
} else if neType == "omc" {
|
||||
}
|
||||
|
||||
if neType == "omc" {
|
||||
emsState := GetEMSState("127.0.0.1")
|
||||
services.ResponseWithJson(w, http.StatusOK, emsState)
|
||||
return
|
||||
@@ -1029,10 +1031,19 @@ func GetEMSState(ip string) *SysState {
|
||||
}
|
||||
}
|
||||
|
||||
version := "16.1.1"
|
||||
if global.Version != "" {
|
||||
version = global.Version
|
||||
CapabilityInt := config.GetYamlConfig().OMC.Capability
|
||||
if CapabilityInt == 0 {
|
||||
CapabilityInt = 5000
|
||||
}
|
||||
snStr := config.GetYamlConfig().OMC.Sn
|
||||
if snStr == "" {
|
||||
snStr = "-"
|
||||
}
|
||||
expiryDateStr := config.GetYamlConfig().OMC.ExpiryDate
|
||||
if expiryDateStr == "" {
|
||||
expiryDateStr = "-"
|
||||
}
|
||||
|
||||
hostName, _ := os.Hostname()
|
||||
dbInfo, _ := dborm.XormGetMySQLVersion()
|
||||
emsState := &SysState{
|
||||
@@ -1041,10 +1052,10 @@ func GetEMSState(ip string) *SysState {
|
||||
DbInfo: dbInfo,
|
||||
IpAddr: ipAddrs,
|
||||
Port: config.GetYamlConfig().Rest[0].Port,
|
||||
Version: version,
|
||||
Capability: 9999999,
|
||||
SerialNum: config.GetYamlConfig().OMC.Sn,
|
||||
ExpiryDate: "-",
|
||||
Version: global.Version,
|
||||
Capability: CapabilityInt,
|
||||
SerialNum: snStr,
|
||||
ExpiryDate: expiryDateStr,
|
||||
HardwareInfo: HardwareInfo{CPUs: getCpuNumber(), Memory: getTotalMemory()},
|
||||
CpuUsage: *cpuUsage,
|
||||
MemUsage: *memUsage,
|
||||
|
||||
Reference in New Issue
Block a user