Skip to content
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
2 changes: 1 addition & 1 deletion client/WEB-INF/classes/resources/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ label.smb.domain=SMB Domain
label.hypervisors=Hypervisors
label.home=Home
label.sockets=CPU Sockets
label.root.disk.size=Root disk size
label.root.disk.size=Root disk size (GB)
label.s3.nfs.server=S3 NFS Server
label.s3.nfs.path=S3 NFS Path
label.delete.events=Delete events
Expand Down
4 changes: 0 additions & 4 deletions ui/scripts/instanceWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,6 @@
hypervisors: hypervisorObjs
},
customHidden: function(args) {
////
return true; // Disabled -- not supported in backend right now
////

if (selectedTemplateOrIso == 'select-template') {
return false; //show Root Disk Size field
} else { //selectedTemplateOrIso == 'select-iso'
Expand Down
55 changes: 46 additions & 9 deletions ui/scripts/ui-custom/instanceWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,22 +419,59 @@
});
});

originalValues(formData);

var custom = args.customHidden({
context: context,
data: args.data
});

$step.find('.custom-size-label').remove();

if (!custom) {
$step.find('.section.custom-size').show();
$step.addClass('custom-disk-size');
} else {
if (custom) {
$step.find('.section.custom-size').hide();
$step.removeClass('custom-disk-size');
}

$step.find('input[type=radio]').bind('change', function() {
var $target = $(this);
var val = $target.val();
var item = null;
if (item == null) {
item = $.grep(args.data.templates.featuredtemplates, function(elem) {
return elem.id == val;
})[0];
}
if (item == null) {
item = $.grep(args.data.templates.communitytemplates, function(elem) {
return elem.id == val;
})[0];
}
if (item == null) {
item = $.grep(args.data.templates.mytemplates, function(elem) {
return elem.id == val;
})[0];
}
if (item == null) {
item = $.grep(args.data.templates.sharedtemplates, function(elem) {
return elem.id == val;
})[0];
}

if (!item) return true;

var hypervisor = item['hypervisor'];
if (hypervisor == 'KVM') {
$step.find('.section.custom-size').show();
$step.addClass('custom-disk-size');
} else {
$step.find('.section.custom-size').hide();
$step.removeClass('custom-disk-size');
}

return true;
});

originalValues(formData);

}
}
};
Expand Down Expand Up @@ -1271,9 +1308,9 @@
args.maxDiskOfferingSize() : 100;

// Setup tabs and slider
$wizard.find('.section.custom-size .size.min span').html(minCustomDiskSize);
$wizard.find('.section.custom-size input[type=text]').val(minCustomDiskSize);
$wizard.find('.section.custom-size .size.max span').html(maxCustomDiskSize);
$wizard.find('.section.custom-size.custom-disk-size .size.min span').html(minCustomDiskSize);
$wizard.find('.section.custom-size.custom-disk-size input[type=text]').val(minCustomDiskSize);
$wizard.find('.section.custom-size.custom-disk-size .size.max span').html(maxCustomDiskSize);
$wizard.find('.tab-view').tabs();
$wizard.find('.slider').each(function() {
var $slider = $(this);
Expand Down