mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
regionv2 support vnc connect baremetal
This commit is contained in:
@@ -1575,6 +1575,21 @@ func (self *SHost) GetExtraDetails(ctx context.Context, userCred mcclient.TokenC
|
||||
return self.getMoreDetails(extra)
|
||||
}
|
||||
|
||||
func (self *SHost) AllowGetDetailsVnc(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) bool {
|
||||
return userCred.IsSystemAdmin()
|
||||
}
|
||||
|
||||
func (self *SHost) GetDetailsVnc(ctx context.Context, userCred mcclient.TokenCredential, query jsonutils.JSONObject) (jsonutils.JSONObject, error) {
|
||||
if utils.IsInStringArray(self.Status, []string{BAREMETAL_READY, BAREMETAL_RUNNING}) {
|
||||
retval := jsonutils.NewDict()
|
||||
retval.Set("host_id", jsonutils.NewString(self.Id))
|
||||
zone := self.GetZone()
|
||||
retval.Set("zone", jsonutils.NewString(zone.GetName()))
|
||||
return retval, nil
|
||||
}
|
||||
return jsonutils.NewDict(), nil
|
||||
}
|
||||
|
||||
func (manager *SHostManager) GetHostsByManagerAndRegion(managerId string, regionId string) []SHost {
|
||||
hosts := HostManager.Query().SubQuery()
|
||||
zones := ZoneManager.Query().SubQuery()
|
||||
|
||||
Reference in New Issue
Block a user