Skip to content

Commit

Permalink
Fixed hide show button hosts zones
Browse files Browse the repository at this point in the history
  • Loading branch information
IAGO HENRIQUE authored and IAGO HENRIQUE committed Jun 6, 2023
1 parent f99b2e7 commit 907f5e5
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions dbaas/logical/templates/logical/database/details/migrate_tab.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,15 +269,29 @@ <h3>Regions</h3>
document.querySelector('#migrate_region_btn').disabled = true;
}

function enable_disable_host_zone_btns(is_enabled){
$('.host-zone').each(function(){
var $hostZone = $(this);
var hostId = $hostZone.data('hostId');
if (is_enabled){
$("#migrate_host_btn_" + hostId).show();
}else{
$("#migrate_host_btn_" + hostId).hide();
}
});
}

$("#migrate_region").change(function() {
var is_enabled = true;
if ((is_in_waiting) || ($(this).val() === "---------")){
status_migrate("migrate_region_btn", "DISABLE", "DISABLE");
status_migrate("migrate_host_btn_" + hostId, "DISABLE", "DISABLE");
is_enabled = true;
}
else {
status_migrate("migrate_region_btn", "DISABLE", "False");
status_migrate("migrate_host_btn_" + hostId, "DISABLE", "DISABLE");
is_enabled = false;
}
enable_disable_host_zone_btns(is_enabled);
});

$(".host-zone").on("change", function() {
Expand Down

0 comments on commit 907f5e5

Please sign in to comment.