CLOUDSTACK-85: Fix instance wizard review hypervisor

Fix hypervisor type not being shown in instance wizard review step
This commit is contained in:
Brian Federle 2012-09-18 14:18:48 -07:00
parent 2abeac11c7
commit 93c84c8291
2 changed files with 47 additions and 20 deletions

View File

@ -136,6 +136,9 @@ under the License.
<li class="last"><a href="#instance-wizard-my-templates"><fmt:message key="label.my.templates"/></a></li>
</ul>
<!-- Used for Select Template only -->
<input type="hidden" wizard-field="hypervisor" name="hypervisor" value="" disabled="disabled"/>
<div id="instance-wizard-featured-templates">
<div class="select-container">
</div>

View File

@ -264,6 +264,25 @@
}, {
'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') {
// Create hypervisor select
@ -639,7 +658,10 @@
var field = $(this).attr('wizard-field');
var fieldName;
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')) {
@ -660,6 +682,8 @@
if (index != 0) fieldName += '<br />';
fieldName += $(this).next('div.select-desc').find('.name').html();
});
} else if ($input.is('input[type=hidden]')) {
fieldName = $input.val();
}
if (fieldName) {