18 lines
483 B
Ruby
18 lines
483 B
Ruby
|
# 显示和清理系统日志
|
||
|
class SystemLogController < ApplicationController
|
||
|
# 默认每页显示20条记录
|
||
|
before_filter :require_login ,:only =>:index
|
||
|
before_filter :require_admin ,:only =>:clear
|
||
|
PER_PAGE = 20
|
||
|
layout "base"
|
||
|
include SystemLogHelper
|
||
|
def index
|
||
|
@logs = SystemLog.logo_data(params[:page]||1,params[:per]||PER_PAGE,params[:search] )
|
||
|
end
|
||
|
|
||
|
def clear
|
||
|
SystemLog.clear
|
||
|
redirect_to :action => :index
|
||
|
end
|
||
|
end
|