Skip to content

Commit

Permalink
B #4948: Fix remote buttons after state switches (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Betanzos committed Jun 23, 2020
1 parent 8302e91 commit ab84b45
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/sunstone/public/app/tabs/vms-tab/hooks/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ define(function(require) {
isWFileSupported = OpenNebulaVM.isWFileSupported(element),
isRDPSupported = OpenNebulaVM.isRDPSupported(element);

// All remote buttons are disabled
var allDisabled = (!isVNCSupported && !isSPICESupported && !isWFileSupported && !isRDPSupported);
$("#vmsremote_buttons").toggle(!allDisabled);

if (isVNCSupported) {
$(".vnc-sunstone-info").show();
$(".spice-sunstone-info").hide();
Expand All @@ -59,16 +63,11 @@ define(function(require) {
$(".vnc-sunstone-info").hide();
}

// Enable / disable virt-viewer button
isWFileSupported ? $(".vv-sunstone-info").show() : $(".vv-sunstone-info").hide();

// Enable / disable rdp button
isRDPSupported ? $(".rdp-sunstone-info").show() : $(".rdp-sunstone-info").hide();
// Show / hide virt-viewer button
$(".vv-sunstone-info").toggle(isWFileSupported);

// All remote buttons are disabled
if (!isVNCSupported && !isSPICESupported && !isWFileSupported && !isRDPSupported) {
$("#vmsremote_buttons").hide()
}
// Show / hide rdp button
$(".rdp-sunstone-info").toggle(isRDPSupported);

if(config &&
config["system_config"] &&
Expand Down

0 comments on commit ab84b45

Please sign in to comment.