http_logs_controller.rb 605 B

123456789101112131415161718192021
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. class HttpLogsController < ApplicationController
  3. prepend_before_action { authentication_check && authorize! }
  4. # GET /http_logs/:facility
  5. def index
  6. list = if params[:facility]
  7. HttpLog.where(facility: params[:facility]).order(created_at: :desc).limit(params[:limit] || 50)
  8. else
  9. HttpLog.order(created_at: :desc).limit(params[:limit] || 50)
  10. end
  11. model_index_render_result(list)
  12. end
  13. # POST /http_logs
  14. def create
  15. model_create_render(HttpLog, params)
  16. end
  17. end