mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
new UI - volume page - implement take snapshot action.
This commit is contained in:
parent
d07cac932a
commit
f89e11bb21
@ -218,3 +218,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Create Snapshot Dialog (begin) -->
|
||||||
|
<div id="dialog_create_snapshot" title="Create Snapshot" style="display: none">
|
||||||
|
<p>
|
||||||
|
Please confirm you want to create snapshot for this volume.</p>
|
||||||
|
</div>
|
||||||
|
<!-- Create Snapshot Dialog (end) -->
|
||||||
|
|||||||
@ -5,7 +5,11 @@ function afterLoadVolumeJSP() {
|
|||||||
modal: true,
|
modal: true,
|
||||||
zIndex: 2000
|
zIndex: 2000
|
||||||
}));
|
}));
|
||||||
|
activateDialog($("#dialog_create_snapshot").dialog({
|
||||||
|
autoOpen: false,
|
||||||
|
modal: true,
|
||||||
|
zIndex: 2000
|
||||||
|
}));
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: createURL("command=listOsTypes&response=json"),
|
data: createURL("command=listOsTypes&response=json"),
|
||||||
@ -68,7 +72,7 @@ function volumeJsonToDetailsTab(jsonObj){
|
|||||||
var $actionMenu = $("#right_panel_content #tab_content_details #action_link #action_menu");
|
var $actionMenu = $("#right_panel_content #tab_content_details #action_link #action_menu");
|
||||||
$actionMenu.find("#action_list").empty();
|
$actionMenu.find("#action_list").empty();
|
||||||
|
|
||||||
//buildActionLinkForDetailsTab("Take Snapshot", volumeActionMap, $actionMenu, volumeListAPIMap); //show take snapshot
|
buildActionLinkForDetailsTab("Take Snapshot", volumeActionMap, $actionMenu, volumeListAPIMap); //show take snapshot
|
||||||
//buildActionLinkForDetailsTab("Recurring Snapshot", volumeActionMap, $actionMenu, volumeListAPIMap); //show Recurring Snapshot
|
//buildActionLinkForDetailsTab("Recurring Snapshot", volumeActionMap, $actionMenu, volumeListAPIMap); //show Recurring Snapshot
|
||||||
|
|
||||||
if(jsonObj.state != "Creating" && jsonObj.state != "Corrupted" && jsonObj.name != "attaching") {
|
if(jsonObj.state != "Creating" && jsonObj.state != "Corrupted" && jsonObj.name != "attaching") {
|
||||||
@ -134,7 +138,14 @@ var volumeActionMap = {
|
|||||||
clearRightPanel();
|
clearRightPanel();
|
||||||
volumeClearRightPanel();
|
volumeClearRightPanel();
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"Take Snapshot": {
|
||||||
|
isAsyncJob: true,
|
||||||
|
asyncJobResponse: "createsnapshotresponse",
|
||||||
|
dialogBeforeActionFn : doTakeSnapshot,
|
||||||
|
inProcessText: "Taking Snapshot....",
|
||||||
|
afterActionSeccessFn: function(){}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var volumeListAPIMap = {
|
var volumeListAPIMap = {
|
||||||
@ -173,4 +184,20 @@ function doCreateTemplateFromVolume($actionLink, listAPIMap, $detailsTab) {
|
|||||||
$(this).dialog("close");
|
$(this).dialog("close");
|
||||||
}
|
}
|
||||||
}).dialog("open");
|
}).dialog("open");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doTakeSnapshot($actionLink, listAPIMap, $detailsTab) {
|
||||||
|
$("#dialog_create_snapshot")
|
||||||
|
.dialog('option', 'buttons', {
|
||||||
|
"Confirm": function() {
|
||||||
|
$(this).dialog("close");
|
||||||
|
|
||||||
|
var id = $detailsTab.data("jsonObj").id;
|
||||||
|
var apiCommand = "command=createSnapshot&volumeid="+id;
|
||||||
|
doActionToDetailsTab(id, $actionLink, apiCommand, listAPIMap);
|
||||||
|
},
|
||||||
|
"Cancel": function() {
|
||||||
|
$(this).dialog("close");
|
||||||
|
}
|
||||||
|
}).dialog("open");
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user