过滤掉日志中日志分析的请求

This commit is contained in:
lizanle 2015-01-30 11:31:41 +08:00
parent 0785384813
commit 852bb940a2
1 changed files with 7 additions and 1 deletions

View File

@ -25,11 +25,17 @@ module SystemLogHelper
logs = Kaminari.paginate_array(logs).page(page).per(per).collect! { |log| parse(log) }
#将分页后的记录的搜索结果添加样式,样式中的\0是给给r占位置的。
logs.collect! do |log|
keywords.each { |r| log.gsub!(r, '<span class="search_results">\0</span>') }
keywords.each { |r| log.gsub!(r, '<span class="search_results">\0</span>') && log = "" if log =~ Regexp.new("SystemLogController",'i') }
log
end
else
logs = Kaminari.paginate_array(logs).page(page).per(per).collect! { |log| parse(log) }
# 过滤掉日志中日志分析请求
logs.collect! do |log|
log = "" if log =~ Regexp.new("SystemLogController",'i')
log
end
end
logs
end