feat: 配置sn和许可时间

This commit is contained in:
TsMask
2024-12-17 20:49:13 +08:00
parent edb77d96fb
commit d84274d7f0
4 changed files with 15 additions and 27 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,6 @@ func GetEMSState(ip string) *SysState {
}
}
version := "16.1.1"
if global.Version != "" {
version = global.Version
}
hostName, _ := os.Hostname()
dbInfo, _ := dborm.XormGetMySQLVersion()
emsState := &SysState{
@@ -1041,10 +1039,10 @@ func GetEMSState(ip string) *SysState {
DbInfo: dbInfo,
IpAddr: ipAddrs,
Port: config.GetYamlConfig().Rest[0].Port,
Version: version,
Capability: 9999999,
Version: global.Version,
Capability: config.GetYamlConfig().OMC.Capability,
SerialNum: config.GetYamlConfig().OMC.Sn,
ExpiryDate: "-",
ExpiryDate: config.GetYamlConfig().OMC.ExpiryDate,
HardwareInfo: HardwareInfo{CPUs: getCpuNumber(), Memory: getTotalMemory()},
CpuUsage: *cpuUsage,
MemUsage: *memUsage,