fix(region): aliyun vnc addr (#23883)

This commit is contained in:
屈轩
2025-12-03 14:04:11 +08:00
committed by GitHub
parent 6af0bd4b03
commit f48a23cbfa
6 changed files with 11 additions and 19 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ type WebConsoleOptions struct {
IpmitoolPath string `help:"ipmitool binary path used to connect baremetal sol" default:"/usr/bin/ipmitool"`
EnableAutoLogin bool `help:"allow webconsole to log in directly with the cloudroot public key" default:"false"`
ApsaraConsoleAddr string `help:"Apsara console addr" default:"https://xxxx.com.cn/module/ecs/vnc/index.html"`
AliyunConsoleAddr string `help:"Aliyun vnc addr" default:"https://ecs.console.aliyun.com/vnc/index.htm"`
AliyunConsoleAddr string `help:"Aliyun vnc addr" default:"https://g.alicdn.com/aliyun/ecs-console-vnc2/0.0.8/index.html"`
SshSessionTimeoutMinutes int `help:"ssh timeout session" default:"-1"`
RdpSessionTimeoutMinutes int `help:"rdp timeout session" default:"-1"`
+6 -7
View File
@@ -19,6 +19,7 @@ import (
"fmt"
"net/url"
"os/exec"
"strings"
"yunion.io/x/cloudmux/pkg/cloudprovider"
"yunion.io/x/jsonutils"
@@ -172,16 +173,14 @@ func (info *RemoteConsoleInfo) getQcloudURL() (string, error) {
func (info *RemoteConsoleInfo) getAliyunURL() (string, error) {
isWindows := "false"
if info.OsName == "Windows" {
if strings.EqualFold(info.OsName, "windows") {
isWindows = "true"
}
params := url.Values{
"vncUrl": {info.Url},
"instanceId": {info.InstanceId},
"isWindows": {isWindows},
"password": {info.Password},
vncUrl, err := url.QueryUnescape(info.Url)
if err != nil {
return "", errors.Wrap(err, "url.QueryUnescape")
}
return info.getConnParamsURL(options.Options.AliyunConsoleAddr, params), nil
return fmt.Sprintf("%s?vncUrl=%s&instanceId=%s&isWindows=%s", options.Options.AliyunConsoleAddr, vncUrl, info.InstanceId, isWindows), nil
}
func (info *RemoteConsoleInfo) getCloudpodsURL() (string, error) {