Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
foreman_wds
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LiU IT - Infrastructure
foreman_wds
Commits
421ac132
Verified
Commit
421ac132
authored
11 months ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Clean up method of extending provision methods
parent
f38fa721
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/assets/javascripts/foreman_wds/host_edit_extensions.js
+15
-12
15 additions, 12 deletions
app/assets/javascripts/foreman_wds/host_edit_extensions.js
app/controllers/concerns/foreman_wds/hosts_controller_extensions.rb
+6
-2
6 additions, 2 deletions
...llers/concerns/foreman_wds/hosts_controller_extensions.rb
with
21 additions
and
14 deletions
app/assets/javascripts/foreman_wds/host_edit_extensions.js
+
15
−
12
View file @
421ac132
...
...
@@ -32,13 +32,6 @@ function wds_os_selected() {
}
};
function
wds_content_loaded
()
{
$
(
'
#wds_provisioning
'
).
detach
().
insertBefore
(
'
#media_select
'
);
$
(
'
#host_provision_method_build
'
).
prop
(
'
disabled
'
,
false
);
$
(
'
#host_provision_method_wds
'
).
prop
(
'
disabled
'
,
false
);
};
function
wds_provision_method_selected
()
{
$
(
'
div[id*=_provisioning]
'
).
hide
();
$
(
'
#network_provisioning
'
).
show
();
...
...
@@ -48,13 +41,23 @@ function wds_provision_method_selected() {
$
(
'
#wds_image_select select
'
).
attr
(
'
disabled
'
,
true
);
}
}
$
(
document
)
.
on
(
'
change
'
,
'
#host_provision_method_wds
'
,
wds_provision_method_selected
)
.
on
(
'
change
'
,
'
.host-architecture-os-select
'
,
wds_os_selected
)
.
on
(
'
ContentLoad
'
,
wds_content_loaded
);
$
(
function
()
{
function
wds_enable_provision_methods
()
{
$
(
'
#provision_method
'
).
show
();
$
(
'
#host_provision_method_build
'
).
prop
(
'
disabled
'
,
false
);
$
(
'
#host_provision_method_wds
'
).
prop
(
'
disabled
'
,
false
);
if
(
$
(
'
#host_provision_method_wds
'
).
is
(
'
:checked
'
))
{
wds_provision_method_selected
();
}
};
$
(
document
)
.
on
(
'
change
'
,
'
#host_provision_method_wds
'
,
wds_provision_method_selected
)
.
on
(
'
change
'
,
'
.host-architecture-os-select
'
,
wds_os_selected
);
$
(
function
()
{
$
(
'
#wds_provisioning
'
).
detach
().
insertBefore
(
'
#media_select
'
);
wds_enable_provision_methods
();
});
This diff is collapsed.
Click to expand it.
app/controllers/concerns/foreman_wds/hosts_controller_extensions.rb
+
6
−
2
View file @
421ac132
...
...
@@ -2,6 +2,8 @@
module
ForemanWds
module
HostsControllerExtensions
extend
ActiveSupport
::
Concern
included
do
before_action
:cleanup_wds_params
...
...
@@ -17,8 +19,10 @@ module ForemanWds
end
def
cleanup_wds_params
# Don't create a WDS facet unless provisioning with it
params
[
:host
].
delete
:wds_facet_attributes
if
params
[
:host
]
&&
params
[
:host
][
:provision_method
]
!=
'wds'
return
unless
params
.
dig
(
:host
,
:provision_method
)
# Don't create a WDS facet if not provisioning with it
params
[
:host
].
delete
:wds_facet_attributes
if
params
.
dig
(
:host
,
:provision_method
)
!=
'wds'
end
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment