mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): aliyun vnc addr (#23883)
This commit is contained in:
@@ -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"`
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user