mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #9180 from tb365/bugfix/tb-bugfix-1203
Bugfix/tb bugfix 1203
This commit is contained in:
@@ -29,4 +29,5 @@ const (
|
||||
VMRC = "vmrc"
|
||||
ZSTACK = "zstack"
|
||||
CTYUN = "ctyun"
|
||||
HUAWEI = "huawei"
|
||||
)
|
||||
|
||||
@@ -514,13 +514,14 @@ func (man *SCachedLoadbalancerAclManager) newFromCloudLoadbalancerAcl(ctx contex
|
||||
f := aclEntites.Fingerprint()
|
||||
if LoadbalancerAclManager.CountByFingerPrint(provider.ProjectId, f) == 0 {
|
||||
localAcl := &SLoadbalancerAcl{}
|
||||
localAcl.SetModelManager(LoadbalancerAclManager, localAcl)
|
||||
localAcl.Name = acl.Name
|
||||
localAcl.Description = acl.Description
|
||||
localAcl.AclEntries = &aclEntites
|
||||
localAcl.Fingerprint = f
|
||||
localAcl.IsPublic = true
|
||||
localAcl.PublicScope = string(rbacutils.ScopeDomain)
|
||||
err := LoadbalancerAclManager.TableSpec().Insert(ctx, &localAcl)
|
||||
err := LoadbalancerAclManager.TableSpec().Insert(ctx, localAcl)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "cachedLoadbalancerAclManager.new.InsertAcl")
|
||||
}
|
||||
|
||||
@@ -1230,6 +1230,10 @@ func (self *SRegion) GetInstanceVNCUrl(instanceId string) (jsonutils.JSONObject,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if retDict, ok := ret.(*jsonutils.JSONDict); ok {
|
||||
retDict.Set("protocol", jsonutils.NewString("huawei"))
|
||||
}
|
||||
|
||||
return ret, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ func handleServerRemoteConsole(ctx context.Context, w http.ResponseWriter, r *ht
|
||||
return
|
||||
}
|
||||
switch info.Protocol {
|
||||
case session.ALIYUN, session.QCLOUD, session.OPENSTACK, session.VMRC, session.ZSTACK, session.CTYUN:
|
||||
case session.ALIYUN, session.QCLOUD, session.OPENSTACK, session.VMRC, session.ZSTACK, session.CTYUN, session.HUAWEI:
|
||||
responsePublicCloudConsole(ctx, info, w)
|
||||
case session.VNC, session.SPICE, session.WMKS:
|
||||
handleDataSession(ctx, info, w, url.Values{"password": {info.GetPassword()}}, true)
|
||||
|
||||
@@ -34,6 +34,7 @@ const (
|
||||
VMRC = api.VMRC
|
||||
ZSTACK = api.ZSTACK
|
||||
CTYUN = api.CTYUN
|
||||
HUAWEI = api.HUAWEI
|
||||
)
|
||||
|
||||
type RemoteConsoleInfo struct {
|
||||
@@ -121,7 +122,7 @@ func (info *RemoteConsoleInfo) GetConnectParams() (string, error) {
|
||||
return info.getAliyunURL()
|
||||
case QCLOUD:
|
||||
return info.getQcloudURL()
|
||||
case OPENSTACK, VMRC, ZSTACK, CTYUN:
|
||||
case OPENSTACK, VMRC, ZSTACK, CTYUN, HUAWEI:
|
||||
return info.Url, nil
|
||||
default:
|
||||
return "", fmt.Errorf("Can't convert protocol %s to connect params", info.Protocol)
|
||||
|
||||
Reference in New Issue
Block a user