mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-20 11:52:37 +09:00
feature #4238: Set required fields for all ds_mad
This commit is contained in:
1 parent
62d4faf68b
commit
cd99e2e608
1 file changed
+14
-20
@@ -110,10 +110,12 @@ define(function(require) {
|
||||
'input[name="ds_tab_custom_tm_mad"]', dialog).parent().hide();
|
||||
|
||||
$('select#ds_mad', dialog).change(function() {
|
||||
if ($(this).val() == "custom")
|
||||
if ($(this).val() == "custom") {
|
||||
$('input[name="ds_tab_custom_ds_mad"]', dialog).parent().show();
|
||||
else
|
||||
$('input[name="ds_tab_custom_ds_mad"]', dialog).parent().hide();
|
||||
} else {
|
||||
_setRequiredFields(dialog, $(this).val());
|
||||
$('input[name="ds_tab_custom_ds_mad"]', dialog).parent().hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('select#tm_mad', dialog).change(function() {
|
||||
@@ -136,35 +138,27 @@ define(function(require) {
|
||||
{
|
||||
case 'fs':
|
||||
_selectFilesystem(dialog);
|
||||
// _setRequiredFields(dialog, '');
|
||||
break;
|
||||
case 'vmware_vmfs':
|
||||
_selectVmwareVmfs(dialog);
|
||||
_setRequiredFields(dialog, 'vmfs');
|
||||
break;
|
||||
case 'block_lvm':
|
||||
_selectBlockLvm(dialog);
|
||||
_setRequiredFields(dialog, 'lvm');
|
||||
break;
|
||||
case 'fs_lvm':
|
||||
_selectFsLvm(dialog);
|
||||
// _setRequiredFields(dialog, '');
|
||||
break;
|
||||
case 'ceph':
|
||||
_selectCeph(dialog);
|
||||
_setRequiredFields(dialog, 'ceph');
|
||||
break;
|
||||
case 'gluster':
|
||||
_selectGluster(dialog);
|
||||
// _setRequiredFields(dialog, '');
|
||||
break;
|
||||
case 'dev':
|
||||
_selectDevices(dialog);
|
||||
_setRequiredFields(dialog, 'dev');
|
||||
break;
|
||||
case 'iscsi':
|
||||
_selectISCSI(dialog);
|
||||
_setRequiredFields(dialog, 'iscsi');
|
||||
break;
|
||||
case 'custom':
|
||||
_selectCustom(dialog);
|
||||
@@ -360,7 +354,7 @@ define(function(require) {
|
||||
}
|
||||
|
||||
function _selectFilesystem(dialog) {
|
||||
$('select#ds_mad', dialog).val('fs');
|
||||
$('select#ds_mad', dialog).val('fs').change();
|
||||
$('select#tm_mad', dialog).val('shared');
|
||||
$('select#ds_mad', dialog).attr('disabled', 'disabled');
|
||||
$('select#tm_mad', dialog).children('option').each(function() {
|
||||
@@ -389,7 +383,7 @@ define(function(require) {
|
||||
function _selectVmwareVmfs(dialog) {
|
||||
$('label[for="bridge_list"],input#bridge_list', dialog).parent().fadeIn();
|
||||
$('label[for="ds_tmp_dir"],input#ds_tmp_dir', dialog).parent().fadeIn();
|
||||
$('select#ds_mad', dialog).val('vmfs');
|
||||
$('select#ds_mad', dialog).val('vmfs').change();
|
||||
$('select#ds_mad', dialog).attr('disabled', 'disabled');
|
||||
$('select#tm_mad', dialog).val('vmfs');
|
||||
$('select#tm_mad', dialog).attr('disabled', 'disabled');
|
||||
@@ -407,7 +401,7 @@ define(function(require) {
|
||||
function _selectCeph(dialog) {
|
||||
$('input#image_ds_type', dialog).click();
|
||||
$('input#file_ds_type', dialog).attr('disabled', 'disabled');
|
||||
$('select#ds_mad', dialog).val('ceph');
|
||||
$('select#ds_mad', dialog).val('ceph').change();
|
||||
$('select#ds_mad', dialog).attr('disabled', 'disabled');
|
||||
$('select#tm_mad', dialog).val('ceph');
|
||||
$('select#tm_mad', dialog).attr('disabled', 'disabled');
|
||||
@@ -431,7 +425,7 @@ define(function(require) {
|
||||
}
|
||||
|
||||
function _selectBlockLvm(dialog) {
|
||||
$('select#ds_mad', dialog).val('lvm');
|
||||
$('select#ds_mad', dialog).val('lvm').change();
|
||||
$('select#ds_mad', dialog).attr('disabled', 'disabled');
|
||||
$('select#tm_mad', dialog).val('lvm');
|
||||
$('select#tm_mad', dialog).attr('disabled', 'disabled');
|
||||
@@ -451,7 +445,7 @@ define(function(require) {
|
||||
}
|
||||
|
||||
function _selectFsLvm(dialog) {
|
||||
$('select#ds_mad', dialog).val('fs');
|
||||
$('select#ds_mad', dialog).val('fs').change();
|
||||
$('select#ds_mad', dialog).attr('disabled', 'disabled');
|
||||
$('select#tm_mad', dialog).val('fs_lvm');
|
||||
$('select#tm_mad', dialog).attr('disabled', 'disabled');
|
||||
@@ -469,7 +463,7 @@ define(function(require) {
|
||||
}
|
||||
|
||||
function _selectGluster(dialog) {
|
||||
$('select#ds_mad', dialog).val('fs');
|
||||
$('select#ds_mad', dialog).val('fs').change();
|
||||
$('select#ds_mad', dialog).attr('disabled', 'disabled');
|
||||
$('select#tm_mad', dialog).val('shared');
|
||||
$('select#tm_mad', dialog).children('option').each(function() {
|
||||
@@ -496,7 +490,7 @@ define(function(require) {
|
||||
}
|
||||
|
||||
function _selectDevices(dialog) {
|
||||
$('select#ds_mad', dialog).val('dev');
|
||||
$('select#ds_mad', dialog).val('dev').change();
|
||||
$('select#ds_mad', dialog).attr('disabled', 'disabled');
|
||||
$('select#tm_mad', dialog).val('dev');
|
||||
$('select#tm_mad', dialog).attr('disabled', 'disabled');
|
||||
@@ -514,7 +508,7 @@ define(function(require) {
|
||||
}
|
||||
|
||||
function _selectISCSI(dialog) {
|
||||
$('select#ds_mad', dialog).val('iscsi');
|
||||
$('select#ds_mad', dialog).val('iscsi').change();
|
||||
$('select#ds_mad', dialog).attr('disabled', 'disabled');
|
||||
$('select#tm_mad', dialog).val('iscsi');
|
||||
$('select#tm_mad', dialog).attr('disabled', 'disabled');
|
||||
@@ -536,7 +530,7 @@ define(function(require) {
|
||||
|
||||
function _selectCustom(dialog) {
|
||||
_hideAll(dialog);
|
||||
$('select#ds_mad', dialog).val('fs');
|
||||
$('select#ds_mad', dialog).val('fs').change();
|
||||
$('select#tm_mad', dialog).val('shared');
|
||||
$('input#safe_dirs', dialog).removeAttr('disabled');
|
||||
$('select#disk_type', dialog).removeAttr('disabled');
|
||||
|
||||
Reference in new issue
Block a user