|
|
@ -9,8 +9,6 @@
|
|
|
|
#查看所有日志
|
|
|
|
#查看所有日志
|
|
|
|
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])
|
|
|
|
@logs
|
|
|
|
|
|
|
|
#@access_module = params[:access_module] unless params[:access_module].nil?
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#清除日志
|
|
|
|
#清除日志
|
|
|
@ -24,7 +22,7 @@
|
|
|
|
#解析日志,然后逆序
|
|
|
|
#解析日志,然后逆序
|
|
|
|
@log_result = SystemLog.analysis(params[:day]).reverse[1...-1]
|
|
|
|
@log_result = SystemLog.analysis(params[:day]).reverse[1...-1]
|
|
|
|
@access_module = Hash.new
|
|
|
|
@access_module = Hash.new
|
|
|
|
#如果日誌為空
|
|
|
|
#日誌可能為空
|
|
|
|
if @log_result && !@log_result.empty?
|
|
|
|
if @log_result && !@log_result.empty?
|
|
|
|
#将数组中的模块访问统计出来放到hash中 每条记录的第四个值是Controller#action的形式
|
|
|
|
#将数组中的模块访问统计出来放到hash中 每条记录的第四个值是Controller#action的形式
|
|
|
|
@log_result.collect! {|r| @access_module[r[3]].nil? ?
|
|
|
|
@log_result.collect! {|r| @access_module[r[3]].nil? ?
|
|
|
|