1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-19 06:50:07 +03:00

M#~: Use toggle instead if (#1228)

(cherry picked from commit b68fcde08184a2345d5a4bc822631ec1626ea982)
This commit is contained in:
Frederick Borges 2021-05-19 11:34:10 +02:00 committed by Tino Vazquez
parent 16e029fa51
commit 3cba7490fe

View File

@ -328,29 +328,14 @@ define(function(require) {
$(".provision_wfile_button", context).toggle(Boolean(OpenNebulaVM.isWFileSupported(data)));
var state = get_provision_vm_state(data);
if (state.str === "RUNNING") {
$('.dropdown-menu-css', context).show();
}
else {
$('.dropdown-menu-css', context).hide();
}
var is_vnc_allowed = OpenNebulaVM.isVNCSupported(data);
var is_spice_allowed = OpenNebulaVM.isSPICESupported(data);
var is_vmrc_allowed = OpenNebulaVM.isVMRCSupported(data);
var is_virt_viewer_allowed = OpenNebulaVM.isWFileSupported(data);
if (is_spice_allowed) {
$(".provision_spice_button", context).parent().show();
}else{
$(".provision_spice_button", context).parent().hide();
}
if (is_virt_viewer_allowed) {
$(".provision_wfile_button", context).parent().show();
}else{
$(".provision_wfile_button", context).parent().hide();
}
$('.dropdown-menu-css', context).toggle(state.str === "RUNNING");
$(".provision_spice_button", context).parent().toggle(is_spice_allowed);
$(".provision_wfile_button", context).parent().toggle(is_virt_viewer_allowed);
if (is_fireedge_configured){
$(".provision_vnc_button", context).parent().hide();