<% arch ||= nil os ||= nil images = possible_images(compute_resource, arch, os) resource_groups = compute_resource.resource_groups %> <% #This view has been modified and wraps the properties of azure_vm # using fields_for rails method. %> <%= f.fields_for :azure_vm do |vm_f| %> <%= selectable_f vm_f, :location, compute_resource.regions, { :include_blank => _('Please select an Azure region') }, { :label => _('Azure Region'), :required => true, :id => 'azure_rm_region', :label_size => "col-md-2", :onchange => 'azure_rm_region_callback();', :help_inline => spinner_button_f(f, _('Reload Images, Sizes, vNets'), 'azure_rm_region_callback();', { :id => 'load_subnets_btn', :spinner_id => 'load_subnets_indicator', :class => 'btn-success', :spinner_class => 'spinner-inverse' }) } %> <%= selectable_f vm_f, :resource_group, resource_groups, { :include_blank => true }, { :disabled => resource_groups.empty?, :label => _('Resource Group'), :required => true, :id => 'azure_rm_rg' } %> <%= selectable_f vm_f, :vm_size, [], { :include_blank => _('Please first select an Azure region') }, { :label => _('VM Size'), :required => true, :id => 'azure_rm_size' } %> <%= selectable_f vm_f, :platform, %w(Linux Windows), {}, { :label => _('Platform'), :required => true } %> <%= text_f vm_f, :username, { :label => _('Username'), :required => true } %> <%= password_f vm_f, :password, { :label => _('Password'), :required => true, :placeholder => "********" } %> <%= textarea_f vm_f, :ssh_key_data, { :label => _('SSH Key') } %> <%= checkbox_f vm_f, :premium_os_disk, { :label => _('Premium OS Disk'), :label_size => "col-md-2" }, 'true', 'false' %> <%= selectable_f vm_f, :os_disk_caching, %w(None ReadOnly ReadWrite), {}, { :label => _('OS Disk Caching'), :required => true, :class => "col-md-2" } %> <%= text_f vm_f, :script_command, { :label => _('Custom Script Command'), :help_inline => _("To perform commands as root, prefix it with 'sudo'.") } %> <%= text_f vm_f, :script_uris, { :label => _('Comma seperated file URIs') } %> <% end %>
<%= select_f f, :image_id, images, :uuid, :name, { :include_blank => (images.empty? or images.size == 1) ? false : _('Please select an image') }, { :disabled => images.empty?, :label => _('Image'), :required => true, :label_size => "col-md-2", :id => 'azure_rm_image_id' } %>