fix: 补充缺失代码
This commit is contained in:
@@ -750,7 +750,7 @@ func GetStateFromNF(w http.ResponseWriter, r *http.Request) {
|
||||
restHostPort := fmt.Sprintf("http://127.0.0.1:%d", config.GetYamlConfig().Rest[0].Port)
|
||||
getNeInfoPattern := fmt.Sprintf(config.DefaultUriPrefix+"/databaseManagement/v1/elementType/%s/objectType/ne_info",
|
||||
config.GetYamlConfig().Database.Name)
|
||||
getNeInfoURI := restHostPort + getNeInfoPattern + "?WHERE=status='0'"
|
||||
getNeInfoURI := restHostPort + getNeInfoPattern + "?WHERE=status+in+('0','3')"
|
||||
log.Debug("getNeInfoPattern:", getNeInfoPattern)
|
||||
|
||||
resp, err := client.R().
|
||||
@@ -774,9 +774,9 @@ func GetStateFromNF(w http.ResponseWriter, r *http.Request) {
|
||||
getNeInfoURI := restHostPort + getNeInfoPattern
|
||||
neId := services.GetUriParamString(r, "ne_id", ",", true, true)
|
||||
if neId == "" {
|
||||
getNeInfoURI = getNeInfoURI + fmt.Sprintf("?WHERE=status='0'+and+ne_type='%s'", neType)
|
||||
getNeInfoURI = getNeInfoURI + fmt.Sprintf("?WHERE=status+in+('0','3')+and+ne_type='%s'", neType)
|
||||
} else {
|
||||
getNeInfoURI = getNeInfoURI + fmt.Sprintf("?WHERE=status='0'+and+ne_type='%v'+and+ne_id+in+%v", neType, neId)
|
||||
getNeInfoURI = getNeInfoURI + fmt.Sprintf("?WHERE=status+in+('0','3')+and+ne_type='%v'+and+ne_id+in+%v", neType, neId)
|
||||
}
|
||||
log.Debug("getNeInfoURI:", getNeInfoURI)
|
||||
|
||||
@@ -802,7 +802,7 @@ func GetStateFromNF(w http.ResponseWriter, r *http.Request) {
|
||||
for _, ne := range neList {
|
||||
result := make(map[string]interface{})
|
||||
log.Debugf("r.RemoteAddr: %s omcNeTypeLower: %s", r.RemoteAddr, omcNeTypeLower)
|
||||
log.Debug("ne: ", ne)
|
||||
log.Trace("ne: ", ne)
|
||||
//if strings.ToLower(ne.NeType) != omcNeTypeLower || !strings.Contains(r.RemoteAddr, ne.Ip) {
|
||||
if strings.ToLower(ne.NeType) != omcNeTypeLower {
|
||||
hostUri := fmt.Sprintf("http://%s:%v", ne.Ip, ne.Port)
|
||||
@@ -881,12 +881,13 @@ func GetEMSState(ip string) *SysState {
|
||||
version = global.Version
|
||||
}
|
||||
hostName, _ := os.Hostname()
|
||||
dbInfo, _ := dborm.XormGetMySQLVersion()
|
||||
emsState := &SysState{
|
||||
HostName: hostName,
|
||||
OsInfo: getUnameStr(),
|
||||
DbInfo: "mysql Ver 15.1 Distrib 10.3.35-MariaDB, for Linux (aarch64) using readline 5.1",
|
||||
DbInfo: dbInfo,
|
||||
IpAddr: []string{ip},
|
||||
Port: 3030,
|
||||
Port: config.GetYamlConfig().Rest[0].Port,
|
||||
Version: version,
|
||||
Capability: 9999999,
|
||||
SerialNum: config.GetYamlConfig().OMC.Sn,
|
||||
|
||||
Reference in New Issue
Block a user