mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-30 22:50:10 +03:00
feature #4186: Add vCenter datastore creation in Sunstone
This commit is contained in:
parent
b367f18474
commit
2095faaa00
@ -161,6 +161,9 @@ define(function(require) {
|
||||
case 'iscsi':
|
||||
_selectISCSI(dialog);
|
||||
break;
|
||||
case 'vcenter':
|
||||
_selectvCenter(dialog);
|
||||
break;
|
||||
case 'custom':
|
||||
_selectCustom(dialog);
|
||||
break;
|
||||
@ -210,6 +213,7 @@ define(function(require) {
|
||||
var iscsi_host = $('#iscsi_host', dialog).val();
|
||||
var iscsi_user = $('#iscsi_user', dialog).val();
|
||||
var iscsi_usage = $('#iscsi_usage', dialog).val();
|
||||
var vcenter_cluster = $('#vcenter_cluster', dialog).val();
|
||||
|
||||
var ds_obj = {
|
||||
"datastore" : {
|
||||
@ -292,6 +296,9 @@ define(function(require) {
|
||||
if (iscsi_usage)
|
||||
ds_obj.datastore.iscsi_usage = iscsi_usage;
|
||||
|
||||
if (vcenter_cluster)
|
||||
ds_obj.datastore.vcenter_cluster = vcenter_cluster;
|
||||
|
||||
Sunstone.runAction("Datastore.create", ds_obj);
|
||||
return false;
|
||||
}
|
||||
@ -338,6 +345,7 @@ define(function(require) {
|
||||
$('label[for="iscsi_host"],input#iscsi_host', dialog).parent().hide();
|
||||
$('label[for="iscsi_user"],input#iscsi_user', dialog).parent().hide();
|
||||
$('label[for="iscsi_usage"],input#iscsi_usage', dialog).parent().hide();
|
||||
$('label[for="vcenter_cluster"],input#vcenter_cluster', dialog).parent().hide();
|
||||
$('label[for="limit_transfer_bw"],input#limit_transfer_bw', dialog).parent().hide();
|
||||
$('label[for="no_decompress"],input#no_decompress', dialog).parent().hide();
|
||||
$('select#ds_mad', dialog).removeAttr('disabled');
|
||||
@ -511,6 +519,25 @@ define(function(require) {
|
||||
$('input#restricted_dirs', dialog).attr('disabled', 'disabled');
|
||||
}
|
||||
|
||||
function _selectvCenter(dialog) {
|
||||
$('select#ds_mad', dialog).val('vcenter').change();
|
||||
$('select#ds_mad', dialog).attr('disabled', 'disabled');
|
||||
$('select#tm_mad', dialog).val('vcenter');
|
||||
$('select#tm_mad', dialog).attr('disabled', 'disabled');
|
||||
$('input#image_ds_type', dialog).click();
|
||||
$('input[name=ds_type]', dialog).attr('disabled', 'disabled');
|
||||
$('select#disk_type', dialog).val('block');
|
||||
$('select#disk_type', dialog).attr('disabled', 'disabled');
|
||||
$('label[for="limit_transfer_bw"],input#limit_transfer_bw', dialog).parent().hide();
|
||||
$('label[for="no_decompress"],input#no_decompress', dialog).parent().hide();
|
||||
$('label[for="datastore_capacity_check"],input#datastore_capacity_check', dialog).parent().hide();
|
||||
$('input#safe_dirs', dialog).attr('disabled', 'disabled');
|
||||
$('input#base_path', dialog).attr('disabled', 'disabled');
|
||||
$('input#limit_mb', dialog).attr('disabled', 'disabled');
|
||||
$('input#restricted_dirs', dialog).attr('disabled', 'disabled');
|
||||
$('label[for="vcenter_cluster"],input#vcenter_cluster', dialog).parent().fadeIn();
|
||||
}
|
||||
|
||||
function _selectCustom(dialog) {
|
||||
_hideAll(dialog);
|
||||
$('select#ds_mad', dialog).val('fs').change();
|
||||
|
@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<p>{{tr "Write the Virtual Network template here"}}</p>
|
||||
<p>{{tr "Write the Datastore template here"}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -32,6 +32,7 @@
|
||||
<option value="gluster">{{tr "Gluster"}}</option>
|
||||
<option value="dev">{{tr "Devices"}}</option>
|
||||
<option value="iscsi">{{tr "iSCSI"}}</option>
|
||||
<option value="vcenter">{{tr "vCenter"}}</option>
|
||||
<option value="custom">{{tr "Custom"}}</option>
|
||||
</select>
|
||||
</div>
|
||||
@ -67,6 +68,7 @@
|
||||
<option value="ceph">{{tr "Ceph"}}</option>
|
||||
<option value="dev">{{tr "Devices"}}</option>
|
||||
<option value="iscsi">{{tr "iSCSI"}}</option>
|
||||
<option value="vcenter">{{tr "vCenter"}}</option>
|
||||
<option value="custom">{{tr "Custom"}}</option>
|
||||
</select>
|
||||
<div>
|
||||
@ -85,6 +87,7 @@
|
||||
<option value="ceph">{{tr "Ceph"}}</option>
|
||||
<option value="dev">{{tr "Devices"}}</option>
|
||||
<option value="iscsi">{{tr "iSCSI"}}</option>
|
||||
<option value="vcenter">{{tr "vCenter"}}</option>
|
||||
<option value="custom">{{tr "Custom"}}</option>
|
||||
</select>
|
||||
<div>
|
||||
@ -285,5 +288,14 @@
|
||||
</label>
|
||||
<input type="text" name="iscsi_usage" id="iscsi_usage" />
|
||||
</div>
|
||||
<div class="medium-6 columns">
|
||||
<label for="vceter_cluster">
|
||||
{{tr "vCenter Cluster"}}
|
||||
<span class="tip">
|
||||
{{tr "The vCenter Cluster that has access to this datastore."}}
|
||||
</span>
|
||||
</label>
|
||||
<input type="text" name="vcenter_cluster" id="vcenter_cluster" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
Loading…
x
Reference in New Issue
Block a user