mirror of https://github.com/apache/cloudstack.git
new UI - fix bug 6670(The UI shows templates are ready to use: DB says the DOWNLOAD_IN_PROGRESS)
This commit is contained in:
parent
1c24deda34
commit
c03c3a171f
|
|
@ -27,7 +27,7 @@ function initAddDiskOfferingButton($midmenuAddLink1) {
|
|||
|
||||
$dialogAddDisk = $("#dialog_add_disk");
|
||||
$dialogAddDisk.find("#customized").bind("change", function(event) {
|
||||
if($(this).val() == "false") {
|
||||
if($(this).val() == false) {
|
||||
$dialogAddDisk.find("#add_disk_disksize_container").show();
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ function drawTree(id, level, container) {
|
|||
if (domains != null && domains.length > 0) {
|
||||
for (var i = 0; i < domains.length; i++) {
|
||||
drawNode(domains[i], level, container);
|
||||
if(domains[i].haschild == true || domains[i].haschild == "true") //After API refactor, returned boolean value is true/false instead of "true"/"false". For testing convenience (Some people might not have backend update-to-date), check both true and "true".
|
||||
if(domains[i].haschild == true)
|
||||
drawTree(domains[i].id, (level+1), $("#domain_children_container_"+domains[i].id));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -711,7 +711,7 @@ function ipJsonToDetailsTab() {
|
|||
$actionMenu.find("#action_list").empty();
|
||||
var noAvailableActions = true;
|
||||
|
||||
if(isIpManageable(ipObj.domainid, ipObj.account) == true && ipObj.issourcenat != "true") {
|
||||
if(isIpManageable(ipObj.domainid, ipObj.account) == true && ipObj.issourcenat != true) {
|
||||
buildActionLinkForTab("Release IP", ipActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||
noAvailableActions = false;
|
||||
}
|
||||
|
|
@ -744,18 +744,18 @@ function ipClearDetailsTab() {
|
|||
}
|
||||
|
||||
function setSourceNatField(value, $field) {
|
||||
if(value == "true")
|
||||
if(value == true)
|
||||
$field.text("Yes");
|
||||
else if(value == "false")
|
||||
else if(value == false)
|
||||
$field.text("No");
|
||||
else
|
||||
$field.text("");
|
||||
}
|
||||
|
||||
function setNetworkTypeField(value, $field) {
|
||||
if(value == "true")
|
||||
function setNetworkTypeField(value, $field) {
|
||||
if(value == true)
|
||||
$field.text("Public");
|
||||
else if(value == "false")
|
||||
else if(value == false)
|
||||
$field.text("Direct");
|
||||
else
|
||||
$field.text("");
|
||||
|
|
|
|||
|
|
@ -239,8 +239,8 @@ function isoJsonToDetailsTab() {
|
|||
$thisTab.find("#domain").text(fromdb(jsonObj.domain));
|
||||
|
||||
var status = "Ready";
|
||||
if (jsonObj.isready == "false")
|
||||
status = fromdb(jsonObj.isostatus);
|
||||
if (jsonObj.isready == false)
|
||||
status = fromdb(jsonObj.status);
|
||||
setTemplateStateInRightPanel(status, $thisTab.find("#status"));
|
||||
|
||||
if(jsonObj.size != null)
|
||||
|
|
@ -261,9 +261,9 @@ function isoJsonToDetailsTab() {
|
|||
var $actionMenu = $("#right_panel_content #tab_content_details #action_link #action_menu");
|
||||
$actionMenu.find("#action_list").empty();
|
||||
var noAvailableActions = true;
|
||||
|
||||
|
||||
// "Edit", "Copy", "Create VM"
|
||||
if ((isUser() && jsonObj.ispublic == "true" && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.isready == "false") {
|
||||
if ((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.isready == false) {
|
||||
//$("#edit_button").hide();
|
||||
}
|
||||
else {
|
||||
|
|
@ -274,7 +274,7 @@ function isoJsonToDetailsTab() {
|
|||
}
|
||||
|
||||
// "Create VM"
|
||||
if (((isUser() && jsonObj.ispublic == "true" && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.isready == "false") || (jsonObj.bootable == "false")) {
|
||||
if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.isready == false) || (jsonObj.bootable == false)) {
|
||||
}
|
||||
else {
|
||||
buildActionLinkForTab("Create VM", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||
|
|
@ -282,7 +282,7 @@ function isoJsonToDetailsTab() {
|
|||
}
|
||||
|
||||
// "Delete"
|
||||
if (((isUser() && jsonObj.ispublic == "true" && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) || (jsonObj.isready == "false" && jsonObj.isostatus != null && jsonObj.isostatus.indexOf("% Downloaded") != -1)) {
|
||||
if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) || (jsonObj.isready == false && jsonObj.isostatus != null && jsonObj.isostatus.indexOf("% Downloaded") != -1)) {
|
||||
}
|
||||
else {
|
||||
buildActionLinkForTab("Delete ISO", isoActionMap, $actionMenu, $midmenuItem1, $thisTab);
|
||||
|
|
@ -458,7 +458,7 @@ function doDeleteIso($actionLink, $detailsTab, $midmenuItem1) {
|
|||
moreCriteria.push("&zoneid="+zoneId);
|
||||
|
||||
var $dialog1;
|
||||
if(jsonObj.crossZones == "true")
|
||||
if(jsonObj.crossZones == true)
|
||||
$dialog1 = $("#dialog_confirmation_delete_iso_all_zones");
|
||||
else
|
||||
$dialog1 = $("#dialog_confirmation_delete_iso");
|
||||
|
|
|
|||
|
|
@ -1791,9 +1791,9 @@ function toDayOfWeekDesp(dayOfWeek) {
|
|||
}
|
||||
|
||||
function toBooleanText(booleanValue) {
|
||||
if(booleanValue == "true")
|
||||
if(booleanValue == true || booleanValue == "true")
|
||||
return "Yes";
|
||||
else if(booleanValue == "false")
|
||||
else if(booleanValue == false ||booleanValue == "false")
|
||||
return "No";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -247,8 +247,8 @@ function templateJsonToDetailsTab() {
|
|||
$thisTab.find("#displaytext_edit").val(fromdb(jsonObj.displaytext));
|
||||
|
||||
var status = "Ready";
|
||||
if (jsonObj.isready == "false")
|
||||
status = fromdb(jsonObj.templatestatus);
|
||||
if (jsonObj.isready == false)
|
||||
status = fromdb(jsonObj.status);
|
||||
setTemplateStateInRightPanel(status, $thisTab.find("#status"));
|
||||
|
||||
if(jsonObj.size != null)
|
||||
|
|
@ -281,9 +281,9 @@ function templateJsonToDetailsTab() {
|
|||
var $actionMenu = $("#right_panel_content #tab_content_details #action_link #action_menu");
|
||||
$actionMenu.find("#action_list").empty();
|
||||
var noAvailableActions = true;
|
||||
|
||||
|
||||
// action Edit, Copy, Create VM
|
||||
if ((isUser() && jsonObj.ispublic == "true" && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.id==DomRTemplateId || jsonObj.isready == "false") {
|
||||
if ((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.id==DomRTemplateId || jsonObj.isready == false) {
|
||||
//$("#edit_button").hide();
|
||||
}
|
||||
else {
|
||||
|
|
@ -295,7 +295,7 @@ function templateJsonToDetailsTab() {
|
|||
}
|
||||
|
||||
// action Delete
|
||||
if (((isUser() && jsonObj.ispublic == "true" && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.id==DomRTemplateId) || (jsonObj.isready == "false" && jsonObj.templatestatus != null && jsonObj.templatestatus.indexOf("% Downloaded") != -1)) {
|
||||
if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) || jsonObj.id==DomRTemplateId) || (jsonObj.isready == false && jsonObj.templatestatus != null && jsonObj.templatestatus.indexOf("% Downloaded") != -1)) {
|
||||
//template.find("#template_delete_container").hide();
|
||||
}
|
||||
else {
|
||||
|
|
@ -505,7 +505,7 @@ function doDeleteTemplate($actionLink, $detailsTab, $midmenuItem1) {
|
|||
moreCriteria.push("&zoneid="+zoneId);
|
||||
|
||||
var $dialog1;
|
||||
if(jsonObj.crossZones == "true")
|
||||
if(jsonObj.crossZones == true)
|
||||
$dialog1 = $("#dialog_confirmation_delete_template_all_zones");
|
||||
else
|
||||
$dialog1 = $("#dialog_confirmation_delete_template");
|
||||
|
|
|
|||
Loading…
Reference in New Issue