mirror of https://github.com/apache/cloudstack.git
new UI - attach disk to VM dialog - make vm dropdown field required.
This commit is contained in:
parent
dd1a4af0b1
commit
4b3cfe2d71
|
|
@ -582,8 +582,8 @@
|
|||
<label for="volume_vm">
|
||||
Virtual Machine:</label>
|
||||
<select class="select" name="volume_vm" id="volume_vm">
|
||||
<option value="default">Please wait...</option>
|
||||
</select>
|
||||
<div id="volume_vm_errormsg" class="dialog_formcontent_errormsg" style="display: none;">
|
||||
</li>
|
||||
</ol>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -809,16 +809,18 @@ function doAttachDisk($actionLink, listAPIMap, $detailsTab) {
|
|||
|
||||
$("#dialog_attach_volume")
|
||||
.dialog('option', 'buttons', {
|
||||
"Confirm": function() {
|
||||
var thisDialog = $(this);
|
||||
thisDialog.dialog("close");
|
||||
"OK": function() {
|
||||
var $thisDialog = $(this);
|
||||
|
||||
var isValid = true;
|
||||
isValid &= validateDropDownBox("Virtual Machine", $thisDialog.find("#volume_vm"), $thisDialog.find("#volume_vm_errormsg"));
|
||||
if (!isValid)
|
||||
return;
|
||||
|
||||
$thisDialog.dialog("close");
|
||||
|
||||
var virtualMachineId = thisDialog.find("#volume_vm").val();
|
||||
if(virtualMachineId == null) {
|
||||
$("#dialog_alert").html("<p>Please attach volume to a valid virtual machine</p>").dialog("open");
|
||||
return;
|
||||
}
|
||||
|
||||
var virtualMachineId = $thisDialog.find("#volume_vm").val();
|
||||
|
||||
var id = jsonObj.id;
|
||||
var apiCommand = "command=attachVolume&id="+id+'&virtualMachineId='+virtualMachineId;
|
||||
doActionToDetailsTab(id, $actionLink, apiCommand, listAPIMap);
|
||||
|
|
|
|||
Loading…
Reference in New Issue