Skip to content
Open
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
5 changes: 4 additions & 1 deletion app/views/app_groups/_list.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,12 @@ table.table.table-hover.table-sm
br
td.col-2 class="d-flex"
- if policy(app_group).see_app_groups?
- location_name = app_group.kibana_helm_infrastructure&.infrastructure_location&.name
- override_map = ENV['BARITO_VIEWER_DOMAIN_OVERRIDED_MAP'].to_s.split(',').map { |pair| pair.split('=') }.to_h
- viewer_domain = override_map[location_name] || Figaro.env.viewer_domain
Comment on lines +72 to +74
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if we put this here, this will be read again and again (in a loop), can we put this outside of the loop so this operation will be executed only once?

.btn.btn-primary.btn-sm style="height: fit-content;"
i.fas.fa-search.mr-1
= link_to 'Open Kibana', "#{Figaro.env.viewer_protocol}://#{Figaro.env.viewer_domain}/#{app_group.cluster_name}/", class: 'text-light', target: '_blank', rel: 'noopener noreferrer', style: 'text-decoration: none'
= link_to 'Open Kibana', "#{Figaro.env.viewer_protocol}://#{viewer_domain}/#{app_group.cluster_name}/", class: 'text-light', target: '_blank', rel: 'noopener noreferrer', style: 'text-decoration: none'
= form_for(app_group, url: bookmark_app_group_path(app_group.id), method: :post, html: { class: 'ml-1' }) do |f|
= hidden_field_tag(:app_group_id, app_group.id)
= f.button class: 'btn btn-sm bg-transparent text-warning'
Expand Down
6 changes: 5 additions & 1 deletion app/views/app_groups/show.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,13 @@
= @labels['app-group'][label]

.card-footer
- location_name = @app_group.kibana_helm_infrastructure&.infrastructure_location&.name
- override_map = ENV['BARITO_VIEWER_DOMAIN_OVERRIDED_MAP'].to_s.split(',').map { |pair| pair.split('=') }.to_h
- viewer_domain = override_map[location_name] || Figaro.env.viewer_domain

.btn.btn-primary.btn-sm.mr-2
i.fas.fa-search.mr-1
= link_to 'Open Kibana', @open_kibana_url, target: '_blank', rel: 'noopener noreferrer', class: 'text-light', style: 'text-decoration: none'
= link_to 'Open Kibana', "#{Figaro.env.viewer_protocol}://#{viewer_domain}/#{@app_group.cluster_name}/", target: '_blank', rel: 'noopener noreferrer', class: 'text-light', style: 'text-decoration: none'
.btn.btn-primary.btn-sm.mr-2
i.fas.fa-tachometer-alt.mr-1
= link_to 'Monitoring', @open_katulampa_url, target: '_blank', rel: 'noopener noreferrer', class: 'text-light', style: 'text-decoration: none'
Expand Down