foreman_remote_execution 18.0.1 → 18.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/foreman_remote_execution/locale/fr/foreman_remote_execution.js +28 -28
  3. data/app/assets/javascripts/foreman_remote_execution/locale/ja/foreman_remote_execution.js +48 -48
  4. data/app/assets/javascripts/foreman_remote_execution/locale/ko/foreman_remote_execution.js +29 -29
  5. data/app/assets/javascripts/foreman_remote_execution/locale/zh_CN/foreman_remote_execution.js +22 -22
  6. data/app/assets/javascripts/foreman_remote_execution/template_invocation.js +0 -170
  7. data/app/assets/stylesheets/foreman_remote_execution/job_invocations.scss +0 -6
  8. data/app/controllers/job_invocations_controller.rb +1 -98
  9. data/app/helpers/job_invocations_helper.rb +0 -49
  10. data/app/helpers/remote_execution_helper.rb +23 -123
  11. data/config/routes.rb +0 -6
  12. data/lib/foreman_remote_execution/plugin.rb +2 -2
  13. data/lib/foreman_remote_execution/version.rb +1 -1
  14. data/locale/foreman_remote_execution.pot +2 -2
  15. data/locale/fr/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  16. data/locale/fr/foreman_remote_execution.po +28 -28
  17. data/locale/ja/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  18. data/locale/ja/foreman_remote_execution.po +48 -48
  19. data/locale/ko/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  20. data/locale/ko/foreman_remote_execution.po +29 -29
  21. data/locale/zh_CN/LC_MESSAGES/foreman_remote_execution.mo +0 -0
  22. data/locale/zh_CN/foreman_remote_execution.po +22 -22
  23. data/package.json +1 -14
  24. data/test/functional/job_invocations_controller_test.rb +0 -77
  25. data/webpack/JobInvocationDetail/JobInvocationConstants.js +5 -0
  26. data/webpack/JobInvocationDetail/JobInvocationToolbarButtons.js +0 -10
  27. data/webpack/JobInvocationDetail/TemplateInvocation.js +12 -69
  28. data/webpack/JobInvocationDetail/TemplateInvocationComponents/OutputCodeBlock.js +94 -72
  29. data/webpack/JobInvocationDetail/TemplateInvocationHelpers.js +33 -0
  30. data/webpack/JobInvocationDetail/__tests__/JobInvocationDetailEmptyState.test.js +1 -1
  31. data/webpack/JobInvocationDetail/__tests__/MainInformation.test.js +0 -6
  32. data/webpack/JobInvocationDetail/__tests__/OutputCodeBlock.test.js +1 -1
  33. data/webpack/JobInvocationDetail/__tests__/TableToolbarActions.test.js +1 -1
  34. data/webpack/JobInvocationDetail/__tests__/TemplateInvocation.test.js +5 -1
  35. data/webpack/JobInvocationDetail/__tests__/TemplateInvocationHelpers.test.js +94 -0
  36. data/webpack/JobInvocationDetail/__tests__/TemplateInvocationPolling.test.js +338 -139
  37. data/webpack/JobInvocationDetail/useTemplateInvocationOutputPolling.js +185 -0
  38. data/webpack/JobWizard/JobWizardPageRerun.js +0 -10
  39. data/webpack/JobWizard/__tests__/autofill.test.js +23 -0
  40. data/webpack/JobWizard/__tests__/integration.test.js +1 -1
  41. data/webpack/JobWizard/autofill.js +18 -4
  42. data/webpack/JobWizard/index.js +1 -18
  43. data/webpack/JobWizard/steps/HostsAndInputs/__tests__/HostsAndInputs.test.js +49 -1
  44. data/webpack/global_index.js +0 -2
  45. data/webpack/index.js +0 -15
  46. data/webpack/react_app/components/RegistrationExtension/__tests__/RexInterface.test.js +1 -1
  47. metadata +6 -53
  48. data/app/assets/stylesheets/foreman_remote_execution/modal_window.scss +0 -4
  49. data/app/helpers/job_invocations_chart_helper.rb +0 -80
  50. data/app/views/job_invocations/_card_results.html.erb +0 -12
  51. data/app/views/job_invocations/_card_schedule.html.erb +0 -33
  52. data/app/views/job_invocations/_card_target_hosts.html.erb +0 -57
  53. data/app/views/job_invocations/_card_user_input.html.erb +0 -16
  54. data/app/views/job_invocations/_description_fields.html.erb +0 -4
  55. data/app/views/job_invocations/_form.html.erb +0 -144
  56. data/app/views/job_invocations/_preview_hosts_modal.html.erb +0 -15
  57. data/app/views/job_invocations/_rerun_taxonomies.html.erb +0 -22
  58. data/app/views/job_invocations/_tab_hosts.html.erb +0 -11
  59. data/app/views/job_invocations/_tab_overview.html.erb +0 -41
  60. data/app/views/job_invocations/_tab_preview_templates.html.erb +0 -20
  61. data/app/views/job_invocations/_user_input.html.erb +0 -21
  62. data/app/views/job_invocations/new.html.erb +0 -9
  63. data/app/views/job_invocations/refresh.js.erb +0 -4
  64. data/app/views/job_invocations/show.html.erb +0 -59
  65. data/app/views/job_invocations/show.js.erb +0 -12
  66. data/app/views/job_invocations/show.json.erb +0 -5
  67. data/test/support/remote_execution_helper.rb +0 -5
  68. data/webpack/react_app/components/TargetingHosts/TargetingHosts.js +0 -62
  69. data/webpack/react_app/components/TargetingHosts/TargetingHostsConsts.js +0 -2
  70. data/webpack/react_app/components/TargetingHosts/TargetingHostsHelpers.js +0 -10
  71. data/webpack/react_app/components/TargetingHosts/TargetingHostsLabelsRow.js +0 -45
  72. data/webpack/react_app/components/TargetingHosts/TargetingHostsLabelsRow.scss +0 -30
  73. data/webpack/react_app/components/TargetingHosts/TargetingHostsPage.js +0 -78
  74. data/webpack/react_app/components/TargetingHosts/TargetingHostsPage.scss +0 -3
  75. data/webpack/react_app/components/TargetingHosts/TargetingHostsSelectors.js +0 -25
  76. data/webpack/react_app/components/TargetingHosts/__tests__/HostItem.test.js +0 -76
  77. data/webpack/react_app/components/TargetingHosts/__tests__/HostStatus.test.js +0 -6
  78. data/webpack/react_app/components/TargetingHosts/__tests__/TargetingHosts.test.js +0 -6
  79. data/webpack/react_app/components/TargetingHosts/__tests__/TargetingHostsPage.test.js +0 -9
  80. data/webpack/react_app/components/TargetingHosts/__tests__/TargetingHostsSelectors.test.js +0 -31
  81. data/webpack/react_app/components/TargetingHosts/__tests__/__snapshots__/HostStatus.test.js.snap +0 -12
  82. data/webpack/react_app/components/TargetingHosts/__tests__/__snapshots__/TargetingHosts.test.js.snap +0 -96
  83. data/webpack/react_app/components/TargetingHosts/__tests__/__snapshots__/TargetingHostsPage.test.js.snap +0 -75
  84. data/webpack/react_app/components/TargetingHosts/__tests__/__snapshots__/TargetingHostsSelectors.test.js.snap +0 -16
  85. data/webpack/react_app/components/TargetingHosts/__tests__/fixtures.js +0 -56
  86. data/webpack/react_app/components/TargetingHosts/components/HostItem.js +0 -39
  87. data/webpack/react_app/components/TargetingHosts/components/HostStatus.js +0 -54
  88. data/webpack/react_app/components/TargetingHosts/index.js +0 -150
  89. data/webpack/react_app/components/jobInvocations/AggregateStatus/index.js +0 -60
  90. data/webpack/react_app/components/jobInvocations/AggregateStatus/index.test.js +0 -76
  91. data/webpack/react_app/components/jobInvocations/index.js +0 -94
  92. data/webpack/react_app/extend/reducers.js +0 -5
  93. data/webpack/react_app/redux/actions/jobInvocations/index.js +0 -87
  94. data/webpack/react_app/redux/consts.js +0 -5
  95. data/webpack/react_app/redux/reducers/index.js +0 -6
  96. data/webpack/react_app/redux/reducers/jobInvocations/index.fixtures.js +0 -46
  97. data/webpack/react_app/redux/reducers/jobInvocations/index.js +0 -34
  98. data/webpack/react_app/redux/reducers/jobInvocations/index.test.js +0 -43
