From 5499814505960f936d4d88fbe916b0618f3f44a5 Mon Sep 17 00:00:00 2001 From: Adam Grare Date: Mon, 21 Oct 2024 09:24:09 -0400 Subject: [PATCH] Merge pull request #9285 from putmanoj/show-terraform-stdout Show Terraform Template stack stdout (cherry picked from commit d12d7201da22f230409976b069d672d45d63d55c) --- .../application_helper/toolbar/service_center.rb | 10 ++++++++++ app/views/service/_svcs_show.html.haml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/app/helpers/application_helper/toolbar/service_center.rb b/app/helpers/application_helper/toolbar/service_center.rb index 176a9de8339..c9b1a191c00 100644 --- a/app/helpers/application_helper/toolbar/service_center.rb +++ b/app/helpers/application_helper/toolbar/service_center.rb @@ -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 diff --git a/app/views/service/_svcs_show.html.haml b/app/views/service/_svcs_show.html.haml index 860ca86bfb6..8616cccfc70 100644 --- a/app/views/service/_svcs_show.html.haml +++ b/app/views/service/_svcs_show.html.haml @@ -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") + = miq_tab_header("output") do + = _("Output") - if @record.type == "ServiceAnsiblePlaybook" - provision_job = @record.try(:job, "Provision") - retirement_job = @record.try(:job, "Retirement") @@ -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')}); + - 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"}