mirror of https://github.com/apache/cloudstack.git
new UI - VM Change Service Offering - pass vmId to listServiceOffering if only one item (VM) is selected in middle menu.
This commit is contained in:
parent
b369103a87
commit
a0f75f34c1
|
|
@ -51,6 +51,7 @@ no.available.iso = No Available ISO
|
|||
your.session.has.expired = Your session has expired
|
||||
internet.name.can.not.be.resolved = Internet name can not be resolved
|
||||
management.server.is.not.accessible = Management server is not accessible
|
||||
please.select.at.least.one.item.in.middle.menu = Please select at least one item in middle menu
|
||||
please.confirm.you.want.to.detach.an.iso.from.the.virtual.machine = Please confirm you want to detach an ISO from the virtual machine
|
||||
please.specify.the.iso.you.wish.to.attach.to.virtual.machine = Please specify the ISO you wish to attach to virtual instance
|
||||
please.specify.the.new.name.you.want.to.change.for.the.virtual.machine = Please specify the new name you want to change for the virtual instance
|
||||
|
|
|
|||
|
|
@ -554,7 +554,7 @@ long milliseconds = new Date().getTime();
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Dialogs -->
|
||||
<!-- Dialogs 1 -->
|
||||
<div id="dialog_confirmation" title="Confirmation" style="display:none"></div>
|
||||
<div id="dialog_info" title="Info" style="display:none"></div>
|
||||
<div id="dialog_alert" title="Alert" style="display:none"></div>
|
||||
|
|
@ -577,6 +577,12 @@ long milliseconds = new Date().getTime();
|
|||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Dialogs 2 -->
|
||||
<div id="dialog_info_please_select_one_item_in_middle_menu" title="Info" style="display:none">
|
||||
<p>
|
||||
<%=t.t("please.select.at.least.one.item.in.middle.menu")%>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- templates starts here-->
|
||||
<div class="leftmenu_content" id="leftmenu_submenu_template" style="display: none">
|
||||
|
|
|
|||
|
|
@ -405,7 +405,15 @@ $(document).ready(function() {
|
|||
});
|
||||
$("#dialog_session_expired").siblings(".ui-widget-header").css("background", "url('/client/css/images/ui-bg_errorglass_30_ffffff_1x400.png') repeat-x scroll 50% 50% #393939");
|
||||
$("#dialog_session_expired").siblings(".ui-dialog-buttonpane").find(".ui-state-default").css("background", "url('/client/css/images/ui-bg_errorglass_30_ffffff_1x400.png') repeat-x scroll 50% 50% #393939");
|
||||
|
||||
$("#dialog_info_please_select_one_item_in_middle_menu").dialog({
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
zIndex: 2000,
|
||||
buttons: { "OK": function() { $(this).dialog("close"); } }
|
||||
});
|
||||
|
||||
/*
|
||||
$("#dialog_server_error").dialog({
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
|
|
@ -414,6 +422,7 @@ $(document).ready(function() {
|
|||
});
|
||||
$("#dialog_server_error").siblings(".ui-widget-header").css("background", "url('/client/css/images/ui-bg_errorglass_30_ffffff_1x400.png') repeat-x scroll 50% 50% #393939");
|
||||
$("#dialog_server_error").siblings(".ui-dialog-buttonpane").find(".ui-state-default").css("background", "url('/client/css/images/ui-bg_errorglass_30_ffffff_1x400.png') repeat-x scroll 50% 50% #393939");
|
||||
*/
|
||||
|
||||
// Menu Tabs
|
||||
$("#global_nav").bind("click", function(event) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ function clickInstanceGroupHeader($arrowIcon) {
|
|||
initDialog("dialog_attach_iso");
|
||||
initDialog("dialog_change_name");
|
||||
initDialog("dialog_change_group");
|
||||
initDialog("dialog_change_service_offering");
|
||||
initDialog("dialog_change_service_offering", 600);
|
||||
initDialog("dialog_confirmation_change_root_password");
|
||||
initDialog("dialog_confirmation_enable_ha");
|
||||
initDialog("dialog_confirmation_disable_ha");
|
||||
|
|
@ -732,6 +732,11 @@ var vmActionMap = {
|
|||
isAsyncJob: false,
|
||||
dialogBeforeActionFn : doChangeName,
|
||||
afterActionSeccessFn: vmToMidmenu
|
||||
},
|
||||
"Change Group": {
|
||||
isAsyncJob: false,
|
||||
dialogBeforeActionFn : doChangeGroup,
|
||||
afterActionSeccessFn: vmToMidmenu
|
||||
},
|
||||
"Change Service": {
|
||||
isAsyncJob: true,
|
||||
|
|
@ -739,11 +744,6 @@ var vmActionMap = {
|
|||
dialogBeforeActionFn : doChangeService,
|
||||
afterActionSeccessFn: vmToMidmenu
|
||||
},
|
||||
"Change Group": {
|
||||
isAsyncJob: false,
|
||||
dialogBeforeActionFn : doChangeGroup,
|
||||
afterActionSeccessFn: vmToMidmenu
|
||||
},
|
||||
"Enable HA": {
|
||||
isAsyncJob: false,
|
||||
dialogBeforeActionFn : doEnableHA,
|
||||
|
|
@ -921,10 +921,31 @@ function doChangeName($t, selectedItemsInMidMenu, vmListAPIMap) {
|
|||
}).dialog("open");
|
||||
}
|
||||
|
||||
function doChangeService($t, selectedItemsInMidMenu, vmListAPIMap) {
|
||||
$.ajax({
|
||||
//data: createURL("command=listServiceOfferings&VirtualMachineId="+vmId), //can not specifiy VirtualMachineId since we allow multiple-item-selection.
|
||||
data: createURL("command=listServiceOfferings"), //can not specifiy VirtualMachineId since we support multiple-item-selection.
|
||||
function doChangeService($t, selectedItemsInMidMenu, vmListAPIMap) {
|
||||
var itemCounts = 0;
|
||||
for(var id in selectedItemsInMidMenu) {
|
||||
itemCounts ++;
|
||||
}
|
||||
|
||||
var apiText;
|
||||
if(itemCounts == 0) {
|
||||
$("#dialog_info_please_select_one_item_in_middle_menu").dialog("open");
|
||||
return;
|
||||
}
|
||||
else if(itemCounts == 1){
|
||||
var firstItemId;
|
||||
for(var id in selectedItemsInMidMenu) {
|
||||
firstItemId = id;
|
||||
break;
|
||||
}
|
||||
apiText = "command=listServiceOfferings&VirtualMachineId="+firstItemId;
|
||||
}
|
||||
else {
|
||||
apiText = "command=listServiceOfferings";
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
data: createURL(apiText),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var offerings = json.listserviceofferingsresponse.serviceoffering;
|
||||
|
|
|
|||
Loading…
Reference in New Issue