Skip to content

Commit

Permalink
Unify provision/retire tabs and output for Services
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Oct 21, 2024
1 parent d12d720 commit e3100c0
Showing 1 changed file with 12 additions and 29 deletions.
41 changes: 12 additions & 29 deletions app/views/service/_svcs_show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,15 @@
%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"
- if @record.respond_to?(:job)
- provision_job = @record.try(:job, "Provision")
- retirement_job = @record.try(:job, "Retirement")
= miq_tab_header("provisioning") do
= _("Provisioning")
- if provision_job
= miq_tab_header("provisioning") do
= _("Provisioning")
- if retirement_job
= miq_tab_header("retirement") do
= _("Retirement")
-if @record.type == "ServiceAnsibleTower" || @record.type == "ServiceAwx"
- job = @record.try(:job)
= miq_tab_header("tower_job") do
= _("Job")
.tab-content
= miq_tab_content("details", 'default', :class => 'cm-tab') do
= render :partial => "layouts/textual_groups_generic"
Expand All @@ -33,28 +26,18 @@
= _('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"}
- if job && job.respond_to?(:raw_stdout_via_worker)
= react('ServiceDetailStdout', { :taskid => @record.job.raw_stdout_via_worker(User.current_user&.userid, 'html')})

- if @record.type == "ServiceAnsiblePlaybook"
- if provision_job
= miq_tab_content("provisioning", 'default', :class => 'cm-tab') do
= render :partial => "layouts/textual_groups_tabs", :locals => {:textual_group_list => textual_provisioning_group_list, :tab_id => "provisioning"}
- if provision_job
= react('ServiceDetailStdout', { :taskid => provision_job.raw_stdout_via_worker(User.current_user&.userid, 'html')});
- if provision_job.respond_to?(:raw_stdout_via_worker)
= react('ServiceDetailStdout', {:taskid => provision_job.raw_stdout_via_worker(User.current_user&.userid, 'html')});

- if retirement_job
= miq_tab_content("retirement", 'default', :class => 'cm-tab') do
= render :partial => "layouts/textual_groups_tabs", :locals => {:textual_group_list => textual_retirement_group_list, :tab_id => "retirement"}
= react('ServiceDetailStdout', { :taskid => retirement_job.raw_stdout_via_worker(User.current_user&.userid, 'html')})
- if retirement_job
= miq_tab_content("retirement", 'default', :class => 'cm-tab') do
= render :partial => "layouts/textual_groups_tabs", :locals => {:textual_group_list => textual_retirement_group_list, :tab_id => "retirement"}
- if retirement_job.respond_to?(:raw_stdout_via_worker)
= react('ServiceDetailStdout', {:taskid => retirement_job.raw_stdout_via_worker(User.current_user&.userid, 'html')})

:javascript
miq_tabs_init('#services_tab');

0 comments on commit e3100c0

Please sign in to comment.