<% @nav_dispaly_home_path_label = 1
   @nav_dispaly_main_course_label = 1
   @nav_dispaly_main_project_label = 1
   @nav_dispaly_main_contest_label = 1 %>
<% @nav_dispaly_forum_label = 1%>
<style type="text/css">
    body {
        color: #333333;
        font-family: lucida grande, Lucida Sans Unicode, Arial, Helvetica, sans-serif;
        font-size: 12px;
        line-height: 20px;
    }
    table  {border:1px solid !important;
    }
    td  {border:1px solid !important;
    }
</style>
<div id='tool'>
  <p>
  <form action="/system_log/time_analysis" style="float:right" >
    <input name="day" type="text" size="36" value="<%= params[:day].nil? ? Time.now.strftime("%Y-%m-%d") : params[:day]  %>" maxlength="100" readonly="true" onclick="HS_setDate(this)"/>
    <input type="submit" value="<%=l(:label_search_member)%>" size="30" id="search"/>
  </form>
  </p>
  <div id='tool-bar'>
    <%=link_to l(:label_log_detail), system_log_path %> |
    <%=link_to l(:label_log_delete_log), system_log_clear_path, {:confirm => l(:label_log_delete_confirm),:day=>params[:day].nil? ? Time.now.strftime("%Y-%m-%d") : params[:day]}%>  |
    <%=link_to l(:label_log_access_analysis), system_log_access_analysis_path %> |
    <%=link_to l(:label_log_time_analysis), system_log_time_analysis_path %> |
    <%=link_to_function l(:label_log_refresh), 'redo()' %>
  </div>
</div>
<div>&nbsp;&nbsp;</div>
<%= paginate @log_result unless @log_result.empty? %><br/>
<table border="2" >
  <caption font-size="30px"><%= l(:label_log_time_analysis) %></caption>
  <tr><td width="10%"><%= l(:label_log_url) %></td>
    <td width="10%"><%= l(:label_log_ip) %></td>
    <td width="10%"><%= l(:label_log_access_time) %></td>
    <td width="10%"><%= l(:label_log_access_controller_action) %></td>
    <td width="10%"><%= l(:label_log_response_time) %></td>
    <td width="10%"><%= l(:label_log_views_time) %></td>
    <td width="10%"><%= l(:label_log_views_time_percent) %></td>
    <td width="10%"><%= l(:label_log_active_record_time) %></td>
    <td width="10%"><%= l(:label_log_active_record_time_percent) %></td></tr>
 <% unless @log_result.nil? %>
<%  @log_result.each do |r| %>
  <%  unless r.blank? %>
     <!-- #如果请求地址不为空，且长度大于50，那么我们就截取长度20 %-->
    <tr><td width="10%"><%= raw r[0].length>50?r[0].truncate(20) : r[0] unless r[0].nil? %></td>
      <td width="10%"><%= raw r[1] %></td>
      <td width="10%"><%= raw r[2] %></td>
      <td width="10%"><%= raw r[3] %></td>
      <td width="10%"><%= raw r[4] %></td>
      <td width="10%"><%= raw r[5] %></td>
      <td width="10%"><%= raw r[6] %></td>
      <td width="10%"><%= raw r[7] %></td>
      <td width="10%"><%= raw r[8] %></td></tr>
  <% end %>
<%end %>
 <%end %>
</table>
<%= paginate @log_result unless @log_result.empty? %><br/>