foreman_remote_execution 16.2.3 → 16.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6edb691d286eb1017cc9d9c19b0a7c9ec25e6b1110cff9f6f4d33ed1c3321512
4
- data.tar.gz: 26c205f22a58f5755b2764d5aa01ee545fdc8159f88aa031f3cdd6e77d7e31f5
3
+ metadata.gz: a4ba8d959e00a021655728444aaeb2f89edd95dc85e711e18947783fb69984a9
4
+ data.tar.gz: '09e09cca1a6ce94e49f19b45f739b9bc55991d88dbc28e2129551a2012b0a485'
5
5
  SHA512:
6
- metadata.gz: 37bebee7657b6688e9c477d6de015e2c895dce65126d97781b41629aca5bcd3ee5d0fd39e897833e3efced4404edb4976f00f0f9680654e3423585e5d2900e2b
7
- data.tar.gz: 9e646f31860c4f353d82050003dd828f0708d69a852e04526d535f9dc4c0ac7e2756ebb44a2d103c9ba3c8082d4f163a112c981f88d7e0fe7b0d0ec841bb8ed9
6
+ metadata.gz: ebfeca44b35796fe096a4a627638f818276f40efff85be6f7906428c1c582cf0f15c5c6b44fdd7fa2518945d0c511a9f1873e4bd6ac47096f66c5e1a38bc5aa4
7
+ data.tar.gz: f8c8391a6df84d5275fed3e73fa3d6ba18935eed2c2526c57a421bafe36e2e120a2c15a05a7c38510fdf31ddf0e2e50572346f21e207b144bdd619afc35b55c7
@@ -118,7 +118,12 @@ module Api
118
118
  set_statuses_and_smart_proxies
119
119
  @total = @job_invocation.targeting.hosts.size
120
120
  @hosts = @hosts.search_for(params[:search], :order => params[:order]).paginate(:page => params[:page], :per_page => params[:per_page])
121
- @subtotal = @hosts.respond_to?(:total_entries) ? @hosts.total_entries : @hosts.sizes
121
+ if params[:awaiting]
122
+ @hosts = @hosts.select { |host| @host_statuses[host.id] == 'N/A' }
123
+ @subtotal = @hosts.size
124
+ else
125
+ @subtotal = @hosts.respond_to?(:total_entries) ? @hosts.total_entries : @hosts.sizes
126
+ end
122
127
  render :hosts, :layout => 'api/v2/layouts/index_layout'
123
128
  end
124
129
 
@@ -54,7 +54,7 @@ module RemoteExecutionHelper
54
54
 
55
55
  def job_invocations_buttons
56
56
  [
57
- documentation_button_rex('3.2ExecutingaJob'),
57
+ documentation_button('Managing_Hosts', type: 'docs', chapter: 'executing-a-remote-job_managing-hosts'),
58
58
  authorized_for(controller: :job_invocations, action: :create) ? link_to(_('Run Job'), hash_for_new_job_invocation_path, {:class => "btn btn-primary"}) : '',
59
59
  ]
60
60
  end
@@ -207,12 +207,6 @@ module RemoteExecutionHelper
207
207
  end
208
208
  end
209
209
 
210
- def documentation_button_rex(section = '')
211
- url = 'http://theforeman.org/plugins/foreman_remote_execution/' +
212
- "#{ForemanRemoteExecution::VERSION.split('.').take(2).join('.')}/index.html#"
213
- documentation_button section, :root_url => url
214
- end
215
-
216
210
  def description_checkbox_f(f, job_template, disabled)
