fix(apigateway): use info response service type of console endpoints

This commit is contained in:
Qiu Jian
2021-03-22 09:58:26 +08:00
parent 4baa4c6d85
commit bfc522a89c
3 changed files with 8 additions and 2 deletions
+1
View File
@@ -1006,6 +1006,7 @@ func getUserInfo2(s *mcclient.ClientSession, uid string, pid string, loginIp str
item := jsonutils.NewDict()
item.Add(jsonutils.NewString(ep.Url), "url")
item.Add(jsonutils.NewString(ep.Name), "name")
item.Add(jsonutils.NewString(ep.Service), "service")
menus.Add(item)
}
+2
View File
@@ -26,6 +26,8 @@ import (
type ExternalService struct {
Name string
Url string
Service string
}
type Endpoint struct {
+5 -2
View File
@@ -316,8 +316,11 @@ func (catalog KeystoneServiceCatalogV3) GetServicesByInterface(region string, in
if catalog[i].Endpoints[j].RegionId == region &&
catalog[i].Endpoints[j].Interface == infType &&
len(catalog[i].Endpoints[j].Name) > 0 {
srv := ExternalService{Name: catalog[i].Endpoints[j].Name,
Url: catalog[i].Endpoints[j].Url}
srv := ExternalService{
Name: catalog[i].Endpoints[j].Name,
Url: catalog[i].Endpoints[j].Url,
Service: catalog[i].Type,
}
services = append(services, srv)
}
}