<%unless existing_configs.blank?%>
<div class="row">
  <div class="col-md-12 col-xs-12">
    <div class="panel panel-default">
      <div class="panel-heading heading-text-panel clearfix">
        <i class="icon-dashboard"></i>
        <h3 class="panel-title">SNMP Configurations</h3>
      </div>
      <div class="panel-body">
        <table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
          <thead>
            <tr>
              <th>Server IP</th>
              <th>Server Port</th>
              <th>Server Community</th>
              <th>RO Community</th>
              <th>RW Community</th>
              <th width="30%">AP / Network / AP Tags</th>
              <% if can? :manage, SnmpConfig%><th class='datatable-nosort'>Action</th><%end%>
            </tr>
          </thead>
          <tbody>
            <%existing_configs.each do |x|%>
            <tr>
              <td><%= x.server_ip %></td>
              <td><%= x.server_port %></td>
              <td><%= x.server_community %></td>
              <td><%= x.ro_community %></td>
              <td><%= x.rw_community %></td>
              <% arr = x.tagging_lists.split("&&")  unless x.tagging_lists.blank?%>
              <td>
                <% x.config_mappings.each do |list|%>
                  <% unless list.resourceable.blank?%>
                    <%name,path,title = show_tags(list,:snmp_configs) %>
                    <%= link_to name, path ,:class=>"label label-primary",:title => title%> &nbsp;
                  <% end %>
                <% end %>
              </td>
              <% if can? :manage, SnmpConfig%>
              <td><%= link_to 'Edit', {:controller=>:snmp_configs, :action=>:index, :id=>x.id}, :class => "label label-info" %>
              <%= link_to 'Destroy', x, method: :delete, data: { confirm: 'Are you sure you want to delete?' }, :class => "label label-danger" %></td>
              <%end%>
            </tr>
            <%end%>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>
<%end%>
