Module: ForemanBootdisk::SubnetsHelperExt
- Includes:
- BootdiskLinksHelper
- Defined in:
- app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb
Instance Method Summary
collapse
#bootdisk_authorized_for, #bootdisk_help_link, #bootdisk_title_action_buttons, #bootdisk_url, #display_bootdisk_link_if_authorized, #divider
Instance Method Details
#display_bootdisk_for_subnet(subnet) ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb', line 7
def display_bootdisk_for_subnet(subnet)
if (proxy = subnet.tftp || subnet.httpboot) && proxy.has_feature?('Templates') && Setting::Bootdisk.allowed_types.include?('subnet')
display_bootdisk_link_if_authorized(
_("Subnet generic image"), {
controller: 'foreman_bootdisk/subnet_disks',
action: 'subnet',
id: subnet.id
},
class: 'la'
)
else
''
end
end
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'app/helpers/concerns/foreman_bootdisk/subnets_helper_ext.rb', line 22
def display_bootdisk_title_buttons
actions = []
generic_image_link = display_bootdisk_link_if_authorized(
_('Generic image'),
{
controller: 'foreman_bootdisk/disks',
action: 'generic'
},
class: 'la'
)
if Setting::Bootdisk.allowed_types&.include?('generic')
actions << generic_image_link
actions << divider
end
actions << bootdisk_help_link
bootdisk_title_action_buttons(actions)
end
|