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

@@ -57,12 +57,6 @@ redis:
host: "127.0.0.1" # Redis host
password: "helloearth"
db: 10 # Redis db_num
# UDM sub/auth db
udmuser:
port: 6379 # Redis port
host: "127.0.0.1"
password: "helloearth"
db: 0 # Redis db_num
# used to specify the default data source for multiple data resourece
defaultDataSourceName: "default"
@@ -78,7 +72,7 @@ mml:
# Tracking configuration
trace:
enabled: true
enabled: false
host: "172.16.5.100" # Fill in the specific IP address
port: 33033
@@ -109,7 +103,9 @@ omc:
vendor: ""
dn: ""
chk2ne: false
capability: 50
sn: "-"
expiryDate: "-"
checksign: false
rootDir: /usr/local/omc
binDir: /usr/local/omc/bin

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,

View File

@@ -67,7 +67,9 @@ type YamlConfig struct {
Vendor string `yaml:"vendor"`
Dn string `yaml:"dn"`
Chk2Ne bool `yaml:"chk2ne"`
Capability uint32 `yaml:"capability"`
Sn string `yaml:"sn"`
ExpiryDate string `yaml:"expiryDate"`
CheckSign bool `yaml:"checksign"`
RootDir string `yaml:"rootDir"`
BinDir string `yaml:"binDir"`

View File

@@ -54,32 +54,22 @@ redis:
host: "127.0.0.1" # Redis host
password: "helloearth"
db: 10 # Redis db_num
# UDM sub/auth db
udmuser:
port: 6379 # Redis port
host: "127.0.0.1"
password: "helloearth"
db: 0 # Redis db_num
# used to specify the default data source for multiple data resourece
defaultDataSourceName: "default"
# sleep: time delay for after write buffer (millisecond)
# deadLine: timeout for io read and write (second)
mml:
port: 4100
port2: 5002
sleep: 200
deadLine: 10
sizeRow: 600
sizeCol: 128
bufferSize: 65535
user: admin
password: admin
mmlHome: ./mmlhome
# Tracking configuration
trace:
enabled: true
enabled: false
host: "172.16.5.100" # Fill in the specific IP address
port: 33033
@@ -110,7 +100,9 @@ omc:
vendor: ""
dn: 4600
chk2ne: false
sn: "-"
capability: 50
sn: "12345678"
expiryDate: "2099-12-31"
checksign: false
rootDir: ./
binDir: ./bin