1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

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

This commit is contained in:
Frederick Borges 2021-05-19 11:34:10 +02:00 committed by Ruben S. Montero
parent 2abce1df5f
commit 434ddb8ea3
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -329,29 +329,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();