diff --git a/app/assets/javascripts/system_log.js.coffee b/app/assets/javascripts/system_log.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/system_log.js.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/stylesheets/system_log.css.scss b/app/assets/stylesheets/system_log.css.scss new file mode 100644 index 000000000..aa1f18587 --- /dev/null +++ b/app/assets/stylesheets/system_log.css.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the system_log controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/system_log_controller.rb b/app/controllers/system_log_controller.rb new file mode 100644 index 000000000..9e3d208b0 --- /dev/null +++ b/app/controllers/system_log_controller.rb @@ -0,0 +1,17 @@ +# 显示和清理系统日志 + 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 diff --git a/app/views/layouts/system_log.html.erb b/app/views/layouts/system_log.html.erb new file mode 100644 index 000000000..ba1fe1ad1 --- /dev/null +++ b/app/views/layouts/system_log.html.erb @@ -0,0 +1,54 @@ +<%# +# To change this template, choose Tools | Templates +# and open the template in the editor. +%> + + + +
+<%= raw log %>