Class: UIAcdController
Overview
Controller to create JSON data to be used in react app
Instance Method Summary
collapse
#collect_host_report_data
Instance Method Details
#action_permission ⇒ Object
29
30
31
32
33
34
35
36
|
# File 'app/controllers/ui_acd_controller.rb', line 29
def action_permission
case params[:action]
when 'app', 'foreman_data', 'ansible_data', 'validate_hostname'
:view
else
super
end
end
|
#ansible_data ⇒ Object
17
18
19
|
# File 'app/controllers/ui_acd_controller.rb', line 17
def ansible_data
@ansible_data = collect_ansible_data(params['id'])
end
|
#app ⇒ Object
7
8
9
10
11
|
# File 'app/controllers/ui_acd_controller.rb', line 7
def app
@app_data = {}
app_definition = ForemanAcd::AppDefinition.find(params[:id])
@app_data['app_definition'] = app_definition
end
|
#foreman_data ⇒ Object
13
14
15
|
# File 'app/controllers/ui_acd_controller.rb', line 13
def foreman_data
@foreman_data = collect_foreman_data(params['id'])
end
|
#report_data ⇒ Object
21
22
23
|
# File 'app/controllers/ui_acd_controller.rb', line 21
def report_data
@report_data = collect_report_data(params['id'])
end
|
#validate_hostname ⇒ Object
25
26
27
|
# File 'app/controllers/ui_acd_controller.rb', line 25
def validate_hostname
@host_validation = hostname_duplicate?(params['appDefId'].to_i, params['serviceId'].to_i, params['hostname'])
end
|