217
211
  check_box_tag('description_format_override',
218
212
  job_template.generate_description_format,
@@ -2,7 +2,7 @@
2
2
  <%= javascript 'foreman_remote_execution/template_input' %>
3
3
 
4
4
  <% title _("Job Templates") %>
5
- <% title_actions(documentation_button_rex('3.1JobTemplates'),
5
+ <% title_actions(documentation_button('Managing_Hosts', type: 'docs', chapter: 'creating-a-job-template_managing-hosts'),
6
6
  link_to_function(_('Import'), 'show_import_job_template_modal();', :class => 'btn btn-default'),
7
7
  new_link(_("New Job Template"))) %>
8
8
 
@@ -1,5 +1,5 @@
1
1
  Foreman::Plugin.register :foreman_remote_execution do
2
- requires_foreman '>= 3.16'
2
+ requires_foreman '>= 3.17'
3
3
  register_global_js_file 'global'
4
4
  register_gettext
5
5
 
@@ -1,3 +1,3 @@
1
1
  module ForemanRemoteExecution
2
- VERSION = '16.2.3'.freeze
2
+ VERSION = '16.3.0'.freeze
3
3
  end
@@ -19,6 +19,7 @@ export const JOB_INVOCATION_HOSTS = 'JOB_INVOCATION_HOSTS';
19
19
  export const GET_TEMPLATE_INVOCATION = 'GET_TEMPLATE_INVOCATION';
20
20
  export const DIRECT_OPEN_HOST_LIMIT = 3;
21
21
  export const ALL_JOB_HOSTS = 'ALL_JOB_HOSTS';
22
+ export const AWAITING_STATUS_FILTER = '(job_invocation.result = N/A)';
22
23
  export const currentPermissionsUrl = foremanUrl(
23
24
  '/api/v2/permissions/current_permissions'
24
25
  );
@@ -51,6 +52,7 @@ export const STATUS_TITLES = {
51
52
  FAILED: { id: 'failed', title: __('Failed') },
52
53
  PENDING: { id: 'pending', title: __('In Progress') },
53
54
  CANCELLED: { id: 'cancelled', title: __('Cancelled') },
55
+ NOT_STARTED: { id: 'N/A', title: __('Scheduled') },
54
56
  };
55
57
 
56
58
  export const DATE_OPTIONS = {
@@ -85,11 +87,6 @@ const Columns = () => {
85
87
  const hostDetailsPageUrl = useForemanHostDetailsPageUrl();
86
88
 
87
89
  return {
88
- expand: {
89
- title: ' ',
90
- weight: 0,
91
- wrapper: () => null,
92
- },
93
90
  name: {
94
91
  title: __('Name'),
95
92
  wrapper: ({ name }) => (
@@ -35,6 +35,7 @@ import Columns, {
35
35
  LIST_TEMPLATE_INVOCATIONS,
36
36
  STATUS_UPPERCASE,
37
37
  ALL_JOB_HOSTS,
38
+ AWAITING_STATUS_FILTER,
38
39
  } from './JobInvocationConstants';
39
40
  import { TemplateInvocation } from './TemplateInvocation';
40
41
  import { RowActions } from './TemplateInvocationComponents/TemplateActionButtons';
@@ -63,13 +64,6 @@ const JobInvocationHostTable = ({
63
64
  const [expandedHost, setExpandedHost] = useState([]);
64
65
  const prevStatusLabel = useRef(statusLabel);
65
66
 
66
- const isHostExpanded = host => expandedHost.includes(host);
67
- const setHostExpanded = (host, isExpanding = true) =>
68
- setExpandedHost(prevExpanded => {
69
- const otherExpandedHosts = prevExpanded.filter(h => h !== host);
70
- return isExpanding ? [...otherExpandedHosts, host] : otherExpandedHosts;
71
- });
72
-
73
67
  // Page table params
74
68
  // Parse URL
75
69
  const {
@@ -150,7 +144,9 @@ const JobInvocationHostTable = ({
150
144
  ...newParams,
151
145
  };
152
146
 
153
- if (filterSearch !== '') {
147
+ if (filterSearch === AWAITING_STATUS_FILTER) {
148
+ finalParams.awaiting = 'true';
149
+ } else if (filterSearch !== '') {
154
150
  finalParams.search = filterSearch;
155
151
  }
156
152
 
@@ -311,6 +307,32 @@ const JobInvocationHostTable = ({
311
307
  </Tr>
312
308
  );
313
309
 
310
+ const isHostExpanded = host => expandedHost.includes(host.id);
311
+
312
+ const setHostExpanded = (host, isExpanding = true) =>
313
+ setExpandedHost(prevExpanded => {
314
+ const otherExpandedHosts = prevExpanded.filter(h => h !== host.id);
315
+ return isExpanding
316
+ ? [...otherExpandedHosts, host.id]
317
+ : otherExpandedHosts;
318
+ });
319
+
320
+ const pageHostIds = results.map(h => h.id);
321
+
322
+ const areAllPageRowsExpanded =
323
+ pageHostIds.length > 0 &&
324
+ pageHostIds.every(hostId => expandedHost.includes(hostId));
325
+
326
+ const onExpandAll = () => {
327
+ setExpandedHost(() => {
328
+ if (areAllPageRowsExpanded) {
329
+ return [];
330
+ }
331
+
332
+ return pageHostIds;
333
+ });
334
+ };
335
+
314
336
  return (
315
337
  <>
316
338
  {showAlert && <PopupAlert setShowAlert={setShowAlert} />}
@@ -342,6 +364,8 @@ const JobInvocationHostTable = ({
342
364
  <Table
343
365
  ouiaId="job-invocation-hosts-table"
344
366
  columns={columns}
367
+ areAllRowsExpanded={!areAllPageRowsExpanded}
368
+ onExpandAll={onExpandAll}
345
369
  customEmptyState={
346
370
  status === STATUS_UPPERCASE.RESOLVED && !results.length
347
371
  ? customEmptyState
@@ -370,14 +394,14 @@ const JobInvocationHostTable = ({
370
394
  childrenOutsideTbody
371
395
  >
372
396
  {results.map((result, rowIndex) => (
373
- <Tbody key={result.id}>
397
+ <Tbody key={result.id} isExpanded={isHostExpanded(result)}>
374
398
  <Tr ouiaId={`table-row-${result.id}`}>
375
399
  <Td
376
400
  expand={{
377
401
  rowIndex,
378
- isExpanded: isHostExpanded(result.id),
402
+ isExpanded: isHostExpanded(result),
379
403
  onToggle: () =>
380
- setHostExpanded(result.id, !isHostExpanded(result.id)),
404
+ setHostExpanded(result, !isHostExpanded(result)),
381
405
  expandId: 'host-expandable',
382
406
  }}
383
407
  />
@@ -390,7 +414,7 @@ const JobInvocationHostTable = ({
390
414
  </Td>
391
415
  </Tr>
392
416
  <Tr
393
- isExpanded={isHostExpanded(result.id)}
417
+ isExpanded={isHostExpanded(result)}
394
418
  ouiaId="table-row-expanded-sections"
395
419
  >
396
420
  <Td
@@ -409,7 +433,7 @@ const JobInvocationHostTable = ({
409
433
  hostID={result.id}
410
434
  jobID={id}
411
435
  isInTableView
412
- isExpanded={isHostExpanded(result.id)}
436
+ isExpanded={isHostExpanded(result)}
413
437
  />
414
438
  )}
415
439
  </ExpandableRowContent>
@@ -76,6 +76,12 @@ const JobInvocationSystemStatusChart = ({
76
76
  }
77
77
  };
78
78
 
79
+ const onEmptyChartClick = () => {
80
+ if (onFilterChange) {
81
+ onFilterChange(STATUS_TITLES.NOT_STARTED.id);
82
+ }
83
+ };
84
+
79
85
  return (
80
86
  <>
81
87
  <FlexItem className="chart-donut">
@@ -94,7 +100,7 @@ const JobInvocationSystemStatusChart = ({
94
100
  {
95
101
  target: 'data',
96
102
  eventHandlers: {
97
- onClick: onChartClick,
103
+ onClick: total > 0 ? onChartClick : onEmptyChartClick,
98
104
  },
99
105
  },
100
106
  ]}
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_remote_execution
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.2.3
4
+ version: 16.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Remote Execution team
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-10-08 00:00:00.000000000 Z
10
+ date: 2025-10-29 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: deface