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 +4 -4
- data/app/controllers/api/v2/job_invocations_controller.rb +6 -1
- data/app/helpers/remote_execution_helper.rb +1 -7
- data/app/views/job_templates/index.html.erb +1 -1
- data/lib/foreman_remote_execution/plugin.rb +1 -1
- data/lib/foreman_remote_execution/version.rb +1 -1
- data/webpack/JobInvocationDetail/JobInvocationConstants.js +2 -5
- data/webpack/JobInvocationDetail/JobInvocationHostTable.js +37 -13
- data/webpack/JobInvocationDetail/JobInvocationSystemStatusChart.js +7 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a4ba8d959e00a021655728444aaeb2f89edd95dc85e711e18947783fb69984a9
|
|
4
|
+
data.tar.gz: '09e09cca1a6ce94e49f19b45f739b9bc55991d88dbc28e2129551a2012b0a485'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
|
|
@@ -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
|
|
402
|
+
isExpanded: isHostExpanded(result),
|
|
379
403
|
onToggle: () =>
|
|
380
|
-
setHostExpanded(result
|
|
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
|
|
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
|
|
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.
|
|
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-
|
|
10
|
+
date: 2025-10-29 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: deface
|