Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach disk #233

Merged
merged 6 commits into from
Mar 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,21 @@
<label for="vcenter_password">{{tr "Password"}}</label>
<input type="password" name="vcenter_password" id="vcenter_password" required />
</div>
<div class="large-2 medium-6 columns">
<div class="large-5 medium-6 columns">
<label>{{tr "Datastore"}}</label>
<div id="vcenter_datastore_wrapper"/>
</div>
<div class="large-3 medium-6 columns">
<label>&nbsp;</label>
<button type="submit" class="button radius">
{{tr "Get Images"}}
</button>
</div>
<div class="row">
<div style="float:right">
<label>&nbsp;</label>
<button type="submit" class="button radius">
{{tr "Get Images"}}
</button>
</div>
</div>
</form>
<div class="row collapse">
{{{vCenterImagesHTML}}}
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,25 @@
<label for="TYPE">
{{tr "Disk type"}}
</label>
<select wizard_field="TYPE" id="TYPE" name="type">
<select class="hypervisor only_kvm" wizard_field="TYPE" id="TYPE" name="type">
<option value="fs">{{tr "FS"}}</option>
<option value="swap">{{tr "Swap"}}</option>
</select>
<select class="hypervisor only_vcenter" style="display: none" wizard_field="TYPE" id="TYPE" name="type">
<option value="fs">{{tr "FS"}}</option>
</select>
</div>
<div class="medium-6 columns">
<label for="FORMAT">
{{tr "Filesystem format"}}
</label>
<select wizard_field="FORMAT" name="format" id="FORMAT">
<select class="hypervisor only_kvm" wizard_field="FORMAT" name="format" id="FORMAT">
<option value="raw" selected="selected">raw</option>
<option value="qcow2">qcow2</option>
</select>
<select class="hypervisor only_vcenter" style="display: none" wizard_field="FORMAT" name="format" id="FORMAT">
<option value="raw" selected="selected">raw</option>
</select>
</div>
</div>
<br>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="row">
<div class="medium-6 columns">
<div class="medium-6 columns hypervisor only_kvm">
<label for="TARGET">
{{tr "Target device"}}
{{{tip (tr "Device to map image disk. If set, it will overwrite the default device mapping.")}}}
Expand All @@ -20,7 +20,7 @@
</div>
</div>
<div class="row">
<div class="medium-6 columns">
<div class="medium-6 columns hypervisor only_kvm">
<label>
{{tr "BUS"}}
<select id="disk_dev_prefix" name="disk_dev_prefix">
Expand All @@ -35,7 +35,7 @@
<input type="text" id="custom_disk_dev_prefix" name="custom_disk_dev_prefix" />
</div>
</div>
<div class="medium-6 columns">
<div class="medium-6 columns hypervisor only_kvm">
<label for="READONLY">
{{tr "Read-only"}}
</label>
Expand All @@ -45,6 +45,30 @@
<option value="no">{{tr "no"}}</option>
</select>
</div>
<div class="medium-6 columns hypervisor only_vcenter">
<label for="vcenter_adapter_type">
{{tr "Bus adapter controller"}}
</label>
<select wizard_field="VCENTER_ADAPTER_TYPE" name="vcenter_adapter_type" id="vcenter_adapter_type">
<option value="" selected="selected"></option>
<option value="lsiLogic">lsiLogic</option>
<option value="ide">ide</option>
<option value="busLogic">busLogic</option>
<option value="custom">custom</option>
</select>
</div>
<div class="medium-6 columns only_vcenter">
<label for="vcenter_disk_type">
{{tr "Disk provisioning type"}}
</label>
<select wizard_field="VCENTER_DISK_TYPE" name="vcenter_disk_type" id="vcenter_disk_type">
<option value="" selected="selected"></option>
<option value="thin">Thin</option>
<option value="thick">Thick</option>
<option value="eagerZeroedThick">Eager Zeroed Thick</option>
<option value="custom">custom</option>
</select>
</div>
</div>
<div class="row vm_param">
<div class="medium-6 columns hypervisor only_kvm">
Expand Down
7 changes: 5 additions & 2 deletions src/sunstone/public/app/tabs/vms-tab/panels/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,10 @@ define(function(require) {
context.on('click', '#attach_disk', function() {
var dialog = Sunstone.getDialog(ATTACH_DISK_DIALOG_ID);
dialog.setElement(that.element);
if(that.element.USER_TEMPLATE.HYPERVISOR && that.element.USER_TEMPLATE.HYPERVISOR == 'venter'){
$('.hypervisor.only_kvm').hide();
$('.hypervisor.only_vcenter').show();
}
dialog.show();
return false;
});
Expand All @@ -445,7 +449,6 @@ define(function(require) {
context.off('click', '.detachdisk');
context.on('click', '.detachdisk', function() {
var disk_id = $(this).parents('tr').attr('disk_id');

Sunstone.getDialog(CONFIRM_DIALOG_ID).setParams({
//header :
headerTabId: TAB_ID,
Expand Down Expand Up @@ -596,7 +599,7 @@ define(function(require) {
return false;
});
}

Tree.setup(context);
}

Expand Down