mirror of https://github.com/apache/cloudstack.git
new UI - instances tab - implement change group action.
This commit is contained in:
parent
2e6c22d706
commit
2fce7a1c35
|
|
@ -615,7 +615,7 @@ long milliseconds = new Date().getTime();
|
|||
<div class="grid_headertitles">
|
||||
Name</div>
|
||||
</div>
|
||||
<div class="grid_genheader_cell" style="width: 15%;">
|
||||
<div class="grid_genheader_cell" style="width: 13%;">
|
||||
<div class="grid_headertitles">
|
||||
Type</div>
|
||||
</div>
|
||||
|
|
@ -707,7 +707,7 @@ long milliseconds = new Date().getTime();
|
|||
<div class="netgrid_celltitles" id="volume_name">
|
||||
Name</div>
|
||||
</div>
|
||||
<div class="grid_smallgenrow_cell" style="width: 15%;">
|
||||
<div class="grid_smallgenrow_cell" style="width: 13%;">
|
||||
<div class="netgrid_celltitles" id="volume_type">
|
||||
Type</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -676,4 +676,24 @@
|
|||
</ol>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Change Group Dialog -->
|
||||
<div id="dialog_change_group" title="Change Group" style="display:none">
|
||||
<p>
|
||||
Please specify the new group you want to assign to your Virtual Instance. If no such group exists, a new one will be created
|
||||
for you.</p>
|
||||
<div class="dialog_formcontent">
|
||||
<form action="#" method="post" id="form_acquire">
|
||||
<ol>
|
||||
<li>
|
||||
<label for="change_group_name">
|
||||
Group Name:</label>
|
||||
<input class="text" type="text" name="change_group_name" id="change_group_name" />
|
||||
<div id="change_group_name_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||
</div>
|
||||
</li>
|
||||
</ol>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -79,7 +79,12 @@ function clickInstanceGroupHeader($arrowIcon) {
|
|||
asyncJobResponse: "changeserviceforvirtualmachineresponse",
|
||||
dialogBeforeActionFn : doChangeService,
|
||||
afterActionSeccessFn: setMidmenuItemVm
|
||||
}
|
||||
},
|
||||
"Change Group": {
|
||||
isAsyncJob: false,
|
||||
dialogBeforeActionFn : doChangeGroup,
|
||||
afterActionSeccessFn: setMidmenuItemVm
|
||||
}
|
||||
}
|
||||
|
||||
function doAttachISO($t, selectedItemIds, listAPIMap) {
|
||||
|
|
@ -231,8 +236,33 @@ function clickInstanceGroupHeader($arrowIcon) {
|
|||
$(this).dialog("close");
|
||||
}
|
||||
}).dialog("open");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function doChangeGroup($t, selectedItemIds, listAPIMap) {
|
||||
$("#dialog_change_group")
|
||||
.dialog('option', 'buttons', {
|
||||
"Confirm": function() {
|
||||
var thisDialog = $(this);
|
||||
thisDialog.dialog("close");
|
||||
|
||||
// validate values
|
||||
var isValid = true;
|
||||
isValid &= validateString("Group", thisDialog.find("#change_group_name"), thisDialog.find("#change_group_name_errormsg"), true); //group name is optional
|
||||
if (!isValid) return;
|
||||
|
||||
for(var id in selectedItemIds) {
|
||||
var $midMenuItem = selectedItemIds[id];
|
||||
var jsonObj = $midMenuItem.data("jsonObj");
|
||||
var group = trim(thisDialog.find("#change_group_name").val());
|
||||
var apiCommand = "command=updateVirtualMachine&id="+id+"&group="+encodeURIComponent(group);
|
||||
doAction(id, $t, apiCommand, listAPIMap);
|
||||
}
|
||||
},
|
||||
"Cancel": function() {
|
||||
$(this).dialog("close");
|
||||
}
|
||||
}).dialog("open");
|
||||
}
|
||||
|
||||
function updateVirtualMachineStateInRightPanel(state) {
|
||||
if(state == "Running")
|
||||
|
|
@ -447,6 +477,12 @@ function clickInstanceGroupHeader($arrowIcon) {
|
|||
zIndex: 2000
|
||||
}));
|
||||
|
||||
activateDialog($("#dialog_change_group").dialog({
|
||||
autoOpen: false,
|
||||
modal: true,
|
||||
zIndex: 2000
|
||||
}));
|
||||
|
||||
//***** VM Wizard (begin) ******************************************************************************
|
||||
$vmPopup = $("#vm_popup");
|
||||
var $serviceOfferingTemplate = $("#vm_popup_service_offering_template");
|
||||
|
|
|
|||
Loading…
Reference in New Issue