mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
M #~: Add states to show rdp button (#4610)
This commit is contained in:
parent
8f5f3af0d8
commit
02c3625c8c
@ -278,6 +278,10 @@ define(function(require) {
|
||||
LCM_STATES.DISK_RESIZE
|
||||
];
|
||||
|
||||
var RDP_STATES = [
|
||||
LCM_STATES.RUNNING
|
||||
];
|
||||
|
||||
var EXTERNAL_IP_ATTRS = [
|
||||
"GUEST_IP",
|
||||
"GUEST_IP_ADDRESSES",
|
||||
@ -897,18 +901,22 @@ define(function(require) {
|
||||
|
||||
// returns true if the RDP button should be enabled
|
||||
function isRDPSupported(element) {
|
||||
var rtn = false;
|
||||
var hasRdp = false;
|
||||
|
||||
if(element.TEMPLATE && element.TEMPLATE.NIC) {
|
||||
if (element.TEMPLATE && element.TEMPLATE.NIC && element.LCM_STATE) {
|
||||
var template = element.TEMPLATE;
|
||||
var state = parseInt(element.LCM_STATE);
|
||||
|
||||
rtn = hasRDP(template.NIC)
|
||||
|
||||
if (!rtn && template.NIC_ALIAS) {
|
||||
rtn = hasRDP(template.NIC_ALIAS)
|
||||
if ($.inArray(state, RDP_STATES) != -1) {
|
||||
hasRdp = hasRDP(template.NIC);
|
||||
|
||||
if (!hasRdp && template.NIC_ALIAS) {
|
||||
hasRdp = hasRDP(template.NIC_ALIAS);
|
||||
}
|
||||
}
|
||||
}
|
||||
return rtn;
|
||||
|
||||
return hasRdp;
|
||||
}
|
||||
|
||||
function hasRDP(nics) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user