2016-10-19 03:11:36 +00:00
|
|
|
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
|
2016-04-18 00:02:31 +00:00
|
|
|
|
|
|
|
class HttpLogsController < ApplicationController
|
2017-02-15 12:29:25 +00:00
|
|
|
prepend_before_action :authentication_check
|
2016-04-18 00:02:31 +00:00
|
|
|
|
|
|
|
# GET /http_logs/:facility
|
|
|
|
def index
|
2016-08-12 16:39:09 +00:00
|
|
|
permission_check('admin.*')
|
2016-04-18 00:02:31 +00:00
|
|
|
list = if params[:facility]
|
2019-04-07 15:23:03 +00:00
|
|
|
HttpLog.where(facility: params[:facility]).order(created_at: :desc).limit(params[:limit] || 50)
|
2016-04-18 00:02:31 +00:00
|
|
|
else
|
2019-04-07 15:23:03 +00:00
|
|
|
HttpLog.order(created_at: :desc).limit(params[:limit] || 50)
|
2016-04-18 00:02:31 +00:00
|
|
|
end
|
|
|
|
model_index_render_result(list)
|
|
|
|
end
|
|
|
|
|
|
|
|
# POST /http_logs
|
|
|
|
def create
|
2016-08-12 16:39:09 +00:00
|
|
|
permission_check('admin.*')
|
2016-04-18 00:02:31 +00:00
|
|
|
model_create_render(HttpLog, params)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|