http_logs_controller.rb 599 B

123456789101112131415161718192021
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class HttpLogsController < ApplicationController
  3. prepend_before_action :authenticate_and_authorize!
  4. # GET /http_logs/:facility
  5. def index
  6. list = if params[:facility]
  7. HttpLog.where(facility: params[:facility]).reorder(created_at: :desc).limit(params[:limit] || 50)
  8. else
  9. HttpLog.reorder(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