1
0

merge: 合并代码20241228

This commit is contained in:
TsMask
2024-12-28 15:36:47 +08:00
parent 6b4633fa5e
commit 33cbaeb1cd
69 changed files with 2546 additions and 1951 deletions

View File

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