mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
new UI - fix a bug that action info (succeed or fail) didn't show on top of right panel after action was finished.
This commit is contained in:
parent
36fd8edb85
commit
d3fa609123
@ -14,7 +14,7 @@
|
|||||||
Accounts</h1>
|
Accounts</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -16,8 +16,9 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display:none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info"></p>
|
<p id="after_action_info">
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="tabbox" style="margin-top:15px;">
|
<div class="tabbox" style="margin-top:15px;">
|
||||||
<div class="content_tabs on">
|
<div class="content_tabs on">
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -16,8 +16,9 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display:none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info"></p>
|
<p id="after_action_info">
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="tabbox" style="margin-top:15px;">
|
<div class="tabbox" style="margin-top:15px;">
|
||||||
<div class="content_tabs on">
|
<div class="content_tabs on">
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="contentbox" id="right_panel_content">
|
<div class="contentbox" id="right_panel_content">
|
||||||
<div class="info_detailbox errorbox" id="after_action_info_container" style="display: none">
|
<div class="info_detailbox errorbox" id="after_action_info_container_on_top" style="display: none">
|
||||||
<p id="after_action_info">
|
<p id="after_action_info">
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -656,6 +656,7 @@ var vmActionMap = {
|
|||||||
api: "stopVirtualMachine",
|
api: "stopVirtualMachine",
|
||||||
isAsyncJob: true,
|
isAsyncJob: true,
|
||||||
asyncJobResponse: "stopvirtualmachineresponse",
|
asyncJobResponse: "stopvirtualmachineresponse",
|
||||||
|
inProcessText: "Stopping Instance....",
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
//call listVirtualMachine to get embedded object until bug 6486 ("StopVirtualMachine API should return an embedded object on success") is fixed.
|
//call listVirtualMachine to get embedded object until bug 6486 ("StopVirtualMachine API should return an embedded object on success") is fixed.
|
||||||
var jsonObj;
|
var jsonObj;
|
||||||
@ -676,8 +677,9 @@ var vmActionMap = {
|
|||||||
api: "startVirtualMachine",
|
api: "startVirtualMachine",
|
||||||
isAsyncJob: true,
|
isAsyncJob: true,
|
||||||
asyncJobResponse: "startvirtualmachineresponse",
|
asyncJobResponse: "startvirtualmachineresponse",
|
||||||
|
inProcessText: "Starting Instance....",
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
var jsonObj = json.queryasyncjobresultresponse.virtualmachine[0];
|
var jsonObj = json.queryasyncjobresultresponse.jobresult.startvirtualmachineresponse;
|
||||||
vmToMidmenu(jsonObj, $midmenuItem1);
|
vmToMidmenu(jsonObj, $midmenuItem1);
|
||||||
vmToRightPanel($midmenuItem1);
|
vmToRightPanel($midmenuItem1);
|
||||||
}
|
}
|
||||||
@ -686,6 +688,7 @@ var vmActionMap = {
|
|||||||
api: "rebootVirtualMachine",
|
api: "rebootVirtualMachine",
|
||||||
isAsyncJob: true,
|
isAsyncJob: true,
|
||||||
asyncJobResponse: "rebootvirtualmachineresponse",
|
asyncJobResponse: "rebootvirtualmachineresponse",
|
||||||
|
inProcessText: "Rebooting Instance....",
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
var jsonObj = json.queryasyncjobresultresponse.virtualmachine[0];
|
var jsonObj = json.queryasyncjobresultresponse.virtualmachine[0];
|
||||||
vmToMidmenu(jsonObj, $midmenuItem1);
|
vmToMidmenu(jsonObj, $midmenuItem1);
|
||||||
@ -696,6 +699,7 @@ var vmActionMap = {
|
|||||||
api: "destroyVirtualMachine",
|
api: "destroyVirtualMachine",
|
||||||
isAsyncJob: true,
|
isAsyncJob: true,
|
||||||
asyncJobResponse: "destroyvirtualmachineresponse",
|
asyncJobResponse: "destroyvirtualmachineresponse",
|
||||||
|
inProcessText: "Destroying Instance....",
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
//call listVirtualMachine to get embedded object until bug 6041 ("DestroyVirtualMachine API should return an embedded object on success") is fixed.
|
//call listVirtualMachine to get embedded object until bug 6041 ("DestroyVirtualMachine API should return an embedded object on success") is fixed.
|
||||||
var id = $midmenuItem1.data("jsonObj").id;
|
var id = $midmenuItem1.data("jsonObj").id;
|
||||||
@ -716,6 +720,7 @@ var vmActionMap = {
|
|||||||
"Restore Instance": {
|
"Restore Instance": {
|
||||||
api: "recoverVirtualMachine",
|
api: "recoverVirtualMachine",
|
||||||
isAsyncJob: false,
|
isAsyncJob: false,
|
||||||
|
inProcessText: "Restoring Instance....",
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
//call listVirtualMachine to get embedded object until bug 6037 ("RecoverVirtualMachine API should return an embedded object on success") is fixed.
|
//call listVirtualMachine to get embedded object until bug 6037 ("RecoverVirtualMachine API should return an embedded object on success") is fixed.
|
||||||
var id = $midmenuItem1.data("jsonObj").id;
|
var id = $midmenuItem1.data("jsonObj").id;
|
||||||
@ -735,7 +740,8 @@ var vmActionMap = {
|
|||||||
},
|
},
|
||||||
"Attach ISO": {
|
"Attach ISO": {
|
||||||
isAsyncJob: true,
|
isAsyncJob: true,
|
||||||
asyncJobResponse: "attachisoresponse",
|
asyncJobResponse: "attachisoresponse",
|
||||||
|
inProcessText: "Attaching ISO....",
|
||||||
dialogBeforeActionFn : doAttachISO,
|
dialogBeforeActionFn : doAttachISO,
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
//call listVirtualMachine to get embedded object until bug 6487 ("AttachISO API should return an embedded object on success") is fixed.
|
//call listVirtualMachine to get embedded object until bug 6487 ("AttachISO API should return an embedded object on success") is fixed.
|
||||||
@ -756,7 +762,8 @@ var vmActionMap = {
|
|||||||
},
|
},
|
||||||
"Detach ISO": {
|
"Detach ISO": {
|
||||||
isAsyncJob: true,
|
isAsyncJob: true,
|
||||||
asyncJobResponse: "detachisoresponse",
|
asyncJobResponse: "detachisoresponse",
|
||||||
|
inProcessText: "Detaching ISO....",
|
||||||
dialogBeforeActionFn : doDetachISO,
|
dialogBeforeActionFn : doDetachISO,
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
//call listVirtualMachine to get embedded object until bug 6488 ("Detach ISO API should return an embedded object on success") is fixed.
|
//call listVirtualMachine to get embedded object until bug 6488 ("Detach ISO API should return an embedded object on success") is fixed.
|
||||||
@ -779,7 +786,8 @@ var vmActionMap = {
|
|||||||
dialogBeforeActionFn : doResetPassword
|
dialogBeforeActionFn : doResetPassword
|
||||||
},
|
},
|
||||||
"Change Name": {
|
"Change Name": {
|
||||||
isAsyncJob: false,
|
isAsyncJob: false,
|
||||||
|
inProcessText: "Changing Name....",
|
||||||
dialogBeforeActionFn : doChangeName,
|
dialogBeforeActionFn : doChangeName,
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
//call listVirtualMachine to get embedded object until bug 6489 ("updateVirtualMachine API should return an embedded object on success") is fixed.
|
//call listVirtualMachine to get embedded object until bug 6489 ("updateVirtualMachine API should return an embedded object on success") is fixed.
|
||||||
@ -799,7 +807,8 @@ var vmActionMap = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Change Group": {
|
"Change Group": {
|
||||||
isAsyncJob: false,
|
isAsyncJob: false,
|
||||||
|
inProcessText: "Changing Group....",
|
||||||
dialogBeforeActionFn : doChangeGroup,
|
dialogBeforeActionFn : doChangeGroup,
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
//call listVirtualMachine to get embedded object until bug 6489 ("updateVirtualMachine API should return an embedded object on success") is fixed.
|
//call listVirtualMachine to get embedded object until bug 6489 ("updateVirtualMachine API should return an embedded object on success") is fixed.
|
||||||
@ -821,6 +830,7 @@ var vmActionMap = {
|
|||||||
"Change Service": {
|
"Change Service": {
|
||||||
isAsyncJob: true,
|
isAsyncJob: true,
|
||||||
asyncJobResponse: "changeserviceforvirtualmachineresponse",
|
asyncJobResponse: "changeserviceforvirtualmachineresponse",
|
||||||
|
inProcessText: "Changing Service....",
|
||||||
dialogBeforeActionFn : doChangeService,
|
dialogBeforeActionFn : doChangeService,
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
var jsonObj = json.queryasyncjobresultresponse.virtualmachine[0];
|
var jsonObj = json.queryasyncjobresultresponse.virtualmachine[0];
|
||||||
@ -829,7 +839,8 @@ var vmActionMap = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Enable HA": {
|
"Enable HA": {
|
||||||
isAsyncJob: false,
|
isAsyncJob: false,
|
||||||
|
inProcessText: "Enabling HA....",
|
||||||
dialogBeforeActionFn : doEnableHA,
|
dialogBeforeActionFn : doEnableHA,
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
//call listVirtualMachine to get embedded object until bug 6489 ("updateVirtualMachine API should return an embedded object on success") is fixed.
|
//call listVirtualMachine to get embedded object until bug 6489 ("updateVirtualMachine API should return an embedded object on success") is fixed.
|
||||||
@ -849,7 +860,8 @@ var vmActionMap = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Disable HA": {
|
"Disable HA": {
|
||||||
isAsyncJob: false,
|
isAsyncJob: false,
|
||||||
|
inProcessText: "Disabling HA....",
|
||||||
dialogBeforeActionFn : doDisableHA,
|
dialogBeforeActionFn : doDisableHA,
|
||||||
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
afterActionSeccessFn: function(json, $midmenuItem1, id) {
|
||||||
//call listVirtualMachine to get embedded object until bug 6489 ("updateVirtualMachine API should return an embedded object on success") is fixed.
|
//call listVirtualMachine to get embedded object until bug 6489 ("updateVirtualMachine API should return an embedded object on success") is fixed.
|
||||||
@ -985,9 +997,10 @@ function doResetPassword2(id, $midmenuItem1) {
|
|||||||
$midmenuItem1.find("#content").removeClass("inaction");
|
$midmenuItem1.find("#content").removeClass("inaction");
|
||||||
$midmenuItem1.find("#spinning_wheel").hide();
|
$midmenuItem1.find("#spinning_wheel").hide();
|
||||||
if (result.jobstatus == 1) { // Succeeded
|
if (result.jobstatus == 1) { // Succeeded
|
||||||
$midmenuItem1.find("#info_icon").removeClass("error").show();
|
$midmenuItem1.find("#info_icon").removeClass("error").show();
|
||||||
$midmenuItem1.find("#second_row").text("New password: " + result.virtualmachine[0].password);
|
var item = result.jobresult.resetpasswordforvirtualmachineresponse;
|
||||||
var afterActionInfo = "Your password has been successfully resetted. Your new password is : " + result.virtualmachine[0].password;
|
$midmenuItem1.find("#second_row").text("New password: " + item.password);
|
||||||
|
var afterActionInfo = "Your password has been successfully resetted. Your new password is : " + item.password;
|
||||||
$midmenuItem1.data("afterActionInfo", afterActionInfo);
|
$midmenuItem1.data("afterActionInfo", afterActionInfo);
|
||||||
} else if (result.jobstatus == 2) { // Failed
|
} else if (result.jobstatus == 2) { // Failed
|
||||||
$midmenuItem1.find("#info_icon").addClass("error").show();
|
$midmenuItem1.find("#info_icon").addClass("error").show();
|
||||||
@ -1174,6 +1187,8 @@ function vmToRightPanel($midmenuItem1) {
|
|||||||
var vmName = getVmName(jsonObj.name, jsonObj.displayname);
|
var vmName = getVmName(jsonObj.name, jsonObj.displayname);
|
||||||
$("right_panel_header").find("#vm_name").text(vmName);
|
$("right_panel_header").find("#vm_name").text(vmName);
|
||||||
|
|
||||||
|
//Comment the following code which is for middle menu action, not details tab action.
|
||||||
|
/*
|
||||||
var $rightPanelContent = $("#right_panel_content");
|
var $rightPanelContent = $("#right_panel_content");
|
||||||
if($midmenuItem1.find("#info_icon").css("display") != "none") {
|
if($midmenuItem1.find("#info_icon").css("display") != "none") {
|
||||||
$rightPanelContent.find("#after_action_info").text($midmenuItem1.data("afterActionInfo"));
|
$rightPanelContent.find("#after_action_info").text($midmenuItem1.data("afterActionInfo"));
|
||||||
@ -1187,6 +1202,7 @@ function vmToRightPanel($midmenuItem1) {
|
|||||||
$rightPanelContent.find("#after_action_info").text("");
|
$rightPanelContent.find("#after_action_info").text("");
|
||||||
$rightPanelContent.find("#after_action_info_container").hide();
|
$rightPanelContent.find("#after_action_info_container").hide();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
vmJsonToDetailsTab($midmenuItem1);
|
vmJsonToDetailsTab($midmenuItem1);
|
||||||
vmJsonToVolumeTab(jsonObj);
|
vmJsonToVolumeTab(jsonObj);
|
||||||
|
|||||||
@ -58,7 +58,9 @@ function doActionToDetailsTab(id, $actionLink, apiCommand, $midmenuItem1, $detai
|
|||||||
var $spinningWheel = $detailsTab.find("#spinning_wheel");
|
var $spinningWheel = $detailsTab.find("#spinning_wheel");
|
||||||
$spinningWheel.find("#description").text(inProcessText);
|
$spinningWheel.find("#description").text(inProcessText);
|
||||||
$spinningWheel.show();
|
$spinningWheel.show();
|
||||||
$("#right_panel_content #after_action_info_container").removeClass("errorbox").hide();
|
|
||||||
|
var $afterActionInfoContainer = $("#right_panel_content #after_action_info_container_on_top");
|
||||||
|
$afterActionInfoContainer.removeClass("errorbox").hide();
|
||||||
|
|
||||||
//Async job (begin) *****
|
//Async job (begin) *****
|
||||||
if(isAsyncJob == true) {
|
if(isAsyncJob == true) {
|
||||||
@ -81,20 +83,20 @@ function doActionToDetailsTab(id, $actionLink, apiCommand, $midmenuItem1, $detai
|
|||||||
return; //Job has not completed
|
return; //Job has not completed
|
||||||
} else {
|
} else {
|
||||||
$("body").stopTime(timerKey);
|
$("body").stopTime(timerKey);
|
||||||
$spinningWheel.hide();
|
$spinningWheel.hide();
|
||||||
if (result.jobstatus == 1) { // Succeeded
|
if (result.jobstatus == 1) { // Succeeded
|
||||||
$("#right_panel_content #after_action_info").text(label + " action succeeded.");
|
$afterActionInfoContainer.find("#after_action_info").text(label + " action succeeded.");
|
||||||
$("#right_panel_content #after_action_info_container").removeClass("errorbox").show();
|
$afterActionInfoContainer.removeClass("errorbox").show();
|
||||||
afterActionSeccessFn(json, $midmenuItem1, id);
|
afterActionSeccessFn(json, $midmenuItem1, id);
|
||||||
} else if (result.jobstatus == 2) { // Failed
|
} else if (result.jobstatus == 2) { // Failed
|
||||||
$("#right_panel_content #after_action_info").text(label + " action failed. Reason: " + fromdb(result.jobresult));
|
$afterActionInfoContainer.find("#after_action_info").text(label + " action failed. Reason: " + fromdb(result.jobresult));
|
||||||
$("#right_panel_content #after_action_info_container").addClass("errorbox").show();
|
$afterActionInfoContainer.addClass("errorbox").show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(XMLHttpResponse) {
|
error: function(XMLHttpResponse) {
|
||||||
$("body").stopTime(timerKey);
|
$("body").stopTime(timerKey);
|
||||||
handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label);
|
handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label, $afterActionInfoContainer);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -102,7 +104,7 @@ function doActionToDetailsTab(id, $actionLink, apiCommand, $midmenuItem1, $detai
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
error: function(XMLHttpResponse) {
|
error: function(XMLHttpResponse) {
|
||||||
handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label);
|
handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label, $afterActionInfoContainer);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -116,19 +118,19 @@ function doActionToDetailsTab(id, $actionLink, apiCommand, $midmenuItem1, $detai
|
|||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
$spinningWheel.hide();
|
$spinningWheel.hide();
|
||||||
$("#right_panel_content #after_action_info").text(label + " action succeeded.");
|
$afterActionInfoContainer.find("#after_action_info").text(label + " action succeeded.");
|
||||||
$("#right_panel_content #after_action_info_container").removeClass("errorbox").show();
|
$afterActionInfoContainer.removeClass("errorbox").show();
|
||||||
afterActionSeccessFn(json, $midmenuItem1, id);
|
afterActionSeccessFn(json, $midmenuItem1, id);
|
||||||
},
|
},
|
||||||
error: function(XMLHttpResponse) {
|
error: function(XMLHttpResponse) {
|
||||||
handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label);
|
handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label, $afterActionInfoContainer);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//Sync job (end) *****
|
//Sync job (end) *****
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label) {
|
function handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label, $afterActionInfoContainer) {
|
||||||
$detailsTab.find("#spinning_wheel").hide();
|
$detailsTab.find("#spinning_wheel").hide();
|
||||||
|
|
||||||
var errorMsg = "";
|
var errorMsg = "";
|
||||||
@ -136,12 +138,13 @@ function handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label) {
|
|||||||
var start = XMLHttpResponse.responseText.indexOf("h1") + 3;
|
var start = XMLHttpResponse.responseText.indexOf("h1") + 3;
|
||||||
var end = XMLHttpResponse.responseText.indexOf("</h1");
|
var end = XMLHttpResponse.responseText.indexOf("</h1");
|
||||||
errorMsg = XMLHttpResponse.responseText.substring(start, end);
|
errorMsg = XMLHttpResponse.responseText.substring(start, end);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(errorMsg.length > 0)
|
if(errorMsg.length > 0)
|
||||||
$("#right_panel_content #after_action_info").text(label + " action failed. Reason: " + fromdb(errorMsg));
|
$afterActionInfoContainer.find("#after_action_info").text(label + " action failed. Reason: " + fromdb(errorMsg));
|
||||||
else
|
else
|
||||||
$("#right_panel_content #after_action_info").text(label + " action failed.");
|
$afterActionInfoContainer.find("#after_action_info").text(label + " action failed.");
|
||||||
$("#right_panel_content #after_action_info_container").addClass("errorbox").show();
|
$afterActionInfoContainer.addClass("errorbox").show();
|
||||||
}
|
}
|
||||||
//***** actions for details tab in right panel (end) **************************************************************************
|
//***** actions for details tab in right panel (end) **************************************************************************
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user