|
|
@ -1,4 +1,6 @@
|
|
|
|
# 显示和清理系统日志
|
|
|
|
# Time 2015-01-26 17:12:23
|
|
|
|
|
|
|
|
# Author lizanle
|
|
|
|
|
|
|
|
# Description 显示和清理系统日志
|
|
|
|
class SystemLogController < ApplicationController
|
|
|
|
class SystemLogController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
before_filter :require_admin
|
|
|
|
before_filter :require_admin
|
|
|
@ -6,18 +8,25 @@
|
|
|
|
PER_PAGE = 20
|
|
|
|
PER_PAGE = 20
|
|
|
|
layout "base"
|
|
|
|
layout "base"
|
|
|
|
include SystemLogHelper
|
|
|
|
include SystemLogHelper
|
|
|
|
#查看所有日志
|
|
|
|
|
|
|
|
|
|
|
|
# Time 2015-01-26 17:12:46
|
|
|
|
|
|
|
|
# Author lizanle
|
|
|
|
|
|
|
|
# Description 查看所有日志
|
|
|
|
def index
|
|
|
|
def index
|
|
|
|
@logs = SystemLog.logo_data(params[:page]||1, params[:per]||PER_PAGE, params[:search], params[:day])
|
|
|
|
@logs = SystemLog.logo_data(params[:page]||1, params[:per]||PER_PAGE, params[:search], params[:day])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#清除日志
|
|
|
|
# Time 2015-01-26 14:42:38
|
|
|
|
|
|
|
|
# Author lizanle
|
|
|
|
|
|
|
|
# Description 清除日志
|
|
|
|
def clear
|
|
|
|
def clear
|
|
|
|
SystemLog.clear params[:day]
|
|
|
|
SystemLog.clear params[:day]
|
|
|
|
redirect_to :action => :index
|
|
|
|
redirect_to :action => :index
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#访问分析
|
|
|
|
# Time 2015-01-26 17:24:25
|
|
|
|
|
|
|
|
# Author lizanle
|
|
|
|
|
|
|
|
# Description 访问分析
|
|
|
|
def access_analysis
|
|
|
|
def access_analysis
|
|
|
|
#解析日志,然后逆序
|
|
|
|
#解析日志,然后逆序
|
|
|
|
@log_result = SystemLog.analysis(params[:day]).reverse[1...-1]
|
|
|
|
@log_result = SystemLog.analysis(params[:day]).reverse[1...-1]
|
|
|
@ -34,7 +43,9 @@
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#耗时分析
|
|
|
|
# Time 2015-01-26 17:24:36
|
|
|
|
|
|
|
|
# Author lizanle
|
|
|
|
|
|
|
|
# Description 耗时分析
|
|
|
|
def time_analysis
|
|
|
|
def time_analysis
|
|
|
|
#解析日志
|
|
|
|
#解析日志
|
|
|
|
@log_result = SystemLog.analysis(params[:day]).reverse[1...-1]
|
|
|
|
@log_result = SystemLog.analysis(params[:day]).reverse[1...-1]
|
|
|
|