le0pard/mongodb_logger

View on GitHub
lib/mongodb_logger/server/views/overview.erb

Summary

Maintainability
Test Coverage
<% if @collection_stats[:is_capped] %>
  <% content_for :right_top_panel do %>
    <%= partial(:"shared/filter_panel") %>
  <% end %>
<% end %>

<%= partial(:"shared/top_panel") %>

<div class="outer">
  <div class="unit size3of4">
    <div class="filter phm pvs" style="<%= 'display:block;' unless @filter.get_mongo_conditions.blank?  %>">
      <form action="<%=h url_path("overview") %>" method="get" accept-charset="UTF-8">
        <div class="outer mvs">
          <div class="unit size1of3">
            <div class="unit size1of2">
              <div class="prm">
                <%= text_field_tag @filter, :controller, :placeholder => "Controller" %>
              </div> <!-- prm -->
            </div>
            <div class="unit size1of2">
              <div class="prm">
                <%= text_field_tag @filter, :action, :placeholder => "Action" %>
              </div>
            </div>
          </div>
            <div class="unit size1of3">
              <div class="unit size1of2">
                <div class="prm">
                  <%= select_tag @filter, :limit, [[50, "Limits - 50"], [100, "Limits - 100"], [200, "Limits - 200"], [500, "Limits - 500"], [1000, "Limits - 1000"]] %>
                </div> <!-- prm -->
              </div> <!-- unit -->
              <div class="unit size1of2">
                <div class="prm">
                  <%= text_field_tag @filter, :application_name, :placeholder => "Application Name" %>
                </div>
              </div>
            </div>
            <div class="unit size1of3">
              <div class="unit size1of2">
                <div class="prm">
                  <%= text_field_tag @filter, :ip, :placeholder => "IP" %>
                </div>
              </div>
              <div class="unit size1of2">
                <%= check_box_tag @filter, :is_exception %>
                <%= label_tag @filter, :is_exception, "Exceptions" %>
              </div> <!-- unit -->
            </div> <!-- unit -->
        </div> <!-- outer -->

        <div class="outer">
              <ul id="moreFilterList">
                <% @filter.more_filters.each_with_index do |f_filter, index| %>
                  <li>
                    <%= partial(:"shared/dynamic_filter", :object => f_filter) %>
                  </li>
                <% end %>
              </ul>
              <div class="mbs">
                <a id="addMoreFilter" href="<%=h url_path("add_filter") %>" class="add">+ Add Filter</a>
              </div>

        </div> <!-- outer -->

        <div class="outer">
          <%= submit_tag :submit, "Filter", :class => "button primary mrs" %> <a href="<%=h url_path("overview") %>">Clear</a>
        </div> <!-- outer -->

        <div class="outer">
          <div class="pvs">
            <hr />
          </div>
        </div>

        <div class="outer">
          <div class="unit size1of1">
            <div class="pvs">
              <strong>Mongodb Condition:</strong><br />
              <%=h @filter.get_mongo_conditions.inspect %>
            </div>
          </div>
        </div>

      </form>
      </div> <!-- filter -->

      <div class="filter_toggle filter-toggle"><span class="arrow-down <%= 'rotate' unless @filter.get_mongo_conditions.blank? %>">Filter</span></div>

      <% if @logs.count > 0 %>
        <table id="logsList">
          <tr>
            <th>Received</th>
            <th>Controller</th>
            <th>Action</th>
            <th>Method</th>
            <th>IP</th>
            <th>Runtime</th>
          </tr>

          <% @logs.each do |log| %>
            <%= partial(:"shared/log", :object => log) %>
          <% end %>
        </table>
      <% else %>
        <div class="pale pal txtC">No logs found, try to filter out the other parameters</div>
      <% end %>
  </div> <!-- unit size3of4 -->

  <div class="unit size1of4">
    <div class="details">

      <div id="logInfo">
        <div class="pale h2 pal txtC">
          Please choose log to see details
        </div> <!-- pale h2 -->
      </div>
    </div> <!-- details -->
  </div> <!-- unit size1of4 -->
</div> <!-- outer -->