mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-85: Fix instance wizard review hypervisor
Fix hypervisor type not being shown in instance wizard review step
This commit is contained in:
parent
2abeac11c7
commit
93c84c8291
@ -136,6 +136,9 @@ under the License.
|
|||||||
<li class="last"><a href="#instance-wizard-my-templates"><fmt:message key="label.my.templates"/></a></li>
|
<li class="last"><a href="#instance-wizard-my-templates"><fmt:message key="label.my.templates"/></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<!-- Used for Select Template only -->
|
||||||
|
<input type="hidden" wizard-field="hypervisor" name="hypervisor" value="" disabled="disabled"/>
|
||||||
|
|
||||||
<div id="instance-wizard-featured-templates">
|
<div id="instance-wizard-featured-templates">
|
||||||
<div class="select-container">
|
<div class="select-container">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -264,6 +264,25 @@
|
|||||||
}, {
|
}, {
|
||||||
'wizard-field': 'template'
|
'wizard-field': 'template'
|
||||||
});
|
});
|
||||||
|
var $templateHypervisor = $step.find('input[type=hidden][wizard-field=hypervisor]');
|
||||||
|
|
||||||
|
// Get hypervisor from template
|
||||||
|
if (type == 'featuredtemplates' || type == 'communitytemplates' || type == 'mytemplates') {
|
||||||
|
$selects.each(function() {
|
||||||
|
var $select = $(this);
|
||||||
|
var template = $.grep(args.data.templates[type], function(tmpl, v) {
|
||||||
|
return tmpl.id == $select.find('input').val();
|
||||||
|
})[0];
|
||||||
|
|
||||||
|
$select.change(function() {
|
||||||
|
$templateHypervisor
|
||||||
|
.attr('disabled', false)
|
||||||
|
.val(template.hypervisor);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$templateHypervisor.attr('disabled', 'disabled');
|
||||||
|
}
|
||||||
|
|
||||||
if (type == 'featuredisos' || type == 'communityisos' || type == 'myisos') {
|
if (type == 'featuredisos' || type == 'communityisos' || type == 'myisos') {
|
||||||
// Create hypervisor select
|
// Create hypervisor select
|
||||||
@ -635,45 +654,50 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
'review': function($step, formData) {
|
'review': function($step, formData) {
|
||||||
$step.find('[wizard-field]').each(function() {
|
$step.find('[wizard-field]').each(function() {
|
||||||
var field = $(this).attr('wizard-field');
|
var field = $(this).attr('wizard-field');
|
||||||
var fieldName;
|
var fieldName;
|
||||||
var $input = $wizard.find('[wizard-field=' + field + ']').filter(function() {
|
var $input = $wizard.find('[wizard-field=' + field + ']').filter(function() {
|
||||||
return $(this).is(':selected') || $(this).is(':checked');
|
return ($(this).is(':selected') ||
|
||||||
});
|
$(this).is(':checked') ||
|
||||||
|
$(this).attr('type') == 'hidden') &&
|
||||||
|
$(this).is(':not(:disabled)');
|
||||||
|
});
|
||||||
|
|
||||||
if ($input.is('option')) {
|
if ($input.is('option')) {
|
||||||
fieldName = $input.html();
|
fieldName = $input.html();
|
||||||
} else if ($input.is('input[type=radio]')) {
|
} else if ($input.is('input[type=radio]')) {
|
||||||
// Choosen New network as default
|
// Choosen New network as default
|
||||||
if ($input.parents('div.new-network').size()) {
|
if ($input.parents('div.new-network').size()) {
|
||||||
fieldName = $input.closest('div.new-network').find('input[name="new-network-name"]').val();
|
fieldName = $input.closest('div.new-network').find('input[name="new-network-name"]').val();
|
||||||
// Choosen Network from existed
|
// Choosen Network from existed
|
||||||
} else if ($input.parents('div.my-networks').size()) {
|
} else if ($input.parents('div.my-networks').size()) {
|
||||||
fieldName = $input.closest('div.select').find('.select-desc .name').html();
|
fieldName = $input.closest('div.select').find('.select-desc .name').html();
|
||||||
} else {
|
} else {
|
||||||
fieldName = $input.parent().find('.select-desc .name').html();
|
fieldName = $input.parent().find('.select-desc .name').html();
|
||||||
}
|
}
|
||||||
} else if ($input.eq(0).is('input[type=checkbox]')) {
|
} else if ($input.eq(0).is('input[type=checkbox]')) {
|
||||||
fieldName = '';
|
fieldName = '';
|
||||||
$input.each(function(index) {
|
$input.each(function(index) {
|
||||||
if (index != 0) fieldName += '<br />';
|
if (index != 0) fieldName += '<br />';
|
||||||
fieldName += $(this).next('div.select-desc').find('.name').html();
|
fieldName += $(this).next('div.select-desc').find('.name').html();
|
||||||
});
|
});
|
||||||
|
} else if ($input.is('input[type=hidden]')) {
|
||||||
|
fieldName = $input.val();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fieldName) {
|
if (fieldName) {
|
||||||
$(this).html(fieldName);
|
$(this).html(fieldName);
|
||||||
} else {
|
} else {
|
||||||
$(this).html('(' + _l('label.none') + ')');
|
$(this).html('(' + _l('label.none') + ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
var conditionalFieldFrom = $(this).attr('conditional-field');
|
var conditionalFieldFrom = $(this).attr('conditional-field');
|
||||||
if (conditionalFieldFrom) {
|
if (conditionalFieldFrom) {
|
||||||
if ($wizard.find('.'+conditionalFieldFrom).css('display') == 'block') {
|
if ($wizard.find('.'+conditionalFieldFrom).css('display') == 'block') {
|
||||||
$(this).closest('div.select').show();
|
$(this).closest('div.select').show();
|
||||||
} else {
|
} else {
|
||||||
$(this).closest('div.select').hide();
|
$(this).closest('div.select').hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user