http_logs_controller.rb 643 B

1234567891011121314151617181920212223
  1. # Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
  2. class HttpLogsController < ApplicationController
  3. before_action :authentication_check
  4. # GET /http_logs/:facility
  5. def index
  6. permission_check('admin.*')
  7. list = if params[:facility]
  8. HttpLog.where(facility: params[:facility]).order('created_at DESC').limit(params[:limit] || 50)
  9. else
  10. HttpLog.order('created_at DESC').limit(params[:limit] || 50)
  11. end
  12. model_index_render_result(list)
  13. end
  14. # POST /http_logs
  15. def create
  16. permission_check('admin.*')
  17. model_create_render(HttpLog, params)
  18. end
  19. end