Sha256: cdc15adf4cc357454bca838c23bb8be378b17e3672863d898813b733c61f2b94
Contents?: true
Size: 1.96 KB
Versions: 25
Compression:
Stored size: 1.96 KB
Contents
<%= render_file('common/header.html.erb', title: 'Nodes') %><% service_tag_filter = ENV['SERVICES_TAG_FILTER'] || nil # Services to hide services_blacklist_raw = (ENV['EXCLUDE_SERVICES'] || 'lbl7.*,netsvc-probe.*,consul-probed.*').split(',') services_blacklist = services_blacklist_raw.map { |v| Regexp.new(v) } service_per_node = {} services.each do |service_name, tags| if !services_blacklist.any? {|r| r.match(service_name)} service(service_name, tag: service_tag_filter).sort {|a,b| a['Node']['Node'] <=> b['Node']['Node'] }.each do |snode| node_services = service_per_node[snode['Node']['Node']] || [] node_services.push(snode) service_per_node[snode['Node']['Node']] = node_services end end end %> <h1 id="nodes">List all nodes for DC, sorted by name</h1> <ul class="list-group"> <% nodes.sort {|a,b| a['Node'] <=> b['Node'] }.each do |snode| %><li id="node_<%= snode['ID'] %>" class="list-group-item"> <a href="ssh://<%= snode['Address']%>"><%= snode['Address'] %></a> <%= snode['Node'] %><% snode['Meta'].each do |k,v| if v && !v.empty? %><span class="badge badge-pill badge-primary float-right"><%= k %>: <%= v%></span><% end end if snode['Meta'] %><div><% if service_per_node.key?(snode['Node']) service_per_node[snode['Node']].each do |service| tags = service['Service']['Tags'].sort addr = service.service_address port_num = service['Service']['Port'].to_i port = port_num && port_num > 0 ? ":#{port_num}" : '' url = if tags.include? 'https' "https://#{addr}#{port}" elsif tags.include? 'http' "http://#{addr}#{port}" elsif tags.include? 'ftp' "ftp://#{addr}#{port}" else nil end %> <a class="badge badge-secondary" href='<%= url %>'> <%= service['Service']['Service'] %>: <%= port_num %> </a> <% end end %></div></li> <% end %> </ul> <%= render_file 'common/footer.html.erb' %>
Version data entries
25 entries across 25 versions & 1 rubygems