mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
new UI - clear right panel after deleting a volume.
This commit is contained in:
parent
50c319e19b
commit
8dcea8c07e
@ -137,7 +137,10 @@ function doActionToDetailsTab(id, $actionLink, apiCommand, listAPIMap) {
|
||||
async: false,
|
||||
success: function(json) {
|
||||
$spinningWheel.hide();
|
||||
$detailsTab.find("#action_message_box #description").text(label + " action succeeded.");
|
||||
$detailsTab.find("#action_message_box").removeClass("error").show();
|
||||
|
||||
if(apiCommand.indexOf("command=delete")!=0) {
|
||||
//RecoverVirtualMachine API doesn't return an embedded object on success (Bug 6037)
|
||||
//Before Bug 6037 get fixed, use the temporary solution below.
|
||||
$.ajax({
|
||||
@ -146,14 +149,15 @@ function doActionToDetailsTab(id, $actionLink, apiCommand, listAPIMap) {
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
$detailsTab.find("#action_message_box #description").text(label + " action succeeded.");
|
||||
$detailsTab.find("#action_message_box").removeClass("error").show();
|
||||
|
||||
afterActionSeccessFn(json[listAPIResponse][listAPIResponseObj][0]);
|
||||
}
|
||||
});
|
||||
//After Bug 6037 is fixed, remove temporary solution above and uncomment the line below
|
||||
//afterActionSeccessFn(json[listAPIResponse][listAPIResponseObj][0]);
|
||||
}
|
||||
else { //apiCommand is deleteXXXXXXX
|
||||
afterActionSeccessFn(id);
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
handleErrorInDetailsTab(XMLHttpResponse, $detailsTab, label);
|
||||
@ -540,6 +544,7 @@ function clearMiddleMenu() {
|
||||
|
||||
function clearRightPanel() {
|
||||
$("#right_panel_content #action_message_box").hide();
|
||||
$("#right_panel_content #tab_content_details #action_link #action_menu #action_list").empty();
|
||||
}
|
||||
|
||||
var selected_leftmenu_id = null;
|
||||
|
||||
@ -99,6 +99,21 @@ function volumeJsonToDetailsTab(jsonObj){
|
||||
*/
|
||||
}
|
||||
|
||||
function volumeClearRightPanel() {
|
||||
var $detailsTab = $("#right_panel_content #tab_content_details");
|
||||
$detailsTab.find("#id").text("");
|
||||
$detailsTab.find("#name").text("");
|
||||
$detailsTab.find("#zonename").text("");
|
||||
$detailsTab.find("#device_id").text("");
|
||||
$detailsTab.find("#state").text("");
|
||||
$detailsTab.find("#storage").text("");
|
||||
$detailsTab.find("#account").text("");
|
||||
$detailsTab.find("#type").text("");
|
||||
$detailsTab.find("#size").text("");
|
||||
$detailsTab.find("#vm_name").text("");
|
||||
$detailsTab.find("#created").text("");
|
||||
}
|
||||
|
||||
var volumeActionMap = {
|
||||
"Detach Disk": {
|
||||
api: "detachVolume",
|
||||
@ -118,7 +133,12 @@ var volumeActionMap = {
|
||||
api: "deleteVolume",
|
||||
isAsyncJob: false,
|
||||
inProcessText: "Deleting volume....",
|
||||
afterActionSeccessFn: function(){}
|
||||
afterActionSeccessFn: function(id) {
|
||||
var $midmenuItem1 = $("#midmenuItem_"+id);
|
||||
$midmenuItem1.remove();
|
||||
clearRightPanel();
|
||||
volumeClearRightPanel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user