添加了访问统计页面和耗时分析页面

This commit is contained in:
lizanle 2015-01-22 16:47:29 +08:00
parent 458749b921
commit 0502eb16a6
2 changed files with 97 additions and 0 deletions

View File

@ -0,0 +1,41 @@
<% @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%>
<div id='tool'>
<p>
<form action="/system_log/access_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>
<script>
function redo() {
window.location.reload()
}
</script>
<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>
<table border="2" width="100%">
<caption font-size="30px"><%= l(:label_log_access_analysis)%></caption>
<tr><td><%= l(:label_log_access_controller_action)%></td>
<td><%= l(:label_log_access_count)%></td></tr>
<% unless @access_module.nil? %>
<% @access_module.each do |k, v| %>
<% unless k.blank? %>
<tr><td><%= raw k %></td>
<td><%= raw v %></td></tr>
<% end %>
<%end %>
<%end %>
</table>

View File

@ -0,0 +1,56 @@
<% @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%>
<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>
<script>
function redo() {
window.location.reload()
}
</script>
<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_access_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/>