@@ -1,33 +0,0 @@
1
- <% if job_invocation.concurrency_level ||
2
- (job_invocation.task && (job_invocation.task.delayed? || job_invocation.task.recurring?)) ||
3
- job_invocation.execution_timeout_interval.present? %>
4
- <div class="card-pf card-pf-accented">
5
- <div class="card-pf-title">
6
- <h2 style="height: 18px;" class="card-pf-title">
7
- <%= _('Schedule') %>
8
- </h2>
9
- </div>
10
- <div class="card-pf-body">
11
- <p>
12
- <ul>
13
- <% if job_invocation.concurrency_level %>
14
- <li><b><%= _("Concurrency level limited to") %></b>: <%= job_invocation.concurrency_level %> <%= _('tasks at a time') %><br></li>
15
- <% end %>
16
- <% if job_invocation.start_before %>
17
- <li><b><%= _("Scheduled to start before") %></b>: <%= job_invocation.start_before %><br></li>
18
- <% end %>
19
- <% if job_invocation.task && (job_invocation.task.delayed? || job_invocation.task.recurring?) %>
20
- <li><b><%= _("Scheduled to start at") %></b>: <%= job_invocation.task.start_at.try(:in_time_zone) %><br></li>
21
- <% end %>
22
- <% if job_invocation.execution_timeout_interval.present? %>
23
- <li><b><%= _("Timeout to kill after") %></b>: <%= job_invocation.execution_timeout_interval %> <%= _('seconds') %><br></li>
24
- <% end %>
25
- <% if job_invocation.time_to_pickup.present? %>
26
- <li><b><%= _("Time to pickup") %></b>: <%= job_invocation.time_to_pickup %> <%= _('seconds') %><br>
27
- </li>
28
- <% end %>
29
- </ul>
30
- </p>
31
- </div>
32
- </div>
33
- <% end %>
@@ -1,57 +0,0 @@
1
- <% template_invocations = job_invocation.pattern_template_invocations %>
2
- <div class="card-pf card-pf-accented target-hosts-card">
3
- <div class="card-pf-title">
4
- <h2 style="height: 18px;" class="card-pf-title">
5
- <%= _('Target hosts') %>
6
- </h2>
7
- </div>
8
- <div class="card-pf-body">
9
- <p>
10
- <% if job_invocation.bookmark.present? %>
11
- <%= _('Bookmark') %> <%= job_invocation.bookmark.name %><br>
12
- <% else %>
13
- <%= _('Manual selection') %>
14
- <% end %>
15
- <%= _('using ') %>
16
- <strong><%= _(Targeting::TYPES[job_invocation.targeting.targeting_type]).downcase %></strong>
17
- <pre><%= job_invocation.targeting.search_query %></pre>
18
- </p>
19
- <p>
20
- <% key = job_invocation.targeting.randomized_ordering ? Targeting::RANDOMIZED : Targeting::ORDERED %>
21
- <%= _('Execution order') %>: <strong><%= Targeting::ORDERINGS[key].downcase %></strong>
22
- </p>
23
- <p>
24
- <%= _('Organization') %>:
25
- <strong>
26
- <%= show_job_organization(@job_organization) %>
27
- </strong>
28
- </p>
29
- <p>
30
- <%= _('Location') %>:
31
- <strong>
32
- <%= show_job_location(@job_location) %>
33
- </strong>
34
- </p>
35
- <% if job_invocation[:ssh_user] %>
36
- <p>
37
- <%= _('SSH User') %>:
38
- <strong>
39
- <%= job_invocation[:ssh_user] %>
40
- </strong>
41
- </p>
42
- <% end %>
43
- </div>
44
- <div class='card-pf-footer'>
45
- <p>
46
- <%= _('Evaluated at:') %> <%= job_invocation.targeting.resolved_at %><br>
47
- <% if template_invocations.size > 1 %>
48
- <% template_invocations.each do |template_invocation| %>
49
- <%= host_counter template_invocation.template.provider.humanized_name,
50
- ForemanTasks::Task::DynflowTask.
51
- for_action(Actions::RemoteExecution::RunHostJob).
52
- for_resource(template_invocation).uniq.size %>
53
- <% end %>
54
- <% end %>
55
- </p>
56
- </div>
57
- </div>
@@ -1,16 +0,0 @@
1
- <div class="card-pf card-pf-accented">
2
- <div class="card-pf-title">
3
- <h2 style="height: 18px;" class="card-pf-title">
4
- <%= _('User Inputs') %>
5
- </h2>
6
- </div>
7
- <div class="card-pf-body">
8
- <p>
9
- <ul>
10
- <% template_invocation.input_values.joins(:template_input).each do |input_value| %>
11
- <li><b><%= input_value.template_input.name %></b>: <%= trunc_with_tooltip(input_safe_value(input_value), 255) %></li>
12
- <% end %>
13
- </ul>
14
- </p>
15
- </div>
16
- </div>
@@ -1,4 +0,0 @@
1
- <%= textarea_f(f, :description, :label => _('Description'), :readonly => 'true', :disabled => disabled, :class => 'description', :rows => 2, :help_inline => description_checkbox_f(f, job_template, disabled)) %>
2
- <div class="description_format_container <%= 'hidden' if f.object.description_format.nil? %>">
3
- <%= description_format_textarea_f(f, job_template, disabled) %>
4
- </div>
@@ -1,144 +0,0 @@
1
- <%= form_for @composer.job_invocation, :html => {'data-refresh-url' => refresh_job_invocations_path, :id => 'job_invocation_form'} do |f| %>
2
-
3
- <% unless @composer.rerun_possible? %>
4
- <%= alert :text => _('Could not rerun job %{id} because its template could not be found') % { :id => @composer.reruns },
5
- :class => 'alert alert-block alert-danger has-error',
6
- :close => false %>
7
- <% end %>
8
-
9
- <%= selectable_f f, :job_category, @composer.available_job_categories,
10
- { :selected => @composer.job_invocation.job_category, :include_blank => @composer.job_invocation.job_category.nil? },
11
- :label => _('Job category') %>
12
- <%= f.hidden_field(:remote_execution_feature_id, :value => @composer.remote_execution_feature_id) %>
13
-
14
- <% selected_templates_per_provider = {} %>
15
- <% @composer.displayed_provider_types.each do |provider_type| %>
16
- <%= f.fields_for 'providers' do |providers_fields| %>
17
- <%= providers_fields.fields_for provider_type do |provider_type_fields| %>
18
- <% templates_for_provider = @composer.templates_for_provider(provider_type) %>
19
- <% selected_templates_per_provider[provider_type] = @composer.preselected_template_for_provider(provider_type) || @composer.resolve_job_template(templates_for_provider) %>
20
-
21
- <%= selectable_f provider_type_fields, 'job_template_id', templates_for_provider.map { |t| [t.name, t.id] },
22
- { :selected => selected_templates_per_provider[provider_type].try(:id) },
23
- { :class => 'job_template_selector', :label => _('Job template'),
24
- :data => { :provider_type => provider_type }, :required => true, :onchange => "template_change(this);" }%>
25
- <% end %>
26
- <% end %>
27
- <% end %>
28
-
29
- <%= fields_for @composer.targeting do |targeting_fields| %>
30
- <span id="bookmark_query_map">
31
- <% @composer.available_bookmarks.each do |bookmark| %>
32
- <span id="bookmark-<%= bookmark.id %>" data-query="<%= bookmark.query %>"></span>
33
- <% end %>
34
- </span>
35
- <%= selectable_f targeting_fields, :bookmark_id, @composer.available_bookmarks.map { |b| [b.name, b.id] }, :selected => @composer.targeting.bookmark_id, :include_blank => true %>
36
- <%= autocomplete_f targeting_fields, :search_query, :search_query => @composer.displayed_search_query, :full_path => auto_complete_search_hosts_path %>
37
-
38
- <div class="form-group ">
39
- <label class="col-md-2 control-label"><%= _('Resolves to') %></label>
40
-
41
- <div class="col-md-4">
42
- <%= @composer.targeted_hosts_count %> <%= _('hosts') %>
43
- <%= button_tag(:type => 'button', :class => 'btn btn-default btn-sm', :title => _("Refresh"), :id => 'refresh_execution_form') do %>
44
- <%= icon_text('refresh', '', :kind => 'fa') %>
45
- <% end %>
46
- <%= button_tag(:type => 'button', :class => 'btn btn-default btn-sm', :title => _("Preview"), :id => 'preview_hosts') do %>
47
- <%= icon_text('eye', '', :kind => 'fa') %>
48
- <% end %>
49
- </div>
50
- </div>
51
-
52
- <% @composer.displayed_provider_types.each do |provider_type| %>
53
- <fieldset id="provider_<%= provider_type %>" class="provider_form">
54
- <%= f.fields_for 'providers' do |providers_fields| %>
55
- <%= providers_fields.fields_for provider_type do |provider_type_fields| %>
56
- <%= provider_type_fields.fields_for :job_templates do |job_templates_fields| %>
57
- <% @composer.templates_for_provider(provider_type).each do |job_template| %>
58
- <fieldset id="job_template_<%= job_template.id %>" class="job_template_form <%= 'hidden' if job_template != selected_templates_per_provider[provider_type] %>">
59
- <%= job_templates_fields.fields_for job_template.id.to_s do |job_template_fields| %>
60
-
61
- <%= job_template_fields.fields_for :input_values do |input_values_fields| %>
62
- <% inputs = job_template.template_inputs_with_foreign.select { |input| input.input_type == 'user' } %>
63
- <% inputs.select { |i| i.basic? }.each do |input| %>
64
- <%= render :partial => 'template_inputs/invocation_form', :locals => { :input_values_fields => input_values_fields, :composer => @composer, :job_template => job_template, :input => input, :onchange => "regenerate_description(this);" } %>
65
- <% end %>
66
-
67
- <%= advanced_switch_f _('Display advanced fields'), _('Hide advanced fields') %>
68
-
69
- <div class="advanced hidden">
70
- <% inputs.select { |i| i.advanced? }.each do |input| %>
71
- <%= render :partial => 'template_inputs/invocation_form', :locals => { :input_values_fields => input_values_fields, :composer => @composer, :job_template => job_template, :input => input } %>
72
- <% end %>
73
- </div>
74
- <% end %>
75
-
76
- <div class="advanced hidden">
77
- <%= job_template_fields.fields_for :provider_input_values do |provider_input_fields| %>
78
- <% job_template.provider.provider_inputs.each do |input| %>
79
- <%= provider_input_fields.fields_for input.name, input do |input_fields| %>
80
- <%= template_input_f(input_fields) %>
81
- <% end %>
82
- <% end %>
83
- <% end %>
84
-
85
- <%= text_f f, :ssh_user, :value => f.object.ssh_user, :label => _('SSH user'), :label_help => N_('A user to be used for SSH.') %>
86
-
87
- <% if job_template.effective_user.overridable? %>
88
- <%= text_f job_template_fields, :effective_user, :value => @composer.template_invocation(job_template).try(:effective_user), :label => _('Effective user'), :label_help => N_("A user to be used for executing the script. If it differs from the SSH user, su or sudo is used to switch the accounts.") %>
89
- <% end %>
90
- <%= render :partial => 'description_fields', :locals => { :f => f, :job_template => job_template, :disabled => job_template != selected_templates_per_provider[provider_type] } %>
91
- </div>
92
-
93
- <div class="advanced hidden">
94
- <%= number_f job_template_fields, :execution_timeout_interval, :value => f.object.execution_timeout_interval || job_template.execution_timeout_interval, :label => _('Timeout to kill'), :label_help => N_('Time in seconds from the start on the remote host after which the job should be killed.') %>
95
- </div>
96
- <% end %>
97
- </fieldset>
98
- <% end %>
99
- <% end %>
100
- <% end %>
101
- <% end %>
102
- </fieldset>
103
- <% end %>
104
-
105
- <div class="advanced hidden">
106
- <%= number_f f, :time_to_pickup, :value => f.object.time_to_pickup, :label => _('Time to pickup'), :label_help => N_('Interval in seconds, if the job is not picked up by a client within this interval it will be cancelled.') %>
107
- </div>
108
-
109
- <div class="advanced hidden">
110
- <%= password_f f, :password, :placeholder => '*****', :label => _('Password'), :label_help => N_('Password is stored encrypted in DB until the job finishes. For future or recurring executions, it is removed after the last execution.') %>
111
- <%= password_f f, :key_passphrase, :placeholder => '*****', :label => _('Private key passphrase'), :label_help => N_('Key passhprase is only applicable for SSH provider. Other providers ignore this field. <br> Passphrase is stored encrypted in DB until the job finishes. For future or recurring executions, it is removed after the last execution.') %>
112
- <%= password_f f, :effective_user_password, :placeholder => '*****', :label => _('Effective user password'), :label_help => N_('Effective user password is only applicable for SSH provider. Other providers ignore this field. <br> Password is stored encrypted in DB until the job finishes. For future or recurring executions, it is removed after the last execution.') %>
113
- </div>
114
-
115
- <div class="advanced hidden">
116
- <%= number_f f, :concurrency_level, :label => _('Concurrency level'), :placeholder => 'N', :min => 1, :label_help => N_("Run at most N tasks at a time. If this is set and proxy batch triggering is enabled, then tasks are triggered on the smart proxy in batches of size 1.") %>
117
- </div>
118
-
119
- <div class="form-group advanced hidden">
120
- <%= add_label({ :label => _('Execution ordering'), :label_help => _("Execution ordering determines whether the jobs should be executed on hosts in alphabetical order or in randomized order.<br><ul><li><b>Ordered</b> - Executes the jobs on hosts in alphabetical order</li><li><b>Randomized</b> - Randomizes the order in which jobs are executed on hosts</li></ul>") }, f, :randomized_ordering) %>
121
-
122
- <div class="col-md-4">
123
- <%= radio_button_f targeting_fields, :randomized_ordering, :value => false, :text => _(Targeting::ORDERINGS[Targeting::ORDERED]), :checked => !@composer.targeting.randomized_ordering %>
124
- <%= radio_button_f targeting_fields, :randomized_ordering, :value => true, :text => _(Targeting::ORDERINGS[Targeting::RANDOMIZED]) %>
125
- </div>
126
- </div>
127
-
128
- <div class="form-group">
129
- <%= add_label({ :label => _('Type of query'), :label_help => _("Type determines when the query is evaluated to hosts.<br><ul><li><b>Static</b> - Executes the job on the current list of target hosts.</li><li><b>Dynamic</b> - Evaluates the list of target hosts just before the job is executed. If you used a filter to select the target hosts, the list of target hosts might be different from the current list.</li></ul>") }, f, :targetting_type) %>
130
-
131
- <div class="col-md-4">
132
- <%= radio_button_f targeting_fields, :targeting_type, :value => Targeting::STATIC_TYPE, :text => _(Targeting::TYPES[Targeting::STATIC_TYPE]) %>
133
- <%= radio_button_f targeting_fields, :targeting_type, :value => Targeting::DYNAMIC_TYPE, :text => _(Targeting::TYPES[Targeting::DYNAMIC_TYPE]) %>
134
- </div>
135
- </div>
136
- <% end %>
137
-
138
- <%= trigger_selector f, @composer.triggering %>
139
-
140
- <%= render :partial => 'preview_hosts_modal' %>
141
-
142
- <%= render partial: 'rerun_taxonomies' if action_name == 'rerun' %>
143
- <%= submit_or_cancel f, false, :cancel_path => job_invocations_path, :disabled => !@composer.rerun_possible? %>
144
- <% end %>
@@ -1,15 +0,0 @@
1
- <% stylesheet 'foreman_remote_execution/foreman_remote_execution' %>
2
-
3
- <!-- modal window -->
4
- <div class="modal fade" id="previewHostsModal" role="dialog" aria-hidden="true" data-url="<%= preview_hosts_job_invocations_path %>">
5
- <div class="modal-dialog">
6
- <div class="modal-content">
7
- <div class="modal-header">
8
- <button type="button" class="close" onclick="close_preview_hosts_modal(); return false;"><span aria-hidden="true">&times;</span><span class="sr-only"><%= _('Close') %></span></button>
9
- <h4 class="modal-title">Preview Hosts</h4>
10
- </div>
11
- <div class="modal-body">
12
- </div>
13
- </div>
14
- </div>
15
- </div>
@@ -1,22 +0,0 @@
1
- <% if Organization.current != @job_organization %>
2
- <div class="form-group">
3
- <div class="col-md-6">
4
- <div class="alert alert-warning">
5
- <span class="pficon pficon-warning-triangle-o"></span>
6
- <%= _("Current organization %{org_c} is different from job's organization %{org_j}.") % { org_c: show_job_organization(Organization.current),
7
- org_j: show_job_organization(@job_organization) } %>
8
- </div>
9
- </div>
10
- </div>
11
- <% end %>
12
- <% if Location.current != @job_location %>
13
- <div class="form-group">
14
- <div class="col-md-6">
15
- <div class="alert alert-warning">
16
- <span class="pficon pficon-warning-triangle-o"></span>
17
- <%= _("Current location %{loc_c} is different from job's location %{loc_j}.") % { loc_c: show_job_location(Location.current),
18
- loc_j: show_job_location(@job_location) } %>
19
- </div>
20
- </div>
21
- </div>
22
- <% end %>
@@ -1,11 +0,0 @@
1
- <% if job_invocation.resolved? %>
2
- <%= react_component('TargetingHosts' ) %>
3
- <% else %>
4
- <div class="alert alert-warning">
5
- <%=
6
- _("The dynamic query '%{query}' was not resolved yet. The list of hosts to which it would resolve now can be seen %{here}." %
7
- { :query => job_invocation.targeting.search_query,
8
- :here => link_to(_('here'), hosts_url(:search => job_invocation.targeting.search_query))})
9
- %>
10
- </div>
11
- <% end %>
@@ -1,41 +0,0 @@
1
- <% template_invocations = job_invocation.pattern_template_invocations %>
2
- <div class='row'>
3
- <div class="col-xs-6 col-sm-6 col-md-6">
4
- <%= render :partial => 'card_results', :locals => { :job_invocation => job_invocation } %>
5
- <%= render :partial => 'card_schedule', :locals => { :job_invocation => job_invocation } %>
6
- </div>
7
- <div class='col-xs-12 col-sm-6 col-md-6'>
8
- <%= render :partial => 'card_target_hosts', :locals => { :job_invocation => job_invocation } %>
9
- <% template_invocations.each do |template_invocation| %>
10
- <%= minicard('user', template_invocation.effective_user || Setting[:remote_execution_effective_user],
11
- template_invocation.template.name + ' ' + _('effective user')) %>
12
- <div class="row">
13
- <% missing = job_invocation.missing_hosts_count %>
14
- <% size = missing.zero? ? 12 : 6 %>
15
- <div class="col-xs-12 col-sm-<%= size %> col-md-<%= size %>" >
16
- <%= minicard('cluster', job_invocation.total_hosts_count, _('Total hosts')) %>
17
- </div>
18
- <% unless missing.zero? %>
19
- <div class="col-xs-12 col-sm-6 col-md-6" >
20
- <%= minicard('warning-triangle-o', missing, _('Hosts gone missing'),
21
- :tooltip => _('This can happen if the host is removed or moved to another organization or location after the job was started')) %>
22
- </div>
23
- <% end %>
24
- </div>
25
- <% if template_invocation.input_values.present? %>
26
- <%= render :partial => 'card_user_input', :locals => { :template_invocation => template_invocation } %>
27
- <% end %>
28
- <% end %>
29
- </div>
30
- </div>
31
- <hr/>
32
- <% if job_invocation.resolved? %>
33
- <div id="hosts" data-refresh_required="<%= job_invocation.resolved? ? '' : 'true' %>">
34
- <%= render :partial => 'tab_hosts', :locals => { :job_invocation => job_invocation, :hosts => hosts } %>
35
- </div>
36
- <% else %>
37
- <div class="alert alert-warning">
38
- <%= _("The dynamic query '#{job_invocation.targeting.search_query}' was not resolved yet. The list of hosts to which it would resolve now can be seen") %>
39
- <%= link_to('here.', hosts_url(:search => job_invocation.targeting.search_query)) %>
40
- </div>
41
- <% end %>
@@ -1,20 +0,0 @@
1
- <div class='row'>
2
- <div class="col-xs-6 col-sm-12 col-md-12">
3
- <div class="card-pf">
4
- <div class="card-pf-heading">
5
- <h2 style="height: 18px;" class="card-pf-title">
6
- <%= _('Providers and templates') %>
7
- </h2>
8
- </div>
9
- <div class="card-pf-body">
10
- <p>
11
- <% template_invocation = job_invocation.pattern_template_invocations.first %>
12
- <h5>
13
- <%= template_name_and_provider_link(template_invocation.template) %>
14
- </h5>
15
- <%= preview_hosts(template_invocation) %>
16
- </p>
17
- </div>
18
- </div>
19
- </div>
20
- </div>
@@ -1,21 +0,0 @@
1
- <div id='preview_<%= target.id %>' class='collapse out'>
2
- <%= preview_box(template_invocation, target) %>
3
- <% if template_invocation.input_values.present? %>
4
- <table class='<%= table_css_classes %>'>
5
- <thead>
6
- <tr>
7
- <th><%= _('User input') %></th>
8
- <th><%= _('Value') %></th>
9
- </tr>
10
- </thead>
11
- <tbody>
12
- <% template_invocation.input_values.joins(:template_input).each do |input_value| %>
13
- <tr>
14
- <td><b><%= input_value.template_input.name %></b></td>
15
- <td><%= input_safe_value(input_value) %></td>
16
- </tr>
17
- <% end %>
18
- </tbody>
19
- </table>
20
- <% end %>
21
- </div>
@@ -1,9 +0,0 @@
1
- <% javascript 'foreman_remote_execution/template_invocation' %>
2
- <% stylesheet 'foreman_remote_execution/foreman_remote_execution' %>
3
- <% title _('Job invocation') %>
4
- <% if(request.path_parameters[:action] == "rerun") %>
5
- <%= authorized_for(controller: :job_invocations, action: :create) ? link_to(_('Use new job wizard'), hash_for_rerun_job_invocation_path({:id => request.path_parameters[:id]}).merge(request.query_parameters)) : nil %>
6
- <% else %>
7
- <%= authorized_for(controller: :job_invocations, action: :create) ? link_to(_('Use new job wizard'), hash_for_new_job_invocation_path().merge(request.query_parameters)) : nil %>
8
- <%end%>
9
- <%= render :partial => 'form' %>
@@ -1,4 +0,0 @@
1
- $('form#job_invocation_form').replaceWith("<%=j render :partial => 'form' %>");
2
- $('#job_invocation_form').find('a[rel="popover"]').popover();
3
- $('#job_invocation_form select:not(.without_select2)').select2({ allowClear: true });
4
- $('div.tooltip').remove();
@@ -1,59 +0,0 @@
1
- <% title @job_invocation.description %>
2
- <%= webpacked_plugins_js_for :foreman_remote_execution %>
3
- <% content_for(:javascripts) do -%>
4
- <% javascript 'foreman_remote_execution/template_invocation' %><% end %>
5
- <% content_for(:stylesheets) do %>
6
- <% stylesheet 'foreman_remote_execution/foreman_remote_execution' %>
7
- <% end %>
8
-
9
- <%= breadcrumbs name_field: 'description' %>
10
-
11
- <% if @job_invocation.task %>
12
- <% title_actions(button_group(job_invocation_task_buttons(@job_invocation.task))) %>
13
- <% end %>
14
-
15
- <ul class="nav nav-tabs" data-tabs="tabs">
16
- <li class="active">
17
- <a href="#primary" data-toggle="tab"><%= _('Overview') %></a>
18
- </li>
19
- <li>
20
- <a href="#preview_templates" data-toggle="tab"><%= _('Preview templates') %></a>
21
- </li>
22
- <% if @job_invocation.recurring_logic.present? %>
23
- <li><a href="#recurring_logic" data-toggle="tab"><%= _('Recurring logic') %></a></li>
24
- <% end %>
25
- <%= render_tab_header_for(:main_tabs, subject: @job_invocation) %>
26
- </ul>
27
-
28
- <div class="tab-content">
29
- <div class="tab-pane active" id="primary">
30
- <%= render 'tab_overview', :job_invocation => @job_invocation, :hosts => @hosts %>
31
- </div>
32
- <div class="tab-pane" id="preview_templates">
33
- <%= render 'tab_preview_templates', :job_invocation => @job_invocation %>
34
- </div>
35
-
36
- <% unless @job_invocation.recurring_logic.nil? %>
37
- <div class="tab-pane" id="recurring_logic">
38
- <div class='col-md-6'>
39
- <% if @job_invocation.recurring_logic.try(:task_group) %>
40
- <%= render @job_invocation.recurring_logic.task_group, :task_group => @job_invocation.recurring_logic.try(:task_group) %>
41
- <% end %>
42
- </div>
43
- </div>
44
- <% end %>
45
- <%= render_tab_content_for(:main_tabs, subject: @job_invocation) %>
46
- </div>
47
-
48
- <script id="job_invocation_refresh" data-refresh-url="<%= job_invocation_path(@job_invocation) %>">
49
- <% if @auto_refresh %>
50
- if(window.allJsLoaded){
51
- delayed_refresh($('script#job_invocation_refresh').data('refresh-url'), {})
52
- }
53
- else {
54
- $(document).on('loadJS', function() {
55
- delayed_refresh($('script#job_invocation_refresh').data('refresh-url'), {})
56
- });
57
- }
58
- <% end %>
59
- </script>
@@ -1,12 +0,0 @@
1
- $('div#title_action div.btn-group').html('<%= button_group(job_invocation_task_buttons(@job_invocation.task)).html_safe %>');
2
-
3
- <% if @auto_refresh %>
4
- if(window.allJsLoaded){
5
- delayed_refresh($('script#job_invocation_refresh').data('refresh-url'), job_invocation_refresh_data())
6
- }
7
- else {
8
- $(document).on('loadJS', function() {
9
- delayed_refresh($('script#job_invocation_refresh').data('refresh-url'), job_invocation_refresh_data())
10
- });
11
- }
12
- <% end %>
@@ -1,5 +0,0 @@
1
- {
2
- "autoRefresh": "<%= @auto_refresh %>",
3
- "hosts": <%= targeting_hosts(@job_invocation, @hosts).to_json.html_safe %>,
4
- "total_hosts": <%= @total_hosts %>
5
- }
@@ -1,5 +0,0 @@
1
- module RemoteExecutionHelper
2
- def job_invocation_task_buttons(task)
3
- return []
4
- end
5
- end
@@ -1,62 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { translate as __ } from 'foremanReact/common/I18n';
4
- import { LoadingState, Alert } from 'patternfly-react';
5
- import { STATUS } from 'foremanReact/constants';
6
- import HostItem from './components/HostItem';
7
-
8
- const TargetingHosts = ({ apiStatus, items }) => {
9
- if (apiStatus === STATUS.ERROR) {
10
- return (
11
- <Alert type="error">
12
- {__(
13
- 'There was an error while updating the status, try refreshing the page.'
14
- )}
15
- </Alert>
16
- );
17
- }
18
-
19
- const tableBodyRows = items.length ? (
20
- items.map(({ name, link, status, actions }) => (
21
- <HostItem
22
- key={name}
23
- name={name}
24
- link={link}
25
- status={status}
26
- actions={actions}
27
- />
28
- ))
29
- ) : (
30
- <tr>
31
- <td colSpan="3">{__('No hosts found.')}</td>
32
- </tr>
33
- );
34
-
35
- return (
36
- <LoadingState loading={!items.length && apiStatus === STATUS.PENDING}>
37
- <div>
38
- <table className="table table-bordered table-striped table-hover">
39
- <thead>
40
- <tr>
41
- <th>{__('Host')}</th>
42
- <th>{__('Status')}</th>
43
- <th>{__('Actions')}</th>
44
- </tr>
45
- </thead>
46
- <tbody>{tableBodyRows}</tbody>
47
- </table>
48
- </div>
49
- </LoadingState>
50
- );
51
- };
52
-
53
- TargetingHosts.propTypes = {
54
- apiStatus: PropTypes.string,
55
- items: PropTypes.array.isRequired,
56
- };
57
-
58
- TargetingHosts.defaultProps = {
59
- apiStatus: null,
60
- };
61
-
62
- export default TargetingHosts;
@@ -1,2 +0,0 @@
1
- export const TARGETING_HOSTS = 'TARGETING_HOSTS';
2
- export const TARGETING_HOSTS_AUTOCOMPLETE = 'targeting_hosts_search';
@@ -1,10 +0,0 @@
1
- import { getURI } from 'foremanReact/common/urlHelpers';
2
-
3
- export const getApiUrl = (searchQuery, pagination) => {
4
- const baseUrl = getURI()
5
- .search('')
6
- .addQuery('page', pagination.page)
7
- .addQuery('per_page', pagination.per_page);
8
-
9
- return searchQuery ? baseUrl.addQuery('search', searchQuery) : baseUrl;
10
- };
@@ -1,45 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { Row, Label } from 'patternfly-react';
4
- import { noop } from 'foremanReact/common/helpers';
5
- import { translate as __ } from 'foremanReact/common/I18n';
6
-
7
- import './TargetingHostsLabelsRow.scss';
8
-
9
- const TargetingHostsLabelsRow = ({ query, updateQuery }) => {
10
- const onDeleteClick = keyToDelete => {
11
- const { [keyToDelete]: deleted, ...queryWithoutDeleted } = query;
12
- updateQuery(queryWithoutDeleted);
13
- };
14
-
15
- const queryEntries = Object.entries(query);
16
-
17
- return (
18
- queryEntries.length > 0 && (
19
- <Row className="tasks-labels-row">
20
- <span className="title">{__('Active Filters:')}</span>
21
- {queryEntries.map(([key, value]) => (
22
- <Label
23
- bsStyle="info"
24
- key={key}
25
- onRemoveClick={() => onDeleteClick(key)}
26
- >
27
- {`${key} = ${value}`}
28
- </Label>
29
- ))}
30
- </Row>
31
- )
32
- );
33
- };
34
-
35
- TargetingHostsLabelsRow.propTypes = {
36
- query: PropTypes.object,
37
- updateQuery: PropTypes.func,
38
- };
39
-
40
- TargetingHostsLabelsRow.defaultProps = {
41
- query: {},
42
- updateQuery: noop,
43
- };
44
-
45
- export default TargetingHostsLabelsRow;