mirror of https://github.com/apache/cloudstack.git
bug 7103: fixed session timeout error handling of all AJAX calls. You will now properly timeout.
This commit is contained in:
parent
f1ce408675
commit
21f8bfde8b
|
|
@ -95,8 +95,10 @@ function initAddDiskOfferingButton($midmenuAddLink1) {
|
|||
bindClickToMidMenu($midmenuItem1, diskOfferingToRightPanel, getMidmenuId);
|
||||
afterAddingMidMenuItem($midmenuItem1, true);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInMidMenu(XMLHttpResponse, $midmenuItem1);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInMidMenu(XMLHttpResponse, $midmenuItem1);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -201,9 +201,8 @@ var hostActionMap = {
|
|||
asyncJobResponse: "preparehostformaintenanceresponse",
|
||||
dialogBeforeActionFn: doEnableMaintenanceMode,
|
||||
inProcessText: "Enabling Maintenance Mode....",
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.host;
|
||||
hostToMidmenu(item, $midmenuItem1);
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
hostToMidmenu(json.queryasyncjobresultresponse.host[0], $midmenuItem1);
|
||||
hostToRightPanel($midmenuItem1);
|
||||
$("#right_panel_content #after_action_info").text("We are actively enabling maintenance on your host. Please refresh periodically for an updated status.");
|
||||
}
|
||||
|
|
@ -213,9 +212,8 @@ var hostActionMap = {
|
|||
asyncJobResponse: "cancelhostmaintenanceresponse",
|
||||
dialogBeforeActionFn: doCancelMaintenanceMode,
|
||||
inProcessText: "Cancelling Maintenance Mode....",
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.host;
|
||||
hostToMidmenu(item, $midmenuItem1);
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
hostToMidmenu(json.queryasyncjobresultresponse.host[0], $midmenuItem1);
|
||||
hostToRightPanel($midmenuItem1);
|
||||
$("#right_panel_content #after_action_info").text("We are actively cancelling your scheduled maintenance. Please refresh periodically for an updated status.");
|
||||
}
|
||||
|
|
@ -226,8 +224,7 @@ var hostActionMap = {
|
|||
dialogBeforeActionFn: doForceReconnect,
|
||||
inProcessText: "Reconnecting....",
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.host;
|
||||
hostToMidmenu(item, $midmenuItem1);
|
||||
hostToMidmenu(json.queryasyncjobresultresponse.jobresult.host, $midmenuItem1);
|
||||
hostToRightPanel($midmenuItem1);
|
||||
$("#right_panel_content #after_action_info").text("We are actively reconnecting your host. Please refresh periodically for an updated status.");
|
||||
}
|
||||
|
|
@ -236,10 +233,8 @@ var hostActionMap = {
|
|||
isAsyncJob: false,
|
||||
dialogBeforeActionFn: doRemoveHost,
|
||||
inProcessText: "Removing Host....",
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
$midmenuItem1.slideUp("slow", function() {
|
||||
$(this).remove();
|
||||
});
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
$midmenuItem1.remove();
|
||||
clearRightPanel();
|
||||
hostClearRightPanel();
|
||||
}
|
||||
|
|
@ -248,10 +243,16 @@ var hostActionMap = {
|
|||
isAsyncJob: false,
|
||||
dialogBeforeActionFn: doUpdateOSPreference,
|
||||
inProcessText: "Updating OS Preference....",
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
var item = json.updatehostresponse.host;
|
||||
hostToMidmenu(item, $midmenuItem1);
|
||||
hostToRightPanel($midmenuItem1);
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
//call listHosts API before bug 6650 ("updateHost API should return an embedded object like what listHosts API does") is fixed.
|
||||
$.ajax({
|
||||
data: createURL("command=listHosts&id="+id),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
hostToMidmenu(json.listhostsresponse.host[0], $midmenuItem1);
|
||||
hostToRightPanel($midmenuItem1);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -856,18 +856,20 @@ function initVMWizard() {
|
|||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
$("body").stopTime(timerKey);
|
||||
afterAddingMidMenuItem($midmenuItem1, false);
|
||||
handleError(XMLHttpResponse);
|
||||
$("body").stopTime(timerKey);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
afterAddingMidMenuItem($midmenuItem1, false);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
0
|
||||
);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
afterAddingMidMenuItem($midmenuItem1, false);
|
||||
handleError(XMLHttpResponse);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
afterAddingMidMenuItem($midmenuItem1, false);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,8 +70,10 @@ function afterLoadIpJSP() {
|
|||
afterAddingMidMenuItem($midmenuItem1, true);
|
||||
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInMidMenu(XMLHttpResponse, $midmenuItem1);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInMidMenu(XMLHttpResponse, $midmenuItem1);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -123,9 +125,10 @@ function afterLoadIpJSP() {
|
|||
refreshCreatePortForwardingRow();
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse);
|
||||
$template.slideUp("slow", function() {
|
||||
$(this).remove();
|
||||
handleError(XMLHttpResponse, function() {
|
||||
$template.slideUp("slow", function() {
|
||||
$(this).remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -176,9 +179,10 @@ function afterLoadIpJSP() {
|
|||
refreshCreateLoadBalancerRow();
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse);
|
||||
$template.slideUp("slow", function() {
|
||||
$(this).remove();
|
||||
handleError(XMLHttpResponse, function() {
|
||||
$template.slideUp("slow", function() {
|
||||
$(this).remove();
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -352,8 +356,10 @@ function showEnableVPNDialog($thisTab) {
|
|||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
$("body").stopTime(timerKey);
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
$("body").stopTime(timerKey);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -361,7 +367,9 @@ function showEnableVPNDialog($thisTab) {
|
|||
);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -454,8 +462,10 @@ function showVpnUsers(presharedkey, publicip) {
|
|||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
$("body").stopTime(timerKey);
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
$("body").stopTime(timerKey);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -463,7 +473,9 @@ function showVpnUsers(presharedkey, publicip) {
|
|||
);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -527,8 +539,10 @@ function showVpnUsers(presharedkey, publicip) {
|
|||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
$("body").stopTime(timerKey);
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
$("body").stopTime(timerKey);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -536,7 +550,9 @@ function showVpnUsers(presharedkey, publicip) {
|
|||
);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -632,8 +648,10 @@ function enableDeleteUser() {
|
|||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
$("body").stopTime(timerKey);
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
$("body").stopTime(timerKey);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -641,7 +659,9 @@ function enableDeleteUser() {
|
|||
);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -84,8 +84,10 @@ function afterLoadIsoJSP() {
|
|||
}
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInMidMenu(XMLHttpResponse, $midmenuItem1);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInMidMenu(XMLHttpResponse, $midmenuItem1);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -194,9 +196,34 @@ function isoJsonToDetailsTab() {
|
|||
$thisTab.find("#tab_container").hide();
|
||||
$thisTab.find("#tab_spinning_wheel").show();
|
||||
|
||||
var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1");
|
||||
var jsonObj = $midmenuItem1.data("jsonObj");
|
||||
|
||||
var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1");
|
||||
|
||||
|
||||
var jsonObj = $midmenuItem1.data("jsonObj");
|
||||
|
||||
//listIsos API has a bug => it returns nothing when id is 200(xs-tools.iso) and zoneid is specified. So, comment the following code before the bug is fixed.
|
||||
/*
|
||||
var array1 = [];
|
||||
var id = $midmenuItem1.data("jsonObj").id;
|
||||
array1.push("&id="+id);
|
||||
|
||||
var zoneid = $midmenuItem1.data("jsonObj").zoneid;
|
||||
if(zoneid != null)
|
||||
array1.push("&zoneid="+zoneid);
|
||||
|
||||
var jsonObj;
|
||||
$.ajax({
|
||||
data: createURL("command=listIsos&isofilter=self"+array1.join("")),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listisosresponse.iso;
|
||||
if(items != null && items.length > 0)
|
||||
jsonObj = items[0];
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
$thisTab.data("jsonObj", jsonObj);
|
||||
$midmenuItem1.data("jsonObj", jsonObj);
|
||||
|
||||
|
|
|
|||
|
|
@ -100,16 +100,20 @@ function doActionToTab(id, $actionLink, apiCommand, $midmenuItem1, $thisTab) {
|
|||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
$("body").stopTime(timerKey);
|
||||
handleErrorInDetailsTab(XMLHttpResponse, $thisTab, label, $afterActionInfoContainer, $midmenuItem1);
|
||||
$("body").stopTime(timerKey);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDetailsTab(XMLHttpResponse, $thisTab, label, $afterActionInfoContainer, $midmenuItem1);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
0
|
||||
);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDetailsTab(XMLHttpResponse, $thisTab, label, $afterActionInfoContainer, $midmenuItem1);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDetailsTab(XMLHttpResponse, $thisTab, label, $afterActionInfoContainer, $midmenuItem1);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -130,8 +134,10 @@ function doActionToTab(id, $actionLink, apiCommand, $midmenuItem1, $thisTab) {
|
|||
|
||||
afterActionSeccessFn(json, $midmenuItem1, id);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDetailsTab(XMLHttpResponse, $thisTab, label, $afterActionInfoContainer, $midmenuItem1);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDetailsTab(XMLHttpResponse, $thisTab, label, $afterActionInfoContainer, $midmenuItem1);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -248,16 +254,20 @@ function doActionToSubgridItem(id, $actionLink, apiCommand, $subgridItem) {
|
|||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
$("body").stopTime(timerKey);
|
||||
handleErrorInSubgridItem(XMLHttpResponse, $subgridItem, label);
|
||||
$("body").stopTime(timerKey);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInSubgridItem(XMLHttpResponse, $subgridItem, label);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
0
|
||||
);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInSubgridItem(XMLHttpResponse, $subgridItem, label);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInSubgridItem(XMLHttpResponse, $subgridItem, label);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -275,8 +285,10 @@ function doActionToSubgridItem(id, $actionLink, apiCommand, $subgridItem) {
|
|||
$subgridItem.find("#after_action_info_container").removeClass("error").addClass("success").show();
|
||||
afterActionSeccessFn(json, id, $subgridItem);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInSubgridItem(XMLHttpResponse, $subgridItem, label);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInSubgridItem(XMLHttpResponse, $subgridItem, label);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -410,8 +422,9 @@ function doActionToMidMenu(id, apiInfo, apiCommand) {
|
|||
0
|
||||
);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInMidMenu(XMLHttpResponse, $midmenuItem1, id, inProcessText);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse);
|
||||
handleErrorInMidMenu(XMLHttpResponse, $midmenuItem1, id, inProcessText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -985,7 +998,8 @@ function bindAndListMidMenuItems($leftmenu, commandString, jsonResponse1, jsonRe
|
|||
});
|
||||
}
|
||||
|
||||
function handleErrorInDialog(XMLHttpResponse, $thisDialog) {
|
||||
function handleErrorInDialog(XMLHttpResponse, $thisDialog) {
|
||||
handleError(XMLHttpResponse);
|
||||
var start = XMLHttpResponse.responseText.indexOf("h1") + 3;
|
||||
var end = XMLHttpResponse.responseText.indexOf("</h1");
|
||||
var errorMsg = XMLHttpResponse.responseText.substring(start, end);
|
||||
|
|
|
|||
|
|
@ -243,9 +243,11 @@ function initAddHostButton($midmenuAddLink1, currentPageInRightPanel) {
|
|||
|
||||
clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog);
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog);
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -405,8 +407,10 @@ function initAddPrimaryStorageButton($midmenuAddLink2, currentPageInRightPanel)
|
|||
}
|
||||
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ var primarystorageActionMap = {
|
|||
dialogBeforeActionFn: doEnableMaintenanceModeForPrimaryStorage,
|
||||
inProcessText: "Enabling Maintenance Mode....",
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.storagepool;
|
||||
var item = json.queryasyncjobresultresponse.jobresult.prepareprimarystorageformaintenanceresponse;
|
||||
primarystorageToMidmenu(item, $midmenuItem1);
|
||||
primarystorageToRightPanel($midmenuItem1);
|
||||
$("#right_panel_content #after_action_info").text("We are actively enabling maintenance. Please refresh periodically for an updated status.");
|
||||
|
|
@ -124,7 +124,7 @@ var primarystorageActionMap = {
|
|||
dialogBeforeActionFn: doCancelMaintenanceModeForPrimaryStorage,
|
||||
inProcessText: "Cancelling Maintenance Mode....",
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.storagepool;
|
||||
var item = json.queryasyncjobresultresponse.jobresult.cancelprimarystoragemaintenanceresponse;
|
||||
primarystorageToMidmenu(item, $midmenuItem1);
|
||||
primarystorageToRightPanel($midmenuItem1);
|
||||
$("#right_panel_content #after_action_info").text("We are actively cancelling your scheduled maintenance. Please refresh periodically for an updated status.");
|
||||
|
|
@ -134,10 +134,8 @@ var primarystorageActionMap = {
|
|||
isAsyncJob: false,
|
||||
dialogBeforeActionFn: doDeletePrimaryStorage,
|
||||
inProcessText: "Deleting Primary Storage....",
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
$midmenuItem1.slideUp("slow", function() {
|
||||
$(this).remove();
|
||||
});
|
||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||
$midmenuItem1.remove();
|
||||
clearRightPanel();
|
||||
primarystorageClearRightPanel();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -347,8 +347,10 @@ function initUpdateConsoleCertButton($midMenuAddLink2) {
|
|||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
$("body").stopTime(timerKey);
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
$("body").stopTime(timerKey);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -356,7 +358,9 @@ function initUpdateConsoleCertButton($midMenuAddLink2) {
|
|||
);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -476,7 +480,9 @@ function initAddZoneButton($midmenuAddLink1) {
|
|||
zoneJSONToTreeNode(item, template);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -96,8 +96,10 @@ function afterLoadServiceOfferingJSP() {
|
|||
afterAddingMidMenuItem($midmenuItem1, true);
|
||||
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInMidMenu(XMLHttpResponse, $midmenuItem1);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInMidMenu(XMLHttpResponse, $midmenuItem1);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ var systemVmActionMap = {
|
|||
asyncJobResponse: "startsystemvmresponse",
|
||||
inProcessText: "Starting System VM....",
|
||||
dialogBeforeActionFn : doStartSystemVM,
|
||||
afterActionSeccessFn: function(json, $leftmenuItem1, id) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.systemvm;
|
||||
afterActionSeccessFn: function(json, $leftmenuItem1, id) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.startsystemvmresponse;
|
||||
$leftmenuItem1.data("jsonObj", item);
|
||||
systemvmJsonToRightPanel($leftmenuItem1);
|
||||
}
|
||||
|
|
@ -102,7 +102,20 @@ var systemVmActionMap = {
|
|||
inProcessText: "Stopping System VM....",
|
||||
dialogBeforeActionFn : doStopSystemVM,
|
||||
afterActionSeccessFn: function(json, $leftmenuItem1, id) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.systemvm;
|
||||
//var item = json.queryasyncjobresultresponse.jobresult.stopsystemvmresponse; //waiting for Bug 6859 to be fixed ("The embedded object returned by StopSystemVM on success is not up-to-date. "state" property in the embedded object should be "Stopped" instead of "Running")
|
||||
var item;
|
||||
$.ajax({
|
||||
data: createURL("command=listSystemVms&id="+id),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listsystemvmsresponse.systemvm;
|
||||
if (items != null && items.length > 0) {
|
||||
item = items[0];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$leftmenuItem1.data("jsonObj", item);
|
||||
systemvmJsonToRightPanel($leftmenuItem1);
|
||||
}
|
||||
|
|
@ -113,7 +126,20 @@ var systemVmActionMap = {
|
|||
inProcessText: "Rebooting System VM....",
|
||||
dialogBeforeActionFn : doRebootSystemVM,
|
||||
afterActionSeccessFn: function(json, $leftmenuItem1, id) {
|
||||
var item = json.queryasyncjobresultresponse.jobresult.systemvm;
|
||||
//var item = json.queryasyncjobresultresponse.jobresult.rebootsystemvmresponse; //waiting for Bug 6860 to be fixed ("RebootSystemVM should return an embedded object on success")
|
||||
var item;
|
||||
$.ajax({
|
||||
data: createURL("command=listSystemVms&id="+id),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listsystemvmsresponse.systemvm;
|
||||
if (items != null && items.length > 0) {
|
||||
item = items[0];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$leftmenuItem1.data("jsonObj", item);
|
||||
systemvmJsonToRightPanel($leftmenuItem1);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,8 +105,10 @@ function afterLoadTemplateJSP() {
|
|||
}
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInMidMenu(XMLHttpResponse, $midmenuItem1);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInMidMenu(XMLHttpResponse, $midmenuItem1);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -218,8 +220,21 @@ function templateJsonToDetailsTab() {
|
|||
$thisTab.find("#tab_container").hide();
|
||||
$thisTab.find("#tab_spinning_wheel").show();
|
||||
|
||||
var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1");
|
||||
var jsonObj = $midmenuItem1.data("jsonObj");
|
||||
var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1");
|
||||
var id = $midmenuItem1.data("jsonObj").id;
|
||||
var zoneid = $midmenuItem1.data("jsonObj").zoneid;
|
||||
|
||||
var jsonObj;
|
||||
$.ajax({
|
||||
data: createURL("command=listTemplates&templatefilter=self&id="+id+"&zoneid="+zoneid),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listtemplatesresponse.template;
|
||||
if(items != null && items.length > 0)
|
||||
jsonObj = items[0];
|
||||
}
|
||||
});
|
||||
|
||||
$thisTab.data("jsonObj", jsonObj);
|
||||
$midmenuItem1.data("jsonObj", jsonObj);
|
||||
|
|
@ -245,13 +260,16 @@ function templateJsonToDetailsTab() {
|
|||
|
||||
setBooleanReadField(jsonObj.passwordenabled, $thisTab.find("#passwordenabled"));
|
||||
setBooleanEditField(jsonObj.passwordenabled, $thisTab.find("#passwordenabled_edit"));
|
||||
|
||||
//$thisTab.find("#passwordenabled_edit").val(jsonObj.passwordenabled);
|
||||
|
||||
setBooleanReadField(jsonObj.ispublic, $thisTab.find("#ispublic"));
|
||||
setBooleanEditField(jsonObj.ispublic, $thisTab.find("#ispublic_edit"));
|
||||
|
||||
//$thisTab.find("#ispublic_edit").val(jsonObj.ispublic);
|
||||
|
||||
setBooleanReadField(jsonObj.isfeatured, $thisTab.find("#isfeatured"));
|
||||
setBooleanEditField(jsonObj.isfeatured, $thisTab.find("#isfeatured_edit"));
|
||||
|
||||
//$thisTab.find("#isfeatured_edit").val(jsonObj.isfeatured);
|
||||
|
||||
setBooleanReadField(jsonObj.crossZones, $thisTab.find("#crossZones"));
|
||||
|
||||
$thisTab.find("#ostypename").text(fromdb(jsonObj.ostypename));
|
||||
|
|
|
|||
|
|
@ -121,14 +121,18 @@ function afterLoadVolumeJSP() {
|
|||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
$("body").stopTime(timerKey);
|
||||
afterAddingMidMenuItem($midmenuItem1, false);
|
||||
$("body").stopTime(timerKey);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
afterAddingMidMenuItem($midmenuItem1, false);
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 0);
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
afterAddingMidMenuItem($midmenuItem1, false);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
afterAddingMidMenuItem($midmenuItem1, false);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -417,14 +417,15 @@ function initAddVLANButton($addButton) {
|
|||
$template1.find("#vlan_type_icon").removeClass("virtual").addClass("direct");
|
||||
else //virtual
|
||||
$template1.find("#vlan_type_icon").removeClass("direct").addClass("virtual");
|
||||
|
||||
var item = json.createvlaniprangeresponse.vlan;
|
||||
vlanJsonToTemplate(item, $template1);
|
||||
|
||||
vlanJsonToTemplate(json.createvlaniprangeresponse.vlaniprange, $template1);
|
||||
$vlanContainer.prepend($template1);
|
||||
$template1.fadeIn("slow");
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -479,8 +480,10 @@ function initAddSecondaryStorageButton($addButton) {
|
|||
$subgridItem.find("#after_action_info_container").removeClass("error").addClass("success").show();
|
||||
$("#tab_content_secondarystorage").append($subgridItem.show());
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
error: function(XMLHttpResponse) {
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -562,7 +565,9 @@ function initAddPodButton($midmenuAddLink1) {
|
|||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
handleError(XMLHttpResponse, function() {
|
||||
handleErrorInDialog(XMLHttpResponse, $thisDialog);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue