foreman_patch 1.1.5 → 1.1.6.alpha4
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/foreman_patch/concerns/hosts_controller_extensions.rb +35 -41
- data/app/controllers/foreman_patch/react_controller.rb +12 -0
- data/app/lib/actions/foreman_patch/cycle/create.rb +5 -1
- data/app/lib/actions/foreman_patch/cycle/initiate.rb +5 -1
- data/app/lib/actions/foreman_patch/invocation/action.rb +23 -29
- data/app/lib/actions/foreman_patch/invocation/patch.rb +16 -7
- data/app/lib/actions/foreman_patch/invocation/process_logging.rb +44 -0
- data/app/lib/actions/foreman_patch/invocation/proxy_action.rb +52 -0
- data/app/lib/actions/foreman_patch/invocation/wait_for_host.rb +4 -29
- data/app/lib/actions/foreman_patch/round/patch.rb +5 -1
- data/app/lib/actions/foreman_patch/window/publish.rb +5 -1
- data/app/lib/actions/foreman_patch/window/resolve_hosts.rb +5 -1
- data/app/models/foreman_patch/event.rb +13 -0
- data/app/models/foreman_patch/invocation.rb +2 -4
- data/app/views/foreman_patch/api/v2/invocations/base.json.rabl +1 -1
- data/app/views/foreman_patch/api/v2/invocations/event.json.rabl +3 -0
- data/app/views/foreman_patch/api/v2/invocations/show.json.rabl +2 -2
- data/app/views/foreman_patch/groups/index.html.erb +1 -1
- data/app/views/foreman_patch/layouts/react.html.erb +1 -1
- data/config/api_routes.rb +26 -28
- data/config/routes.rb +40 -29
- data/db/migrate/20230706092400_nullify_group_on_delete.rb +11 -0
- data/db/migrate/20230707102800_create_invocation_events.rb +16 -0
- data/db/seeds.d/100-assign_features_with_templates.rb +6 -12
- data/lib/foreman_patch/engine.rb +11 -46
- data/lib/foreman_patch/register.rb +119 -0
- data/lib/foreman_patch/version.rb +1 -1
- data/locale/en/foreman_patch.po +1 -1
- data/locale/foreman_patch.pot +1 -1
- data/locale/gemspec.rb +1 -1
- data/package.json +4 -0
- data/public/assets/foreman_patch/calendar-b5391efda77239c4a4894e9f03f34610f6c8e2e748b2a147febfea814b857cdc.scss.gz +0 -0
- data/public/assets/foreman_patch/cycle_plans-e5667e178ba389908f5c815b24ec0ea77c340849d56bc39c5ce72bb626bd446a.scss +6 -0
- data/public/assets/foreman_patch/cycle_plans-e5667e178ba389908f5c815b24ec0ea77c340849d56bc39c5ce72bb626bd446a.scss.gz +0 -0
- data/public/assets/foreman_patch/cycle_plans-ff3d252119622a68828ff70f4a97328303963002237dbf850e92d6a706e93667.scss +6 -0
- data/public/assets/foreman_patch/cycle_plans-ff3d252119622a68828ff70f4a97328303963002237dbf850e92d6a706e93667.scss.gz +0 -0
- data/public/assets/foreman_patch/foreman_patch-410cf04bf9b09e65fee034cc3f2dd74acf2524abf881c6d6e559d5c62a615faf.css +11 -0
- data/public/assets/foreman_patch/foreman_patch-410cf04bf9b09e65fee034cc3f2dd74acf2524abf881c6d6e559d5c62a615faf.css.gz +0 -0
- data/public/assets/foreman_patch/foreman_patch-84845e54f06d3a11189828e656432d587c7312358cdf694753da7b78b7dabcee.css +11 -0
- data/public/assets/foreman_patch/foreman_patch-84845e54f06d3a11189828e656432d587c7312358cdf694753da7b78b7dabcee.css.gz +0 -0
- data/public/assets/foreman_patch/foreman_patch-a76c5fd10a5795e97c5ae4c222bfdf4ab88da49d6a7659175dba79f8fc62ab47.css +82 -0
- data/public/assets/foreman_patch/foreman_patch-a76c5fd10a5795e97c5ae4c222bfdf4ab88da49d6a7659175dba79f8fc62ab47.css.gz +0 -0
- data/public/assets/foreman_patch/foreman_patch.json +1 -0
- data/public/assets/foreman_patch/plan_edit_windows-2eb04c7e83fa62797b0a14364d3ff5b3c4336983603fdc5a276b5464eeba7e60.js +9 -0
- data/public/assets/foreman_patch/plan_edit_windows-2eb04c7e83fa62797b0a14364d3ff5b3c4336983603fdc5a276b5464eeba7e60.js.gz +0 -0
- data/public/assets/foreman_patch/plan_edit_windows-ddedd3e70fb6ef761f636be2b7b35286e86d68e126bfc37294f9365a5171a928.js +9 -0
- data/public/assets/foreman_patch/plan_edit_windows-ddedd3e70fb6ef761f636be2b7b35286e86d68e126bfc37294f9365a5171a928.js.gz +0 -0
- data/public/webpack/foreman_patch/bundle.css +1 -0
- data/public/webpack/foreman_patch/bundle.js +34173 -0
- data/public/webpack/foreman_patch/foreman_patch.css +1 -0
- data/public/webpack/foreman_patch/foreman_patch.js +34366 -0
- data/public/webpack/foreman_patch/foreman_patch:global.css +1 -0
- data/public/webpack/foreman_patch/foreman_patch:global.js +32098 -0
- data/public/webpack/foreman_patch/manifest.json +25 -0
- data/public/webpack/foreman_patch/vendor.js +5201 -0
- data/webpack/components/Invocations/InvocationsPage.js +1 -1
- data/webpack/components/Invocations/index.js +6 -6
- data/webpack/components/common/Calendar/Calendar.css +76 -0
- data/webpack/components/common/Calendar/Calendar.js +5 -4
- data/webpack/components/common/Table/index.js +28 -0
- data/webpack/global_index.js +16 -0
- data/webpack/index.js +3 -8
- data/webpack/src/Components/Invocation/Invocation.js +67 -0
- data/webpack/src/Components/Invocation/InvocationLogFooter.js +30 -0
- data/webpack/src/Components/Invocation/InvocationLogToolbar.js +80 -0
- data/webpack/{components → src/Components}/Invocation/InvocationSelectors.js +0 -3
- data/webpack/src/Components/Invocation/index.js +62 -0
- data/webpack/src/Components/InvocationStatus.js +50 -0
- data/webpack/src/Components/Loading.js +51 -0
- data/webpack/src/Extends/index.js +15 -0
- data/webpack/src/Router/routes.js +4 -2
- data/webpack/src/reducers.js +1 -1
- metadata +57 -88
- data/app/lib/actions/foreman_patch/cycle/complete.rb +0 -41
- data/app/lib/actions/foreman_patch/cycle/plan.rb +0 -73
- data/app/lib/actions/foreman_patch/round/plan.rb +0 -33
- data/app/lib/actions/foreman_patch/window/plan.rb +0 -43
- data/app/models/setting/patching.rb +0 -57
- data/app/views/foreman_patch/api/v2/invocations/phase.json.rabl +0 -7
- data/config/routes/mount_engine.rb +0 -3
- data/config/routes/overrides.rb +0 -10
- data/lib/foreman_patch/plugin.rb +0 -47
- data/webpack/components/Invocation/Invocation.js +0 -47
- data/webpack/components/Invocation/index.js +0 -36
- data/webpack/components/common/Terminal/OutputLine.js +0 -26
- data/webpack/components/common/Terminal/Terminal.js +0 -115
- data/webpack/components/common/Terminal/Terminal.scss +0 -47
- data/webpack/src/ForemanPatch.js +0 -11
- data/webpack/src/Router/index.js +0 -14
- data/webpack/src/index.js +0 -1
- /data/{webpack/components/common/Calendar/Calendar.scss → public/assets/foreman_patch/calendar-b5391efda77239c4a4894e9f03f34610f6c8e2e748b2a147febfea814b857cdc.scss} +0 -0
- /data/webpack/components/Invocations/{Invocations.scss → Invocations.css} +0 -0
- /data/webpack/{components → src/Components}/Invocation/InvocationActions.js +0 -0
- /data/webpack/{components → src/Components}/Invocation/InvocationConsts.js +0 -0
@@ -1,26 +0,0 @@
|
|
1
|
-
import React, { useState } from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import { classnames } from 'classname';
|
4
|
-
|
5
|
-
const OutputLine = ({index, type, children}) => {
|
6
|
-
return (
|
7
|
-
<div className={classnames('line', type)} >
|
8
|
-
<span className="counter">{index}</span>
|
9
|
-
<div className="content">
|
10
|
-
{children}
|
11
|
-
</div>
|
12
|
-
</div>
|
13
|
-
);
|
14
|
-
};
|
15
|
-
|
16
|
-
OutputLine.propTypes = {
|
17
|
-
index: PropTypes.number.isRequired,
|
18
|
-
type: PropTypes.string,
|
19
|
-
timestamp: PropTypes.number,
|
20
|
-
};
|
21
|
-
|
22
|
-
OutputLine.defaultProps = {
|
23
|
-
type: 'stdout',
|
24
|
-
};
|
25
|
-
|
26
|
-
export default OutputLine;
|
@@ -1,115 +0,0 @@
|
|
1
|
-
import React, { useState } from 'react';
|
2
|
-
import PropTypes from 'prop-types';
|
3
|
-
import { Button } from 'patternfly-react';
|
4
|
-
|
5
|
-
import OutputLine from './OutputLine';
|
6
|
-
import './Terminal.scss';
|
7
|
-
|
8
|
-
class Terminal extends React.Component {
|
9
|
-
constructor(props) {
|
10
|
-
super(props);
|
11
|
-
this._currentColor = 'default';
|
12
|
-
this._colorMap = new Proxy({
|
13
|
-
'31': 'red',
|
14
|
-
'32': 'lightgreen',
|
15
|
-
'33': 'orange',
|
16
|
-
'34': 'deepskyblue',
|
17
|
-
'35': 'mediumpurple',
|
18
|
-
'36': 'cyan',
|
19
|
-
'37': 'grey',
|
20
|
-
'91': 'red',
|
21
|
-
'92': 'lightgreen',
|
22
|
-
'93': 'yellow',
|
23
|
-
'94': 'lightblue',
|
24
|
-
'95': 'violet',
|
25
|
-
'96': 'turquoise',
|
26
|
-
'0': 'default',
|
27
|
-
}, {
|
28
|
-
get: (target, name) => {
|
29
|
-
if name
|
30
|
-
return (target.hasOwnProperty(name) ? target[name] : 'default');
|
31
|
-
else
|
32
|
-
return this._currentColor;
|
33
|
-
}
|
34
|
-
});
|
35
|
-
}
|
36
|
-
|
37
|
-
scrollToBottom = () => {
|
38
|
-
window.scrollTo({
|
39
|
-
top: document.documentElement.scrollHeight,
|
40
|
-
behavior: 'smooth',
|
41
|
-
});
|
42
|
-
}
|
43
|
-
|
44
|
-
scollToTop = () => {
|
45
|
-
window.scrollTo({
|
46
|
-
top: 0,
|
47
|
-
behavior: 'smooth',
|
48
|
-
});
|
49
|
-
}
|
50
|
-
|
51
|
-
get lines() {
|
52
|
-
const { linesets } = this.props.linesets;
|
53
|
-
|
54
|
-
return linesets.flatMap(lineset => (
|
55
|
-
lineset.output.replace(/\r\n/,"\n").replace(/\n$/,'').split("\n").map(line => (
|
56
|
-
{ output_type: lineset.output_type, output: line, timestamp: lineset.timestamp }
|
57
|
-
))
|
58
|
-
));
|
59
|
-
}
|
60
|
-
|
61
|
-
colorize(line) {
|
62
|
-
const pattern = /(?:\033\[(?:.*?)(?<color>\d+)m)?(?<text>[^\033]+)/g;
|
63
|
-
|
64
|
-
return (Array.from(line.matchAll(pattern), match => {
|
65
|
-
this._currentColor = this._colorMap[match.groups.color];
|
66
|
-
return (<span style={`color: ${this._currentColor}`}>{match.groups.text}</span>);
|
67
|
-
}));
|
68
|
-
}
|
69
|
-
|
70
|
-
getSnapshotBeforeUpdate(prevProps, prevState) {
|
71
|
-
return (window.scrollY + document.documentElement.clientHeight == document.documentElement.scrollHeight);
|
72
|
-
}
|
73
|
-
|
74
|
-
componentDidUpdate(prevProps, prevState, snapshot) {
|
75
|
-
if (snapshot) {
|
76
|
-
this.scrollToBottom();
|
77
|
-
}
|
78
|
-
}
|
79
|
-
|
80
|
-
render() {
|
81
|
-
const { lines } = this.props;
|
82
|
-
|
83
|
-
return (
|
84
|
-
<div className="terminal">
|
85
|
-
<Button variant="link" className="pull-right scroll-link-bottom" onClick={scrollToBottom}>
|
86
|
-
{__('Scroll to bottom')}
|
87
|
-
</Button>
|
88
|
-
<div className="printable">
|
89
|
-
{this.lines.map((line, index) => (
|
90
|
-
<OutputLine key={index} index={index} timestamp={line.timestamp} type={line.output_type}>
|
91
|
-
{this.colorize(line)}
|
92
|
-
</OutputLine>
|
93
|
-
))}
|
94
|
-
</div>
|
95
|
-
<Button variant="link" className="pull-right scroll-link-top" onClick={scrollToTop}>
|
96
|
-
{__('Scroll to top')}
|
97
|
-
</Button>
|
98
|
-
</div>
|
99
|
-
);
|
100
|
-
}
|
101
|
-
}
|
102
|
-
|
103
|
-
Terminal.propTypes = {
|
104
|
-
linesets: PropTypes.array(PropTypes.shape({
|
105
|
-
output_type: PropTypes.string.isRequired,
|
106
|
-
output: PropTypes.string.isRequired,
|
107
|
-
timestamp: PropTypes.number.isRequired,
|
108
|
-
}),
|
109
|
-
};
|
110
|
-
|
111
|
-
Terminal.defaultProps = {
|
112
|
-
linesets: [],
|
113
|
-
};
|
114
|
-
|
115
|
-
export default Terminal;
|
@@ -1,47 +0,0 @@
|
|
1
|
-
div.terminal {
|
2
|
-
display: block;
|
3
|
-
padding: 9.5px;
|
4
|
-
margin: 0 0 10px;
|
5
|
-
font-size: 12px;
|
6
|
-
word-break: break-all;
|
7
|
-
word-wrap: break-word;
|
8
|
-
color: rgba(255, 255, 255, 1);
|
9
|
-
background-color: rgba(47, 47, 47, 1);
|
10
|
-
border: 1px solid #000000;
|
11
|
-
border-radius: 0px;
|
12
|
-
font-family: Menlo, Monaco, Consolas, monospace;
|
13
|
-
|
14
|
-
div.printable {
|
15
|
-
min-height: 50px;
|
16
|
-
}
|
17
|
-
|
18
|
-
div.line.stderr, div.line.error, div.line.debug {
|
19
|
-
color: red;
|
20
|
-
}
|
21
|
-
|
22
|
-
div.line span.counter {
|
23
|
-
float: left;
|
24
|
-
clear: left;
|
25
|
-
}
|
26
|
-
|
27
|
-
div.line div.content {
|
28
|
-
position: relative;
|
29
|
-
margin-left: 50px;
|
30
|
-
white-space: pre-wrap;
|
31
|
-
}
|
32
|
-
|
33
|
-
a {
|
34
|
-
color: #FFFFFF;
|
35
|
-
}
|
36
|
-
|
37
|
-
a.scroll-link-top {
|
38
|
-
position: relative;
|
39
|
-
bottom: 10px;
|
40
|
-
}
|
41
|
-
|
42
|
-
a.scroll-link-bottom {
|
43
|
-
position: relative;
|
44
|
-
z-index: 5;
|
45
|
-
}
|
46
|
-
|
47
|
-
}
|
data/webpack/src/ForemanPatch.js
DELETED
data/webpack/src/Router/index.js
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { Switch, Route } from 'react-router-dom';
|
3
|
-
|
4
|
-
import routes from './routes';
|
5
|
-
|
6
|
-
const Router = () => (
|
7
|
-
<Switch>
|
8
|
-
{Object.entries(routes).map(([key, props]) => (
|
9
|
-
<Route key={key} {...props} />
|
10
|
-
))}
|
11
|
-
</Switch>
|
12
|
-
);
|
13
|
-
|
14
|
-
export default Router;
|
data/webpack/src/index.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export { default } from './ForemanPuppet';
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|