mirror of https://github.com/apache/cloudstack.git
new UI - instance page - volume tab - show different action link for each volume depending on volume type and vm state.
This commit is contained in:
parent
15a6631a87
commit
37d82c8aa7
|
|
@ -100,11 +100,11 @@ $(document).ready(function() {
|
|||
|
||||
|
||||
$("#action_link").bind("mouseover", function(event) {
|
||||
$("#action_menu").show();
|
||||
$(this).find("#action_menu").show();
|
||||
return false;
|
||||
});
|
||||
$("#action_link").bind("mouseout", function(event) {
|
||||
$("#action_menu").hide();
|
||||
$(this).find("#action_menu").hide();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -445,11 +445,11 @@ function clickInstanceGroupHeader($arrowIcon) {
|
|||
setDateField(json.created, template.find("#created"));
|
||||
|
||||
if(json.type=="ROOT") { //"create template" is allowed(when stopped), "detach disk" is disallowed.
|
||||
//if (json.vmstate == "Stopped")
|
||||
buildActionLink("Create Template", volumeActionMap, $("#volume_action_menu"), volumeListAPIMap);
|
||||
if (json.vmstate == "Stopped")
|
||||
buildActionLink("Create Template", volumeActionMap, template.find("#volume_action_menu"), volumeListAPIMap);
|
||||
}
|
||||
else { //json.type=="DATADISK": "detach disk" is allowed, "create template" is disallowed.
|
||||
buildActionLink("Detach Disk", volumeActionMap, $("#volume_action_menu"), volumeListAPIMap);
|
||||
buildActionLink("Detach Disk", volumeActionMap, template.find("#volume_action_menu"), volumeListAPIMap);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1203,11 +1203,11 @@ function clickInstanceGroupHeader($arrowIcon) {
|
|||
|
||||
//***** Volume tab (begin) *****************************************************************************
|
||||
$("#volume_action_link").bind("mouseover", function(event) {
|
||||
$("#volume_action_menu").show();
|
||||
$(this).find("#volume_action_menu").show();
|
||||
return false;
|
||||
});
|
||||
$("#volume_action_link").bind("mouseout", function(event) {
|
||||
$("#volume_action_menu").hide();
|
||||
$(this).find("#volume_action_menu").hide();
|
||||
return false;
|
||||
});
|
||||
//***** Volume tab (end) *******************************************************************************
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ function doCreateTemplate($t, selectedItemIds, listAPIMap) {
|
|||
var password = thisDialog.find("#create_template_password").val();
|
||||
|
||||
for(var id in selectedItemIds) {
|
||||
var apiCommand = "command=createTemplate&volumeId="+id+"&name="+encodeURIComponent(name)+"&displayText="+encodeURIComponent(desc)+"&osTypeId="+osType+"&isPublic="+isPublic+"&passwordEnabled="+password;
|
||||
doAction(id, $t, apiCommand, listAPIMap);
|
||||
var apiCommand = "command=createTemplate&volumeId="+id+"&name="+encodeURIComponent(name)+"&displayText="+encodeURIComponent(desc)+"&osTypeId="+osType+"&isPublic="+isPublic+"&passwordEnabled="+password;
|
||||
doAction(id, $t, apiCommand, listAPIMap);
|
||||
}
|
||||
},
|
||||
"Cancel": function() {
|
||||
|
|
|
|||
|
|
@ -274,8 +274,10 @@ function showStorageTab(domainId, targetTab) {
|
|||
setDateField(json.created, template.find("#volume_created"));
|
||||
|
||||
if(json.type=="ROOT") {
|
||||
} else {
|
||||
// DataDisk
|
||||
if (json.vmstate == "Stopped")
|
||||
template.find("#volume_action_create_template_span").show();
|
||||
}
|
||||
else { //json.type=="DATADISK": "detach disk" is allowed, "create template" is disallowed.
|
||||
if (json.virtualmachineid != undefined) {
|
||||
if (json.storagetype == "shared" && (json.vmstate == "Running" || json.vmstate == "Stopped")) {
|
||||
template.find("#volume_action_detach_span").show();
|
||||
|
|
|
|||
Loading…
Reference in New Issue