foreman_remote_execution 16.0.1 → 16.0.2
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/template_invocations_controller.rb +9 -1
- data/lib/foreman_remote_execution/version.rb +1 -1
- data/webpack/JobInvocationDetail/JobAdditionInfo.js +1 -1
- data/webpack/JobInvocationDetail/TemplateInvocation.js +15 -4
- data/webpack/JobInvocationDetail/TemplateInvocationComponents/TemplateActionButtons.js +2 -4
- data/webpack/JobInvocationDetail/TemplateInvocationComponents/index.scss +8 -2
- data/webpack/JobInvocationDetail/TemplateInvocationPage.js +2 -0
- data/webpack/JobInvocationDetail/__tests__/TemplateInvocation.test.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: 7caeb3e80948285d1309b9837215de256dbf364739b3a7e8fcbc7a2dbe25784f
|
4
|
+
data.tar.gz: 45cc57f3a3ff4f53b8ca06aee5561d13ce4171b483c75052915b18c503786f6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9ffb89e10d120b7599f4c0eb129d1a65735063cddddd74126b67463243118c3641cc14f82285c155c15d5e2e5fd596f71865b63b5476a8bbb2d64521b837610
|
7
|
+
data.tar.gz: 1f786339afd9c4ab35dd55e8d84bb5d72c0cca491e374c2439838837c449ce26e83d583770690d88e02550bddc941be10831596a628c2e98e7e7a782661a168c
|
@@ -38,9 +38,17 @@ class TemplateInvocationsController < ApplicationController
|
|
38
38
|
}
|
39
39
|
end
|
40
40
|
|
41
|
+
smart_proxy = @template_invocation.smart_proxy
|
42
|
+
if smart_proxy
|
43
|
+
proxy = {
|
44
|
+
name: smart_proxy.name,
|
45
|
+
href: smart_proxy_path(smart_proxy),
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
41
49
|
auto_refresh = @job_invocation.task.try(:pending?)
|
42
50
|
finished = @job_invocation.status_label == 'failed' || @job_invocation.status_label == 'succeeded' || @job_invocation.status_label == 'cancelled'
|
43
|
-
render :json => { :output => lines, :preview => template_invocation_preview(@template_invocation, @host), :input_values => transformed_input_values, :job_invocation_description => @job_invocation.description, :task_id => @template_invocation_task.id, :task_cancellable => @template_invocation_task.cancellable?, :host_name => @host.name, :permissions => {
|
51
|
+
render :json => { :output => lines, :preview => template_invocation_preview(@template_invocation, @host), :proxy => proxy, :input_values => transformed_input_values, :job_invocation_description => @job_invocation.description, :task_id => @template_invocation_task.id, :task_cancellable => @template_invocation_task.cancellable?, :host_name => @host.name, :permissions => {
|
44
52
|
:view_foreman_tasks => User.current.allowed_to?(:view_foreman_tasks),
|
45
53
|
:cancel_job_invocations => User.current.allowed_to?(:cancel_job_invocations),
|
46
54
|
:execute_jobs => User.current.allowed_to?(:create_job_invocations) && (!@host.infrastructure_host? || User.current.can?(:execute_jobs_on_infrastructure_hosts)),
|
@@ -169,7 +169,7 @@ const Inputs = ({ data }) => {
|
|
169
169
|
const inputs =
|
170
170
|
data?.pattern_template_invocations?.[0]?.template_invocation_input_values;
|
171
171
|
|
172
|
-
if (!inputs) return null;
|
172
|
+
if (!inputs || inputs.length === 0) return null;
|
173
173
|
return (
|
174
174
|
<ExpandableSection
|
175
175
|
toggleText={__('User Inputs')}
|
@@ -53,6 +53,7 @@ export const TemplateInvocation = ({
|
|
53
53
|
jobID,
|
54
54
|
isInTableView,
|
55
55
|
hostName,
|
56
|
+
hostProxy,
|
56
57
|
}) => {
|
57
58
|
const templateURL = showTemplateInvocationUrl(hostID, jobID);
|
58
59
|
const hostDetailsPageUrl = useForemanHostDetailsPageUrl();
|
@@ -150,10 +151,18 @@ export const TemplateInvocation = ({
|
|
150
151
|
permissions={permissions}
|
151
152
|
/>
|
152
153
|
{!isInTableView && (
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
154
|
+
<>
|
155
|
+
<div>
|
156
|
+
{__('Target:')}{' '}
|
157
|
+
<a href={`${hostDetailsPageUrl}${hostName}`}>{hostName}</a>{' '}
|
158
|
+
{!!hostProxy && (
|
159
|
+
<>
|
160
|
+
{__('using Smart Proxy')}{' '}
|
161
|
+
<a href={hostProxy.href}>{hostProxy.name}</a>
|
162
|
+
</>
|
163
|
+
)}
|
164
|
+
</div>
|
165
|
+
</>
|
157
166
|
)}
|
158
167
|
{showTemplatePreview && <PreviewTemplate inputValues={inputValues} />}
|
159
168
|
{showCommand && (
|
@@ -185,6 +194,7 @@ export const TemplateInvocation = ({
|
|
185
194
|
TemplateInvocation.propTypes = {
|
186
195
|
hostID: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
187
196
|
hostName: PropTypes.string, // only used when isInTableView is false
|
197
|
+
hostProxy: PropTypes.object, // only used when isInTableView is false
|
188
198
|
jobID: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
189
199
|
isInTableView: PropTypes.bool,
|
190
200
|
};
|
@@ -192,6 +202,7 @@ TemplateInvocation.propTypes = {
|
|
192
202
|
TemplateInvocation.defaultProps = {
|
193
203
|
isInTableView: true,
|
194
204
|
hostName: '',
|
205
|
+
hostProxy: {},
|
195
206
|
};
|
196
207
|
|
197
208
|
CopyToClipboard.propTypes = {
|
@@ -102,12 +102,10 @@ export const RowActions = ({ hostID, jobID }) => {
|
|
102
102
|
.map(({ text, href, onClick, permission, isDisabled }) =>
|
103
103
|
permission
|
104
104
|
? {
|
105
|
-
title: text
|
106
|
-
component: 'a',
|
107
|
-
className: 'jobs-table-action-item',
|
108
|
-
href,
|
105
|
+
title: <a href={href}>{text}</a>,
|
109
106
|
onClick,
|
110
107
|
isDisabled,
|
108
|
+
className: 'jobs-table-action-item',
|
111
109
|
}
|
112
110
|
: null
|
113
111
|
)
|
@@ -15,6 +15,7 @@ const TemplateInvocationPage = ({
|
|
15
15
|
const {
|
16
16
|
job_invocation_description: jobDescription,
|
17
17
|
host_name: hostName,
|
18
|
+
proxy: hostProxy,
|
18
19
|
} = useSelector(selectTemplateInvocation);
|
19
20
|
const description = sprintf(__('Template Invocation for %s'), hostName);
|
20
21
|
const breadcrumbOptions = {
|
@@ -36,6 +37,7 @@ const TemplateInvocationPage = ({
|
|
36
37
|
jobID={jobID}
|
37
38
|
isInTableView={false}
|
38
39
|
hostName={hostName}
|
40
|
+
hostProxy={hostProxy}
|
39
41
|
/>
|
40
42
|
</PageLayout>
|
41
43
|
);
|
@@ -32,12 +32,16 @@ describe('TemplateInvocation', () => {
|
|
32
32
|
jobID="1"
|
33
33
|
isInTableView={false}
|
34
34
|
hostName="example-host"
|
35
|
+
hostProxy={{ name: 'example-proxy', href: '#' }}
|
35
36
|
/>
|
36
37
|
</Provider>
|
37
38
|
);
|
38
39
|
|
39
|
-
expect(screen.getByText('Target:')).toBeInTheDocument();
|
40
40
|
expect(screen.getByText('example-host')).toBeInTheDocument();
|
41
|
+
expect(screen.getByText('example-proxy')).toBeInTheDocument();
|
42
|
+
|
43
|
+
expect(screen.getByText(/using Smart Proxy/)).toBeInTheDocument();
|
44
|
+
expect(screen.getByText(/Target:/)).toBeInTheDocument();
|
41
45
|
|
42
46
|
expect(screen.getByText('This is red text')).toBeInTheDocument();
|
43
47
|
expect(screen.getByText('This is default text')).toBeInTheDocument();
|
@@ -50,6 +54,7 @@ describe('TemplateInvocation', () => {
|
|
50
54
|
jobID="1"
|
51
55
|
isInTableView={false}
|
52
56
|
hostName="example-host"
|
57
|
+
hostProxy={{ name: 'example-proxy', href: '#' }}
|
53
58
|
/>
|
54
59
|
</Provider>
|
55
60
|
);
|
@@ -101,6 +106,7 @@ describe('TemplateInvocation', () => {
|
|
101
106
|
jobID="1"
|
102
107
|
isInTableView={false}
|
103
108
|
hostName="example-host"
|
109
|
+
hostProxy={{ name: 'example-proxy', href: '#' }}
|
104
110
|
/>
|
105
111
|
);
|
106
112
|
|
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.0.
|
4
|
+
version: 16.0.2
|
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
|
+
date: 2025-04-09 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: deface
|