Project

General

Profile

« Previous | Next » 

Revision 376f892b

Added by Tomer Brisker over 8 years ago

Refs #12714 - Improve proxy services tab

View differences:

app/helpers/smart_proxies_helper.rb
module SmartProxiesHelper
TABBED_FEATURES = ["Puppet","Puppet CA"]
def proxy_actions(proxy, authorizer)
[ display_link_if_authorized(_("Edit"), hash_for_edit_smart_proxy_path(:id => proxy), :class => 'edit_two_pane') ] +
[if proxy.has_feature?('Puppet CA')
......
merge(:auth_object => proxy, :permission => 'edit_smart_proxies', :authorizer => authorizer), :method => :put)
end
def proxy_features_besides_puppet(proxy)
proxy_features_lowercase = proxy.features.pluck("LOWER(REPLACE(name, ' ', '_'))").uniq
puppet_features_lowercase = %w(puppet puppet_ca)
proxy_features_lowercase - puppet_features_lowercase
def services_tab_features(proxy)
proxy.features.where('features.name NOT IN (?)', TABBED_FEATURES).pluck("LOWER(REPLACE(name, ' ', '_'))").uniq
end
end
app/views/smart_proxies/show.html.erb
<% javascript('proxy_status') %>
<% title(_('Smart Proxy: %s') % @smart_proxy.to_label) %>
<%= smart_proxy_title_actions(@smart_proxy, authorizer) %>
<% service_features = proxy_features_besides_puppet(@smart_proxy) %>
<% service_features = services_tab_features(@smart_proxy) %>
<div class="row proxy-show" data-url="<%= ping_smart_proxy_path(@smart_proxy) %>">
<ul id="proxy-tab" class="nav nav-tabs">
<li class="active"><a href="#properties" data-toggle="tab"><%= _('Overview') %></a></li>

Also available in: Unified diff