Module: AzureImagesHelper

Defined in:
app/helpers/azure_images_helper.rb

Instance Method Summary collapse

Instance Method Details

#select_azure_image(f, images) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/helpers/azure_images_helper.rb', line 2

def select_azure_image(f, images)
  select_f(
    f,
    :image_id,
    images,
    :uuid,
    :name,
    { :include_blank => (images.empty? || images.size == 1) ? false : _('Please select an image') },
    :label => ('Image'),
    :disabled => images.empty?,
    :class => 'without_select2',
    :'data-url' => '/azure/locations',
    :onclick => 'azure_image_selected();',
    :onchange => 'azure_image_selected();')
end

#select_azure_region(f) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'app/helpers/azure_images_helper.rb', line 18

def select_azure_region(f)
  selectable_f(
    f,
    :location, [],
    { :include_blank => _('Choose an operating system and image first') },
    :label => _('Azure location'),
    :class => 'without_select2',
    :id => 'azure_locations',
    :help_inline => refresh_button + spinner_indicator)
end

#select_cloud_service(f, cloud_services) ⇒ Object



45
46
47
48
49
50
51
# File 'app/helpers/azure_images_helper.rb', line 45

def select_cloud_service(f, cloud_services)
  selectable_f(
    f,
    :cloud_service_name, cloud_services.map(&:name),
    { :include_blank => _('Defaults to VM name') },
    :label => _('Cloud service name'))
end

#select_role_size(f, role_sizes) ⇒ Object



37
38
39
40
41
42
43
# File 'app/helpers/azure_images_helper.rb', line 37

def select_role_size(f, role_sizes)
  selectable_f(
    f,
    :vm_size, role_sizes,
    {},
    :label => _('Role size'))
end

#select_storage_account(f, accounts) ⇒ Object



29
30
31
32
33
34
35
# File 'app/helpers/azure_images_helper.rb', line 29

def (f, accounts)
  selectable_f(
    f,
    :storage_account_name, accounts.map(&:name),
    { :include_blank => _('None') },
    :label => _('Storage account'))
end