Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Terraform Template stack stdout #9285

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions app/helpers/application_helper/toolbar/service_center.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,14 @@ class ApplicationHelper::Toolbar::ServiceCenter < ApplicationHelper::Toolbar::Ba
]
),
])
button_group('service_refresh', [
button(
:service_view,
'fa fa-refresh fa-lg',
N_('Refresh this page'),
N_('Refresh'),
# needs the function because reload can't be called with different this
:data => { 'function' => 'function() { window.location.reload(); }' }
)
])
end
10 changes: 10 additions & 0 deletions app/views/service/_svcs_show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
%ul.nav.nav-tabs{'role' => 'tablist'}
= miq_tab_header("details") do
= _("Details")
- if @record.type == "ServiceTerraformTemplate"
- stack = @record.try(:stack, "Provision")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is extremely close to - provision_job = @record.try(:job, "Provision") below, I wonder if we could drop the "Is this an AnsiblePlaybook service or is it a terraform service" and instead say "does the provision job support stdout" generally

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example #9292

= miq_tab_header("output") do
= _("Output")
- if @record.type == "ServiceAnsiblePlaybook"
- provision_job = @record.try(:job, "Provision")
- retirement_job = @record.try(:job, "Retirement")
Expand All @@ -29,6 +33,12 @@
= _('VMs')
- if @view
= render :partial => "layouts/gtl", :locals => {:view => @view, :no_flash_div => true}

- if @record.type == "ServiceTerraformTemplate"
= miq_tab_content("output", 'default', :class => 'cm-tab') do
- if stack
= react('ServiceDetailStdout', { :taskid => stack.raw_stdout_via_worker(User.current_user&.userid, 'html')});

Comment on lines +36 to +41
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only question is if this could be more like the Ansible examples below versus having the miq_tab_header up above.

- if @record.type == "ServiceAnsibleTower" || @record.type == "ServiceAwx"
= miq_tab_content("tower_job", 'default', :class => 'cm-tab') do
= render :partial => "layouts/textual_groups_tabs", :locals => {:textual_group_list => textual_tower_job_group_list, :tab_id => "tower_job"}
Expand Down