mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
33 lines
638 B
Go
33 lines
638 B
Go
package modules
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"yunion.io/x/jsonutils"
|
|
"yunion.io/x/onecloud/pkg/mcclient"
|
|
)
|
|
|
|
type VNCProxyManager struct {
|
|
ResourceManager
|
|
}
|
|
|
|
func (this *VNCProxyManager) DoConnect(s *mcclient.ClientSession, id string, params jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
|
url := "/vncproxy"
|
|
objtype, e := params.GetString("objtype")
|
|
if e == nil && len(objtype) > 0 {
|
|
url = fmt.Sprintf("%s/%s", url, objtype)
|
|
}
|
|
url = fmt.Sprintf("%s/%s", url, id)
|
|
return this._post(s, url, nil, "vncproxy")
|
|
}
|
|
|
|
var (
|
|
VNCProxy VNCProxyManager
|
|
)
|
|
|
|
func init() {
|
|
VNCProxy = VNCProxyManager{NewVNCProxyManager()}
|
|
|
|
register(&VNCProxy)
|
|
}
|